diego.velasquez

No Role found for signer email

0 votes

Hi, i'm gettin this error message "OneSpanSign.Sdk.OssException: 'No Role found for signer email ", creating a package, this is the code that i'm using, thanks for the help.

 String API_KEY = "dzkxxxljQw==";
            String CLIENT_APP_ID = "17bbxxx338b";
            String CLIENT_APP_SECRET = "687964xxx79118c29";
            String BASE_API_URL = "https://sandbox.esignlive.com";    
            String API_URL = BASE_API_URL + "/api";
          

             OssClient ossClient = new OssClient(new ApiTokenConfig
               {
                   ClientAppId = CLIENT_APP_ID,
                   ClientAppSecret = CLIENT_APP_SECRET,
                   BaseUrl = BASE_API_URL,
                   TokenType = ApiTokenType.OWNER
               },
              BASE_API_URL + "/api", false, null, new Dictionary<string, string>());

            List<InfoFirma> LstFirmantes = new List<InfoFirma>();

            LstFirmantes.Add(new InfoFirma { Nombre = "xx", Apellido = "xx", Correo = "[email protected]" });
            LstFirmantes.Add(new InfoFirma { Nombre = "xx", Apellido = "xx", Correo = "[email protected]" });

            PackageBuilder objPaquete = PackageBuilder.NewPackageNamed("Test desde Visual").DescribedAs("Descripcion del Paquete")
                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings());

            objPaquete.WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]").WithFirstName("xx").WithLastName("xx").WithCustomId("Signer1"));            
            objPaquete.WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]").WithFirstName("xx").WithLastName("xx").WithCustomId("Signer2"));

            DocumentBuilder objDocumento = DocumentBuilder.NewDocumentNamed("Tipo Documento Ejemplo Firma.");
            FileStream ArchivoStream = File.OpenRead("../Diploma.pdf");

            objDocumento.FromStream(ArchivoStream, DocumentType.PDF);
            objDocumento.WithSignature(SignatureBuilder.SignatureFor("[email protected]").OnPage(0).AtPosition(175, 165));
            objDocumento.WithSignature(SignatureBuilder.SignatureFor("[email protected]").OnPage(0).AtPosition(550, 165).Build());

            objPaquete.WithDocument(objDocumento.Build());
            
            PackageId idPaquete = ossClient.CreatePackageOneStep(objPaquete.Build());
            ossClient.SendPackage(idPaquete);
            Console.WriteLine($"Id de Paquete: "+idPaquete.Id);

 

Diego Fernando Velasquez


Reply to: No Role found for signer email

0 votes

Hi Diego,

 

Thanks for your post! From the code you shared, looks like there's a typo in the email (an additional 58 at the end) where you associates the signer to the signature "objDocumento.WithSignature(SignatureBuilder.SignatureFor("[email protected]")"

To avoid this kind of issues, you can also reference the signers by their custom ID, with code around below lines:
 

            objDocumento.FromStream(ArchivoStream, DocumentType.PDF);
            objDocumento.WithSignature(SignatureBuilder.SignatureFor(new Placeholder("Signer1")).OnPage(0).AtPosition(175, 165));
            objDocumento.WithSignature(SignatureBuilder.SignatureFor(new Placeholder("Signer2")).OnPage(0).AtPosition(550, 165).Build());

            objPaquete.WithDocument(objDocumento.Build());

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off