Adds templates to the specified envelope.

Request

HTTP request

POST /v2/accounts/{accountId}/envelopes/{envelopeId}/templates

Parameters

Parameter name Value Description
Path parameters
accountId string

The external account number (int) or account ID Guid.

envelopeId string

The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec

Request Body

Responses

Code Description Reference
201 Created Successful response.
400 Bad Request Error encountered.

SDK Method

Envelopes::applyTemplate

Definitions Expand All | Collapse All

documentTemplate

documentEndPage string
documentId string

Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute.

documentStartPage string
errorDetails errorDetails
templateId string

The unique identifier of the template. If this is not provided, DocuSign will generate a value.

documentTemplateList

documentTemplates
[documentTemplate]

errorDetails

This object describes errors that occur. It is only valid for responses, and ignored in requests.

errorCode string

An error code associated with the error.

message string

A short error message.

Examples

Generic JSON Request/Response

Request

{
"documentTemplates": [
{
"documentId": "sample string 1",
"templateId": "sample string 2",
"documentStartPage": "sample string 3",
"documentEndPage": "sample string 4"
}
]
}

Response

{
"documentTemplates": [
{
"documentId": "sample string 1",
"templateId": "sample string 2",
"documentStartPage": "sample string 3",
"documentEndPage": "sample string 4",
"errorDetails": {
"errorCode": "sample string 1",
"message": "sample string 2"
}
}
]
}

Generic XML Request/Response

Request

<documentTemplates 
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.docusign.com/restapi">

<documentTemplates>
<documentTemplate>
<documentEndPage>sample string 4</documentEndPage>
<documentId>sample string 1</documentId>
<documentStartPage>sample string 3</documentStartPage>
<templateId>sample string 2</templateId>
</documentTemplate>
</documentTemplates>
</documentTemplates>

Response

<documentTemplates 
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.docusign.com/restapi">

<documentTemplates>
<documentTemplate>
<documentEndPage>sample string 4</documentEndPage>
<documentId>sample string 1</documentId>
<documentStartPage>sample string 3</documentStartPage>
<errorDetails>
<errorCode>sample string 1</errorCode>
<message>sample string 2</message>
</errorDetails>
<templateId>sample string 2</templateId>
</documentTemplate>
</documentTemplates>
</documentTemplates>