0
votes

I'm interested in getting roles from templates to populate them correctly and keep that up to date automatically.

Is it somehow possible to get that using REST API?

There's the "Get Account Template by ID - v2/accounts/:accountId/templates/:templateId" request but it seems to return little useful info regarding roles or recipients.

1

1 Answers

2
votes

Using the REST API, you can get recipient Role Names for a Template by simply executing a "GET Envelope Recipients" request, where you specify the Template Id in place of the Envelope Id. For example:

GET https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes/{templateId}/recipients?include_tabs=false&include_extended=true

The response to this request will contain an array of recipient objects for each recipient type (i.e.: signers, agents, editors, intermediaries, carbonCopies, certifiedDeliveries, inPersonSigners); each recipient object will contain the property roleName. Here's an example response for a template that contains 3 recipients -- 2 signers and one CC recipient:

{
    "signers": [
        {
            "signInEachLocation": "false",
            "name": "",
            "email": "",
            "recipientId": "5741ec70-b056-44eb-b462-eceee88ddf77",
            "requireSignerCertificate": "false",
            "requireIdLookup": "false",
            "routingOrder": "1",
            "roleName": "Signer 1",
            "status": "created",
            "templateLocked": "false",
            "templateRequired": "false"
        },
        {
            "signInEachLocation": "false",
            "name": "",
            "email": "",
            "recipientId": "c64d4567-2efd-422d-9b0a-a5427aa2512d",
            "requireSignerCertificate": "false",
            "requireIdLookup": "false",
            "routingOrder": "2",
            "roleName": "Signer 2",
            "status": "created",
            "templateLocked": "false",
            "templateRequired": "false"
        }
    ],
    "agents": [],
    "editors": [],
    "intermediaries": [],
    "carbonCopies": [
        {
            "name": "Legal Team",
            "email": "[email protected]",
            "recipientId": "a63e3714-adc2-4e05-b2c5-b3c3bbf50aa2",
            "requireIdLookup": "false",
            "routingOrder": "3",
            "roleName": "Legal Team",
            "status": "created",
            "templateLocked": "true",
            "templateRequired": "true"
        }
    ],
    "certifiedDeliveries": [],
    "inPersonSigners": [],
    "recipientCount": "3"
}