Out of many envelopes created, we have one where we cannot create the recipient view URL for embedded signing. In the sample test below, one of the two envelope IDs fail with
DocuSign.eSign.Client.ApiException : Error calling CreateRecipientView: {
"errorCode": "UNKNOWN_ENVELOPE_RECIPIENT",
"message": "The recipient you have identified is not a valid recipient of the specified
envelope."
}
while the other envevlope ID passes. Note we create the envelope with the ClientUserId and the Email set to the same value. We use the technique of setting the UserName to the values specified with GetRecipientsList (and always have), but yet it still fails, so this appears different from similar issues already answered.
[Theory]
[InlineData("redacted")]
[InlineData("redacted")]
public async Task ShouldCreateRecipientView(string envelopeId)
{
var accountId = await new DocuSignCredentials().GetDocuSignAccountIdAsync();
var envelopesApi = new EnvelopesApi();
var recipientList = await envelopesApi.ListRecipientsAsync(accountId, envelopeId);
Assert.Single(recipientList.Signers);
var signer = recipientList.Signers.First();
var viewOptions = new RecipientViewRequest()
{
ReturnUrl = "http://localhost/return",
ClientUserId = signer.Email,
AuthenticationMethod = "password",
UserName = signer.Name,
Email = signer.Email,
};
var viewUrl = await envelopesApi.CreateRecipientViewAsync(accountId, envelopeId, viewOptions);
}
Edit: if we set the viewOptions like the following, it still fails the same way. The control envelope ID continues to pass.
var viewOptions = new RecipientViewRequest()
{
ReturnUrl = "http://localhost/return",
AuthenticationMethod = "password",
ClientUserId = signer.ClientUserId,
Email = signer.Email,
UserId = signer.UserId,
RecipientId = signer.RecipientId
};