user3167138
user3167138

Reputation: 33

Reading templates from a folder via DocuSign API REST V2

I need to read templates from my dev account - I'm using the /templates REST API V2 (page 192 in the API guide - http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf)

sending folder as "Admissions", includeSubFolders as true (Yes, I have a subfolder called Admissions and there is a template in there)

the error I'm getting back from the API is: errorCode:INVALID_REQUEST_PARAMETER message:The request contained at least one invalid parameter. Template definition must include an 'envelopeTemplateDefinition' section.

The API specs for parms are only folder and includeSubFolders... says nothing about envelopeTemplateDefinition - I'm only trying to read a list of templates so I can retrieve said Template information

has anybody else had this issue ? - what's the fix ?

Upvotes: 1

Views: 248

Answers (1)

Kim Brandl
Kim Brandl

Reputation: 13480

Make sure that your Request is using the verb GET. For example, if the folder structure within my DocuSign account looks like this:

DocuSign UI - Template Folder Structure

Then the request to get all templates within the TF Templates folder would be:

GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/templates?Folder=TF%20Templates&includeSubFolders=true

Based on the error you're getting, I'd suspect that you're (incorrectly) using the verb POST instead of using the verb GET. POST is used when you want to Create a new template (in which case envelopeTemplateDefinition is required).

Upvotes: 1

Related Questions