Skip to main content
Blog
Home/

Using Identity Verification with templates, continued

Author Ahmed Shorim
Ahmed ShorimSr. Developer Support Advisory Engineer
Summary3 min read

See how to add identity verification to an envelope through composite templates using the eSignature REST API.

Table of contents

In a previous blog post, my colleague Jonathan Sammons outlined how to add Identity Verification to a draft envelope that is based on a template. This post will look into achieving the same result, but through composite templates.

Step 1: Activate Identity Verification for your account

Before you can add Identity Verification to your envelopes, you must have the feature enabled in your Docusign developer account. If it’s not already activated, please reach out to the Docusign support team through Docusign Support and request activation. You’ll also need to request activation for your production account before you can use Identity Verification there.

Step 2: Get available workflows

Obtain identity workflows available on your account (using the IdentityVerification:list API) and extract the workflowId associated with the one that you’d like to use.

Request:

GET https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/identify_verification
Headers: 
Authorization: Bearer {code}

Response:

{
    "identityVerification": [
        {
            "workflowId": "{workflowID}",
            "workflowLabel": null,
            "defaultName": "Docusign ID Verification",
            "defaultDescription": "The signer will need to identify themselves with a valid government ID.",
            "workflowResourceKey": "ds_identify_default",
            "steps": [
                {
                    "name": "identify",
                    "type": "EnvelopeAccess"
                }
            ],
            "signatureProvider": null,
            "inputOptions": []
        },
        {
            "workflowId": "{workflowID}",
            "workflowLabel": "Phone Auth",
            "defaultName": "Phone Authentication",
            "defaultDescription": "Recipient will need to authenticate with their phone number via SMS or a phone call",
            "workflowResourceKey": "",
            "steps": [
                {
                    "type": "EnvelopeAccess"
                }
            ],
            "signatureProvider": null,
            "inputOptions": [
                {
                    "optionName": "phone_number_list",
                    "isRequired": true,
                    "valueType": "PhoneNumberList"
                }
            ]
        }
    ]
}

Step 3: Add identity verification and composite template to your envelope

Create the envelope (using the Envelopes:create API) through a composite template and add the identity verification as shown in the code below. For this example, I will be using the Phone Authentication workflow retrieved from the previous step.

Request:

POST https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/envelopes
Headers: 
Authorization: Bearer {code}

JSON Payload:

{
    "compositeTemplates": [
        {
            "serverTemplates": [
                {
                    "sequence": "1",
                    "templateId": "{templateId}"
                }
            ],
            "inlineTemplates": [
                {
                    "recipients": {
                        "signers": [
                            {
                                "email": "{recipientEmail}",
                                "name": "{recipientName}",
                                "roleName": "{templateRoleName}",
                                "recipientId": "1",
                                "identityVerification": {
                                    "workflowId": "{workflowId}",
                                    "steps": null,
                                    "inputOptions": [
                                        {
                                            "name": "phone_number_list",
                                            "valueType": "PhoneNumberList",
                                            "phoneNumberList": [
                                                {
                                                    "countryCode": "{recipientCountryCode}",
                                                    "number": "{recipientPhoneNumber}"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "sequence": "2"
                }
            ]
        }
    ],
    "status": "sent"
}

Response:

{
    "envelopeId": "cde1c205-xxxx-xxxx-xxxx-b6388f799b28",
    "uri": "/envelopes/cde1c205-xxxx-xxxx-xxxx-b6388f799b28",
    "statusDateTime": "2023-09-15T12:17:27.0270000Z",
    "status": "sent"
}

Additional resources

Author Ahmed Shorim
Ahmed ShorimSr. Developer Support Advisory Engineer

Ahmed Shorim has been with Docusign since 2021 as a Senior Developer Support Advisory Engineer. His work is focused on advising developers on how to integrate with Docusign APIs and SDKs by consulting on best practices and providing code examples. Experienced in developing web, mobile, and desktop applications along with building automation flows, he can be reached at LinkedIn.

More posts from this author

Related posts

  • Docusign for Developers Public Roadmap: A commitment to innovation and trust
    Developers

    Docusign for Developers Public Roadmap: A commitment to innovation and trust

    Author Julian Macagno
    Julian Macagno
  • LaborEdge Streamlines Healthcare Compliance with a Healthy Dose of Docusign

    LaborEdge Streamlines Healthcare Compliance with a Healthy Dose of Docusign

    Author Karissa Jacobsen
    Karissa Jacobsen
  • Ontology vs Taxonomy vs Data Model

    Ontology vs Taxonomy vs Data Model

    Author Dan Selman
    Dan Selman
Docusign for Developers Public Roadmap: A commitment to innovation and trust

Docusign for Developers Public Roadmap: A commitment to innovation and trust

Author Julian Macagno
Julian Macagno
LaborEdge Streamlines Healthcare Compliance with a Healthy Dose of Docusign

LaborEdge Streamlines Healthcare Compliance with a Healthy Dose of Docusign

Author Karissa Jacobsen
Karissa Jacobsen
Ontology vs Taxonomy vs Data Model

Ontology vs Taxonomy vs Data Model

Author Dan Selman
Dan Selman

Discover what's new with Docusign IAM or start with eSignature for free

Explore Docusign IAMTry eSignature for Free
Person smiling while presenting