-->

receiving “invalid email address for recipient” wh

2019-09-04 04:06发布

问题:

I have an envelope created successfully with the following XML:

<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<status>created</status>
<emailSubject>DocuSign Notification</emailSubject>
<templateId>826882b3-63fd-4e3a-95c6-e9d901824xxx</templateId>
<templateRoles>
<templateRole>
<email>xxxxxxx@aol.com</email>
<name>Ed Test</name>
<roleName>Signer</roleName>
<routingOrder>1</routingOrder>
<clientUserId>25</clientUserId>
<tabs>...LEFT OUT FOR BREVITY...</tabs>
</templateRole></templateRoles></envelopeDefinition>

When I attempt to send the envelope with:

public string SendEnvelope(string envelopeID)
{
    string url = baseURL + "/envelopes/" + envelopeID;
    string requestBody =
"<envelope>" +
"<status>sent</status>" +
"</envelope>";
    HttpWebRequest request = initializeRequest(url, "PUT", requestBody, email, password);
    string response = getResponseBody(request);
    return response;
}

I receive:

<errorDetails xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><errorCode>INVALID_EMAIL_ADDRESS_FOR_RECIPIENT</errorCode><message>The email address for the recipient is invalid. The recipient Id follows.</message></errorDetails>

There is nothing wrong with the email address. If I create the envelope with status of "sent" instead of "created" it works fine. I only get this error if attempting to change the envelope status. Does anyone know why this occurs and how to work around it ?

回答1:

Ergin is correct. If I change my process to add a few steps to retrieve the signers GUID that DocuSign creates, then it works. It still seems like a bug, or at least an inconsistency, that the API handles it differently when created as "sent" versus created as "created" and immediately changed to "sent", but it at least has a workaround. See my answer on this related post for my current, working process.



回答2:

I had the same issue and found a solution by changing my endpoint URL.

My requirement is to create a draft envelope and change the status to 'sent' at a later time. There were some optional signers that whenever missing, obviously, I was getting this error:

INVALID_EMAIL_ADDRESS_FOR_RECIPIENT
The email address for the recipient is invalid. The recipient Id follows.

I changed my endpoint to:

POST https://demo.docusign.net/restapi/v2/accounts/{{account}}/envelopes?merge_roles_on_draft=true

AND it works just fine.

Read this in the API documentation here for more information:



标签: docusignapi