How to add sms Authentication to template roles? - docusignapi

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?

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)

for country code, please set as form below, +84 is VN, leave one space between phone number and country code, it take me a lot of time :(
"senderProvidedNumbers": ["+84 945672509"]

Related

POSTMan sample - creating envelope from a template is not populating the user tags

I created a DocuSign template that contains two roles: Provider and Recipient. I did this via the DocuSign Sandbox UI.
In my template, I have one document, with four tabs on it:
1. ProviderName
2. ProviderAddress1
3. RecipientName
4. RecipientAddress
Should I be using CustomFields vs. Tabs?
What's the API call(s) that I should be making to do the following, given a template with a document in it:
create an envelope for specific users
update the text within the document in the template for the specific users
send it out?
In the POSTMan sample, I tried using this URL, doing a POST:
{{baseUrl}}/envelopes
passing in a templateId, and the following JSON below in the POST body:
JSON:
{
"templateRoles": [{
"email": "{{signer1Email}}",
"name": "The Provider",
"roleName": "Provider",
"tabs": {
"textTabs": [{
"tabLabel": "ProviderName",
"value": "This is the provider!"
},
{
"tabLabel": "ProviderAddress1",
"value": "10 Provider Street, Baltimore, MD 21212"
}]
}
},
{
"email": "{{otherEmail}}",
"name": "Test Recipient",
"roleName": "Recipient",
"tabs": {
"textTabs": [{
"tabLabel": "RecipientName",
"value": "This is the recipient!"
},
{
"tabLabel": "RecipientAddress",
"value": "10 Main Street, Baltimore, MD 21212"
}]
}
}],
"emailSubject": "DocuSign API - Signature Request on Document Call",
"templateId": "<<template ID>>",
"status": "sent"
}
This does return an Envelope Id in the response, and I do receive the email with the DocuSign document to sign.
However, the tabs are NOT populated, they're blank.
Are the roles in the Template empty placeholders? If a name/email is defined on the template, the API call won't populate them as you might expect.
Try to add the documentId and pageNumber properties to your tabs. Also, ensure the label matches what is in the original template.
Lastly, you may need to add recipientId as well to each of the recipients to match what is in the template (this one may not be required since you have the roleName but just in case)

DocuSign - Document Download

I'm trying to use DocuSign via Rest API and ran into a question. After a user signed document and is redirected to the URL that is specified on RecipientView (/accounts/{accountId}/envelopes/{envelopeId}/views/recipient), Considering both best and worst case scenarios, how long should we wait before we download the signed document?
I'm asking this question because we saw some issues with SigniX in the past where, after SigniX returning the control to redirectUrl, the signed document was not available to download. Even though this happened very little number of times which might be <1% of all requests, Every single document is $$ and cannot afford to lose it.
If answer to my question is Yes, Please provide a C# example on using webhook.
Thanks.
You can setup DocuSign WebHook aka Connect notifications at your account level or envelope level and automatically receive the Documents when an envelope is completed.
Here is a sample CreateEnvelope request to setup configuration for the connect notifications per envelope level. Look at eventNotification property. All you have to do is host a listener to which DocuSign can send messages.
{
"emailSubject": "Testing connect notification",
"status": "sent",
"eventNotification": {
"url": "<Add your listener URL here>",
"loggingEnabled": "true",
"requireAcknowledgment": "true",
"envelopeEvents": [
{
"envelopeEventStatusCode": "Completed"
}
],
"includeDocuments": "true"
},
"recipients": {
"signers": [
{
"name": "john smith",
"email": "johnsmith#acme.com",
"recipientId": "1",
"routingOrder": "1"
}
]
},
"documents": [
{
"documentId": "1",
"name": "Contract",
"fileExtension": "contract",
"documentBase64": "DQoNCg0KDQogICAgICAgICBEdW1teSBDb250cmFjdA=="
}
]
}
Here are some useful links which help you to setup your connect listener
WebHook c# recipe
More Api Recipes
Blog Posts
Webhooks: Don’t Poll Us, We’ll Call You!
Adding Connect Webhooks to your Application
Securing Your Connect Webhook Listener

implement multifactor authentication in docusign

I am looking for solutions for the following questions in docusign node sdk.
1.how do we implement the multifactor authentication using docusgin node sdk.
2.how to display user information in template using embedded signing.
DocuSign currently offers up to nine (9) different forms of recipient authentication, you can read the docs and the website to see the full list. Two of the more popular recipient authentication flows when using the API are Access Code and SMS. In both methods a unique code is used to access the envelope.
With Access Code it's up to the sender how to deliver a sender-defined code to the recipient (i.e. they can call and give it to them, email it, or send through some other means). SMS Auth is the same concept except the DocuSign platform generates a unique code instead of it being sender-defined, and the code is sent through SMS to their mobile phone.
To add Access Code authentication for a recipient:
{
"status": "sent",
"emailSubject": "Envelope with Access Code Auth",
"documents": [{
"documentId": "1",
"name": "contract.pdf",
"documentBase64": "base64 document bytes...",
}],
"recipients": {
"signers": [{
"email": "john#email.com",
"name": "John Doe",
"accessCode": "99999",
"recipientId": "1",
"clientUserId": "100"
}]
}
}
The maximum length for an access code is 50 characters. Note that the above recipient would be set to sign in embedded fashion since their clientUserId is set.
To add SMS you need to use the composite templates feature (note that you do not need to include an actual template if you do not want to, just remove the serverTemplates node in that case):
{
"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"
]
}
}]
}
}]
}]
}
Replace "1234567890" with the recipient's mobile phone number. Note that the idCheckConfigurationName property must be set to "SMS Auth $".
When you say multi-factor authentication are you referring to "Access Code", "Phone", "SMS", or "Knowledge Based" authentication? If so take a look at EnvelopeRecipients Create in the API documentation, specifically the signer definition. The attributes I would look at are "requireIdLookup", "accessCode", "idCheckConfigurationName", "idCheckInformationInput", "phoneAuthentication", "smsAuthentication", & "socialAuthentications".
Another way to achieve this would be to use SSO and have your Identity Provider require multi-factor authentication.

Deliverymethod fax in docusign create and send API - demo environment

Hi Trying to use the DocuSign createsendEnvelope API for a recipient with delivery method FAX and fax number. However in the demo environment the API needs a recipients email and always send out the email. The document is not faxed to the number provided. Can any one confirm if the demo environment is disabled for faxing options?
Thanks in Advance!
The release notes for the "Fax Out" feature in the DocuSign SOAP API describe how to send via fax with the SOAP API (http://www.docusign.com/sites/default/files/DocuSignReleaseNotes-Jun-1-2012-Final.pdf). I tried to apply the same rational to send an envelope via fax with the REST API -- here's my "Create Envelope" request:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"emailSubject": "Please sign this",
"emailBlurb": "Please sign...thanks!",
"status": "sent",
"enableWetSign": "true",
"recipients": {
"signers": [
{
"name": "John Doe",
"email": "johnsemail#outlook.com",
"faxNumber": "2069347947",
"recipientId": "1",
"routingOrder": "1",
"deliveryMethod": "Fax",
}]
},
"documents": [
{
"name": "TestFile.pdf",
"documentId": "1",
"fileExtension": "pdf",
"documentBase64" : "DOCUMENT_BYTES"
}
]
}
Unfortunately, I receive the following error in response to the request (even though the fax number I specified is a valid fax number):
{
"errorCode": "INVALID_FAXNUMBER",
"message": "Fax Number is invalid."
}
To troubleshoot further, I tried a little reverse-engineering in an attempt to determine what properties DocuSign expects you to set for a Fax recipient.
First, using the DocuSign web console, I created/sent a new Envelope with a single recipient where the delivery method = fax. Here's a screenshot of the Status pane from the DocuSign web console for this envlope (immediately after I sent it):
Next, I used the REST API to execute a "Get Recipients" request (GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envId}}/recipients) -- with the goal of examining the recipient object in the response to determine which properties need to be set for a Fax recipient. Here's the response I received:
{
"signers": [
{
"signInEachLocation": "false",
"name": "John Doe",
"email": "johnsemail#outlook.com",
"recipientId": "1",
"recipientIdGuid": "977e571d-6613-492c-8a75-9c207d46c03c",
"requireIdLookup": "false",
"userId": "03c8a856-c0ae-41bf-943d-ac6e92db66a8",
"routingOrder": "1",
"status": "sent"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "1",
"currentRoutingOrder": "1"
}
Interestingly, the API response contains no mention of "deliveryMethod", and no mention of the fax number that was specified for the recipient. This would lead me to believe that perhaps the "fax" delivery method isn't fully supported via the REST API at this time. (If it is supported, then perhaps someone with DocuSign can chime in here and explain how to send via fax (with the API).)
In the meantime, if using the DocuSign SOAP API is an option for you, you might try that route, as it appears that the "Fax Out" feature was initially designed for and implemented in the SOAP API (so I'd expect it to work there, although I haven't personally tested it).

How do I docuSign multiple documents in an envelope once using docuSign Rest API?

I am creating composite templates that work correctly and I'm running into this issue.
I am adding 2 templates to sign via docusign. I set the routing orders for both of them as shown below:
Form 1
Order 1 RoleName signer test1#gmail.com
Order 2 RoleName signer2 test2#gmail.com
Form 2
Order 1 RoleName dataEntry test1#gmail.com
Order 2 RoleName dataEntry2 test2#gmail.com
This will send one email to test#gmail.com. This user completes all of his fields for both Form 1 and Form 2 in one request. This is what I want and expect. However, when test1#gmail.com completes their process, test2#gmail.com will receive 2 different emails. One to sign form 1 and the other to sign form 2. I'm trying to understand why test2#gmail.com doesn't work the same as test1#gmail.com. Can someone help explain what the reason is for receiving 2 separate emails for test2#gmail.com may be and if there's a way to fix it?
Note: When I do this via the docuSign website, it doesn't allow for the same recipient to be in that same routingOrder. It will bring up the error:
The role 'signer' conflicts with 'dataEntry'
The role 'signer2' conflicts with 'dataEntry2'
This behavior seemed strange to me since I'm able to send the envelope using the docusign rest API. If somebody could give me some clarification on this as well I'd appreciate it.
Thank you!
I am unable to repro the issue you describe. Here's what I did, and the Result:
I created two separate templates in DocuSign, each having a single document and two recipients/signers (with Role Names and Routing Orders that you specify above in your question).
I used the REST API (JSON request included below) to create/send an Envelope from these two Templates, specifying identical recipient information (name/email/recipient ID/routing order) for Recipient 1 and Recipient 2 across both Inline Template structures.
Result: Recipient 1 receives an email first, opens the envelope, and signs both documents at once. Then Recipient 2 receives an email, opens the envelope, and signs both documents at once. The Envelope status is "Completed" at that point.
I've included my API request below for your reference -- perhaps compare/contrast this with what you're doing? Also -- make sure that Recipient information (Name / Email / Recipient ID / Routing Order) is identical (including case) for each recipient between the first Inline Template and the second Inline template within the API Request -- any small difference in Name/Email/Recipient Id/Routing Order, and DocuSign will treat them as different/separate people (recipients).
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"emailSubject": "Please sign",
"emailBlurb": "Please sign...thanks!",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "TEMPLATE_ID_1"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "adamsemail#outlook.com",
"name": "Adam Adamson",
"recipientId": "1",
"roleName": "signer",
"routingOrder": "1"
},
{
"email": "bobsemail#outlook.com",
"name": "Bob Burns",
"recipientId": "2",
"roleName": "signer2",
"routingOrder": "2"
}
]
}
}]
},
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "TEMPLATE_ID_2"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "adamsemail#outlook.com",
"name": "Adam Adamson",
"recipientId": "1",
"roleName": "dataEntry",
"routingOrder": "1"
},
{
"email": "bobsemail#outlook.com",
"name": "Bob Burns",
"recipientId": "2",
"roleName": "dataEntry2",
"routingOrder": "2"
}
]
}
}]
}]
}

Resources