How to create a template using the DocuSign API call in c#, xml -
Need help on how to create a template using
Docusin API, C #, XML
An error message - '(404) Bad request'
url = {......} / template
string requestBody = "& lt; envelopeDefinition xmlns = \ "Http: //www.docusign.com/restapi \" & gt; "+" & lt; email subject & gt; please sign this document & lt; / emailSubject & gt; " + "& Lt; status & gt; sent & lt; / status & gt;" + // Add document "" & lt; Document & gt; "+" & Lt; Document & gt; "+" & lt; Document ID & gt; 1 & lt; / DocumentId> "+" & lt; Name & gt; Document pdf & lt; / Name & gt; "+" & lt; / Document & gt; "+" & lt; / Document & gt; "+ // Recipient (s)" Recipient> "+" & lt; Signers & gt; "+" & lt; Signer & gt; "+" & lt; Recipient ID & gt; 1 & lt; / RecipientId> "+" & lt; Email & gt; Ssmith@hotmail.com< / Email & gt; "+" & lt; Name & gt; Mon Smith & lt; / Name & gt; "+" & lt; Role Name & gt; Signer & lt; / RoleName & gt; "+" & lt; Tabs & gt; "+" & lt; Sign HeatTab & gt; "+" & lt; Sign Green & gt; "+" & lt; XPosition & gt; 70 & lt; / Xposition & gt; "+" & lt; Yposition & gt; 560 & lt; / Yposition & gt; "+" & lt; Document ID & gt; 1 & lt; / DocumentId> "+" & lt; Page number & gt; 2 & lt; / PageNumber & gt; "+" & lt; / SignHere> "+" & lt; / SignHereTabs> "+" & lt; / Tab & gt; "+" & lt; / Signer & gt; "+" & lt; / Signers & gt; "+" & lt; / Recipient> "+" & lt; EnvelopeTemplateDefinition & gt; "+" & lt; Name & gt; Test template & lt; / Name & gt; "+" & lt; Owner & gt; "+" & lt; Email & gt; Ssmith@hotmail.com< / Email & gt; "+" & lt; / Owner & gt; "+" & lt; / EnvelopeTemplateDefinition & gt; "+" & lt; / EnvelopeDefinition & gt; "; I get a response error message
& lt; errorDetails xmlns =" http: //www.docusign. Com / restapi "xmlns: i =" http://www.w3.org/2001/XMLSchema-instance "> error code> UNSPECIFIED_ERROR XML; Document (1, 2) has an error. & Lt; / Message & gt; & lt; / errorDetails & gt; Highly appreciated
The request body you are using is for sending a signature request from an existing template, a new template in your account. Not to create a template. To create a new template through the API, you need a separate request body. You can use the auto generated other API help page:
Scroll down to find a template and find POST and you can see a sample request. The sample is too big because it contains all the possible things that go into that body Can but You will know how to prepare your JSON (or XML)
See also the related documentation for API calls to create a template:
Comments
Post a Comment