Home > Software design >  Integrating Docusign Identity Verification (Phone Authentication) with an envelope
Integrating Docusign Identity Verification (Phone Authentication) with an envelope

Time:01-18

I was using identity verification feature from Docusign with envelopes. Previously, envelopes are working fine without it. Then I enabled this feature and searched on the Docusign API Documentation, how to implement this feature. I got the necessary details like authentication token, workflow id. Try to hit the endpoint using Post request. Everything's fine but having issues in the body part of the post request getting invalid phone number response. Thank you for your time! Please help!

//Post request endpoint

https://demo.docusign.net/restapi/v2.1/accounts/f8594d59-9d52-xxxx-xxxx-xxxxxxxxxxxx/envelopes

//header

Authorization: Bearer {accestoken}
Content-Type: application/json
Acces: application/json

//request body

{
    "accountId": "f8594d59-9d52-xxxx-xxxx-xxxxxxxxxxxx",
    "templateId": "4e2ba389-5d26-xxxx-xxxx-xxxxxxxxxxxx",
    "emailSubject": "Please sign the contract",
    "templateRoles": [
        {
            "roleName": "Sender",
            "name": "Name",
            "email": "[email protected]",
            "identityVerification": {
                "workflowId": "c368e411-1592-xxxx-xxxx-xxxxxxxxxxxx",
                "steps": null,
                "inputOptions": [
                    {
                        "name": "phone_number_list",
                        "valueType": "PhoneNumberList",
                        "phoneNumberList": [
                            {
                                "countryCode": "1",
                                "number": "8956324511"
                            }
                        ]
                    }
                ]
            }
        },
        {
            "roleName": "Customer",
            "name": "cFName",
            "email": "[email protected]"
        }
    ],
    "status": "sent"
}

//Response

{
    "errorCode": "PHONE_NUMBER_INVALID",
    "message": "Phone number is not valid."
}

//Expected Response can vary

{
    "envelopeId": "e8342cd0-ea2b-xxxx-xxxx-xxxxxxxxxx",
    "uri": "/envelopes/e8342cd0-ea2b-xxxx-xxxx-xxxxxxxxxx",
    "statusDateTime": "2023-01-13T05:22:35.0100000Z",
    "status": "sent"
}

CodePudding user response:

According to https://www.areacodehelp.com/where/area_code_895.shtml area code 895 is not valid.

Try with a valid phone number to confirm the issue, but to me it looks like the number you used here is indeed not a valid phone number.

PS If you meant to use a number in Azerbaijan, you need to change the country code from "1" to "895" as it's a country code for a different country (the way you have is if for the USA)

CodePudding user response:

So, basically what I found is ID verification won't work with template roles because of the syntax compatibility. But it will work with composite templates, I made it work with composite template.

Additionally, both of the methods are compatible idVerification or phoneAuthentication. I am using idVerification for the first Signer and phone Authentication for the second signer

Docusign docs have more methods as well like sms auth, etc. Explore it from these links:

https://developers.docusign.com/docs/esign-rest-api/how-to/phone-auth/

https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/

Check examples, in my usecase I explored Generic JSON Request/Response

Thanks for all the support from Inbar and the community!

{
"accountId": "f8594d59-9d52-xxxx-xxxx-xxxxxxxxxx",
"emailSubject": "Please sign the contract",
"status": "sent",
"compositeTemplates": [
    {
        "compositeTemplateId": "1",
        "serverTemplates": [
            {
                "sequence": "1",
                "templateId": "4e2ba389-5d26-xxxx-xxxx-xxxxxxxxxx"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "recipients": {
                    "signers": [
                        {
                            "roleName": "Sender",
                            "recipientId": "1",
                            "name": "Name",
                            "email": "[email protected]",
                            "identityVerification": {
                                "workflowId": "c368e411-1592-xxxx-xxxx-xxxxxxxxxx",
                                "steps": null,
                                "inputOptions": [
                                    {
                                        "name": "phone_number_list",
                                        "valueType": "PhoneNumberList",
                                        "phoneNumberList": [
                                            {
                                                "countryCode": "1",
                                                "number": "1234567890"
                                            }
                                        ]
                                    }
                                ]
                            }
                        },
                        {
                            "roleName": "Customer",
                            "recipientId": "2",
                            "name": "cName",
                            "email": "[email protected]",
                            "phoneAuthentication": {
                                "senderProvidedNumbers": [
                                    " 11234567890"
                                ],
                                "recipMayProvideNumber": false
                            },
                            "idCheckConfigurationName": "Phone Auth $"
                        }
                    ]
                }
            }
        ]
    }
]

}

Note: Use valid phone number!

  • Related