-->

How to add sms Authentication to template roles?

2019-07-08 09:48发布

问题:

Using the DocuSign Rest API I'm creating an envelope from a template that has one recipient role that has to sign. On the template creation for that recipient role I have enabled Identity Check -> SMS Auth $. It works fine when I try to sent the envelope from DocuSign portal. However when I try to sent it using the API call I get an error saying: RECIPIENT_SMS_AUTH_PHONE_MISSING: SMS authentication phone number cannot be empty. The request body has included inside template roles:

"SmsAuthentication":{
"senderProvidedNumbers":["recipient_number"] },
"IdCheckConfigurationName":"SMS Auth $",
"RequireIdLookup":true

Is there any reason why this won't work when making the API call?

回答1:

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.

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.


Update

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)



标签: docusignapi