> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# RequestTemplate

Retrieves a specific template from the server. This method returns EnvelopeTemplate upon execution completion.

### Schema

![RequestTemplate](/_fern-files/_img/781f8b9a544a7829e97fbc97ad5331726c80c4b0801e62acdf337135032a5230.webp)

**`C#`**

```csharp title="C#"
// Request all the templates as shown in linked code
DocuSignWeb.EnvelopeTemplateDefinition[] response = <templates request>;

// Request information about each template definition
foreach (DocuSignWeb.EnvelopeTemplateDefinition def in response)
{
    Console.WriteLine("Retrieved template definition with ID {0}", def.TemplateID);

    // Request the template specified by the template ID
    DocuSignWeb.EnvelopeTemplate template = _apiClient.RequestTemplate(def.TemplateID,
        false);

    // Display information about the returned template
    Console.WriteLine("\tRetrieved template with name \"{0}\" and with {1} pages",
        template.EnvelopeTemplateDefinition.Name,
        template.EnvelopeTemplateDefinition.PageCount);
}
```

**`PHP`**

```php title="PHP"
// Request all the templates this account has on file 
$requestTemplatesparams = new RequestTemplates();
$requestTemplatesparams->AccountID = $AccountID;
$requestTemplatesparams->IncludeAdvancedTemplates = false;
$rtsResponses = $api->RequestTemplates($requestTemplatesparams)->RequestTemplatesResult->EnvelopeTemplateDefinition;

// Request info for each template and put into array of $responses
$requestTemplateparams = new RequestTemplate();
$requestTemplateparams->IncludeDocumentBytes = false;
$responses = array();
foreach ($rtsResponses as $envTemplateDef) {
    $requestTemplateparams->TemplateID = $envTemplateDef->TemplateID;
    $response = $api->RequestTemplate($requestTemplateparams);
    array_push($responses, $response);
}
```

| Name                 | Schema Type | Description                                                                              |
| -------------------- | ----------- | ---------------------------------------------------------------------------------------- |
| TemplateId           | DSXId       | Template ID to return.                                                                   |
| IncludeDocumentBytes | Boolean     | If true, include the document bytes of the template within the Envelope object returned. |

## EnvelopeTemplate

![EnvelopeTemplate](/_fern-files/_img/afceefe5a346dab19779d31cc5c16362692a251cfb4267becf148d4e1ad46639.webp)

| Name                       | Schema Type                | Description                                                                                            |
| -------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------ |
| EnvelopeTemplateDefinition | EnvelopeTemplateDefinition | Defines the attributes of a template. See the EnvelopeTemplateDefinition section for more information. |
| Envelope                   | Envelope                   | Template is contained within an Envelope object defined in the CreateEnvelope section.                 |

## MatchBox

![Matchbox](/_fern-files/_img/212e433b8c7de8a032051a77e9a779cd22017d3367f195c8b5ff91e70655abf2.webp)

| Name       | Schema Type | Description                  |
| ---------- | ----------- | ---------------------------- |
| PageNumber | Integer     | Page to put the matchbox on. |
| XPosition  | Integer     | X position of the matchbox.  |
| YPosition  | Integer     | Y position of the matchbox.  |
| Width      | Integer     | Width of the matchbox.       |
| Height     | Integer     | Height of the matchbox.      |

Matchboxes can be supplied with the document structure within the Envelope. They are used in the matching process when documents are uploaded for creating templates.

## EnvelopeTemplateDefinition

![EnvelopeTemplateDefinition](/_fern-files/_img/4a762d37b4eea94ec5f01089ab48b47476e8a714f9fbd5502952084c77264c6c.webp)

| Name                | Schema Type | Description                                                                                                                                 |
| ------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| TemplateID          | DSXId       | Unique identifier of the template.                                                                                                          |
| Name                | String      | Name of the template.                                                                                                                       |
| Shared              | Boolean     | If true, the template is shared with the Everyone group in the account. If false, the template is only shared with the Administrator group. |
| TemplatePassword    | String      | Password if the template is locked. Note: This will only be returned if the requesting user is the creator of the template.                 |
| TemplateDescription | String      | Description of the template.                                                                                                                |
| LastModified        | DateTime    | Last time the template was modified.                                                                                                        |
| PageCount           | Integer     | Number of pages in document of the template.                                                                                                |

## Rules and exceptions for RequestTemplate

* Account_Lacks_Permissions – account does not have permissions to use this API.
* User_Lacks_Permissions – user does not have permissions to use this API.
* Template_Unable_To_Load – template ID provided was invalid.