Reputation: 51
Am new to docusign and trying to use the embeding feature. Here's the steps I followed:
integratorKey,username,password,recipientName,recipientEmail,templateId,roleName
Step 3: Generating URL token for embedded signing... API call failed, status returned was: 400 Error description:
<?xml version="1.0" encoding="UTF-8"?>
<errorDetails xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<errorCode>UNKNOWN_ENVELOPE_RECIPIENT</errorCode>
<message>The recipient you have identified is not a valid recipient of the specified envelope.</message>
</errorDetails>
Upvotes: 3
Views: 3483
Reputation: 51
Fixed it! There was an issue in the code given in that site. In step 2 it was given:
body = "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<accountId>" + accountId + "</accountId>" +
"<status>sent</status>" +
"<emailSubject>DocuSign API Call - Signature request from template</emailSubject>" +
"<templateId>" + templateId + "</templateId>" +
"<templateRoles>" +
"<templateRole>" +
"<email>" + username + "</email>" +
"<name>" + recipientName + "</name>" +
"<roleName>" + roleName + "</roleName>" +
"<clientUserId>1001</clientUserId>" + // required for embedded sending (value is user-defined)
"</templateRole>" +
"</templateRoles>" +
"</envelopeDefinition>";
"<email>" + username + "</email>"
is wrong.
"<email>" + recipientEmail + "</email>"
should be used instead.
Upvotes: 2