且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何向模板角色添加短信身份验证?

更新时间:2021-09-02 03:11:26

由于某些原因,我只能通过使用 compositeTemplates 请求属性来使它起作用(即,我无法仅使用简单的模板就可以使它起作用)。请注意,您需要在用于测试的帐户中启用SMS身份验证,如果要使用开发人员沙箱帐户进行测试,则应启用该功能;如果您正在生产中,则可以与客户经理联系。

For some reason I can only get this to work by using the compositeTemplates request property (i.e. I'm unable to get it to work with just a simple Template). Note that you need to have SMS authentication enabled in the account you are testing with, if you're testing with a developer sandbox account it should be enabled, if you're in production you can reach out to your account manager.

要使其正常工作,我使用了以下使用复合模板的JSON:

To get this to work I used the following JSON that uses a composite template:

{
    "status": "sent",
    "emailSubject": "Please sign this for me",
    "compositeTemplates": [{
        "serverTemplates": [{
            "sequence": "1",
            "templateId": "[TEMPLATE_ID]"
        }],
        "inlineTemplates": [{
            "sequence": "1",
            "recipients": {
                "signers": [{
                    "name": "[SIGNER_NAME]",                
                    "email": "[SIGNER_EMAIL]",              
                    "routingOrder": "1",
                    "requireIdLookup": true,
                    "recipientId": "1",
                    "idCheckConfigurationName": "SMS Auth $",
                    "smsAuthentication": {
                        "senderProvidedNumbers": [
                            "1234567890"
                        ]
                    }
                }]
            }
        }]
    }]
}

我仅使用美国号码进行了测试,因此不确定国际号码格式,但是我所包含的上述格式适用于以区号开头的美国号码。

I only tested with a U.S. number so not sure about the international number formats, but the above format I've included works for U.S. numbers starting with the area code.

更新

到将其与国际号码配合使用,将 roleName 属性添加到签署者对象,并添加您的国家代码(在这种情况下,巴西为 +55)

To get this to work with international numbers add the roleName property to the signers object and also add your country code (ie "+55" in this case for Brazil)