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 ?
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:
I changed my endpoint to:
AND it works just fine.
Read this in the API documentation here for more information:
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.