I'm working with the Request Signature from Document in the DocuSign API Walkthrough. What I'd like to do is define a template with specific fields then apply that template to the Document that I'm sending via this request. The problem I have is that when I add the template details to the code it gives an error that the envelope is not complete.
This is the page I'm using as reference: http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromDocument
I have a Template defined with a field such as [[canidate_signature]] as an anchor. In the UI, I can upload a document using that anchor and assign the template I've defined which works great. But, I can't get the API to do the same thing.
This is my JSON build code in PHP, which works without the compositeTemplate section but as soon as I add that I get an error.
The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line.
$data = array (
"emailSubject" => "DocuSign API - Signature Request on Document"
,"compositeTemplates" => array(
array(
"serverTemplates" =>
array(
array(
"sequence" => 1,
"templateId" => "B1E2A5C9-9818-4BF0-AD9F-F4B1A3E2D39D"
)
)
)
)
,"documents" => array(
array(
"documentId" => "1"
,"name" => $documentName
)
,array(
"documentId" => "2"
,"name" => $documentName
)
)
,"recipients" => array(
"signers" => array(
array(
"email" => $email,
"name" => $recipientName,
"recipientId" => "1"
)
,array(
"email" => "***@gmail.com",
"name" => "Scott Gmail",
"recipientId" => "2"
)
)
)
,"status" => "sent"
);