No Role found for signer email
Wednesday, September 8, 2021 at 03:48pmHi, 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);
Reply to: No Role found for signer email
Wednesday, September 8, 2021 at 05:36pmHi 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