简体   繁体   English

将 Docusign 身份验证(电话身份验证)与信封集成

[英]Integrating Docusign Identity Verification (Phone Authentication) with an envelope

I was using identity verification feature from Docusign with envelopes.我正在使用带有信封的 Docusign 的身份验证功能。 Previously, envelopes are working fine without it.以前,信封在没有它的情况下也能正常工作。 Then I enabled this feature and searched on the Docusign API Documentation, how to implement this feature.然后我启用了这个功能并在 Docusign API Documentation 上搜索,如何实现这个功能。 I got the necessary details like authentication token, workflow id.我获得了必要的详细信息,例如身份验证令牌、工作流程 ID。 Try to hit the endpoint using Post request.尝试使用 Post 请求访问端点。 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": "fName.lName@xyz.com",
            "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": "cFName.cLName@gmail.com"
        }
    ],
    "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"
}

According to https://www.areacodehelp.com/where/area_code_895.shtml area code 895 is not valid.根据https://www.areacodehelp.com/where/area_code_895.shtml区号 895 无效。

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) PS 如果你打算在阿塞拜疆使用一个号码,你需要将国家代码从“1”更改为“895”,因为它是另一个国家的国家代码(你的方式是美国)

So, basically what I found is ID verification won't work with template roles because of the syntax compatibility.所以,基本上我发现的是,由于语法兼容性,ID 验证不适用于模板角色。 But it will work with composite templates, I made it work with composite template.但它可以与复合模板一起使用,我让它与复合模板一起使用。

Additionally, both of the methods are compatible idVerification or phoneAuthentication.此外,这两种方法都兼容 idVerification 或 phoneAuthentication。 I am using idVerification for the first Signer and phone Authentication for the second signer我对第一个签名者使用 idVerification,对第二个签名者使用电话身份验证

Docusign docs have more methods as well like sms auth, etc. Explore it from these links: Docusign 文档有更多方法以及短信验证等。从这些链接探索它:

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

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

Check examples, in my usecase I explored Generic JSON Request/Response检查示例,在我的用例中,我探索了通用 JSON 请求/响应

Thanks for all the support from Inbar and the community!感谢 Inbar 和社区的所有支持!

{
"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": "fName.lName@xyz.com",
                            "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": "cfName.clName@gmail.com",
                            "phoneAuthentication": {
                                "senderProvidedNumbers": [
                                    "+11234567890"
                                ],
                                "recipMayProvideNumber": false
                            },
                            "idCheckConfigurationName": "Phone Auth $"
                        }
                    ]
                }
            }
        ]
    }
]

} }

Note: Use valid phone number!注意:请使用有效的电话号码!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM