I have a question on the embedded signing process. As per the API we have to pass the templateId and templateRole which already created earlier.
Can we create the template programmatically using Docusign API ?
-- Thanks and Regards
Sandeep
Yes you can create a template programmatically (see the REST API documentation for more info) however I want to make clear that you do not need to use a template for Embedded Signing. If you are looking at the Embedded Signing code samples in the DocuSign API Walkthroughs those use a template just to shorten the code and request body, but as mentioned it's not required.
To make any recipient an Embedded recipient (meaning they will sign using embedded signing), you simply have to set an additional property on the recipient named clientUserId. The trick is that whatever value you use for a given recipient, you have to reference that same value when requesting the signing URL.
For instance, your (partial) request body for an embedded recipient might look like this:
"recipients": {
"signers": [
{
"tabs": {
"signHereTabs": [
{
"name": "SignatureTab1",
"pageNumber": "1",
"documentId": "1",
"yPosition": "100",
"xPosition": "100"
}
]
},
"routingOrder": "1",
"recipientId": "1",
"clientUserId": "1000",
"name": "Sally Doe",
"email": "[email protected]"
}
]
}
Notice the clientUserId property that I've randomly set to 1000.
Now if you want to do embedded signing without a template, you can combine some of the above sample JSON with the multipart/form-data API call for creating an envelope from a local document.
This API Walkthrough shows you exactly how to do that:
http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromDocument