DocuSign signers and non-signers routing - salesforce

I am currently not specifying any routing order for signers and non-signers(cc recipients). In this case non-signers get the email only when the signers have signed and completed the envelope. I need for non-signers to get email same time as signers (before signers sign) as well as after signers sign and complete. How to achieve this. I alresy looked at this solution Docusign - Adding a non signing CC role with same routing order
But when I tried different roleNames and same routing order I get "errorCode": "ENVELOPE_HAS_DUPLICATE_RECIPIENTS",
How do we differtiate between signers and non-signers? I tried to use different role names, but did not work.
My request json:
{
"status": "created",
"recipients": {
"signers": [{
"tabs": {
"signHereTabs": [],
"initialHereTabs": [],
"dateSignedTabs": []
},
"routingOrder": '1',
"roleName": "Signer",
"recipientId": "1",
"name": "Signer Name",
"email": "someone#somewhere1.com",
"clientUserId": null
}],
"carbonCopies": [{
"routingOrder": "1",
"roleName": "CCRole",
"recipientId": "1",
"email": "someone1#somewhere.com"
}, {
"routingOrder": "2",
"roleName": "CCRole",
"recipientId": "2",
"email": "someone2#somewhere.com"
}]
},
"messagelock": "false",
"emailsubject": "DocuSign:1xxxxx78-03 - Testcase",
"emailblurb": "Please sign attached document(s)",
"documents": [{
"name": "11xxxxxx8-01- Documents",
"documentid": "1",
"documentBase64": null
}],
"customFields": {
"textCustomFields": [{
"value": "a54c00000000ogaAAA",
"show": "false",
"required": "true",
"name": "DSFSSourceObjectId",
"fieldId": null
}]
}
}

Recipients at the same routing order will receive emails simultaneously when the envelope reaches the particular routing order. In addition a CarbonCopy recipient will also receive an email that an envelope is completed.
Carbon Copy Recipients
Documentation here
Carbon copy recipients get a copy of the envelope but don't need to sign, initial, date or add information to any of the documents. This type of recipient can be used in any routing order. Carbon copy recipients receive their copy of the envelope when the envelope reaches the recipient's order in the process flow and when the envelope is completed.
Sending Envelope with notifications to CC recipients before and after Signer
Documentation here
You are getting the ENVELOPE_HAS_DUPLICATE_RECIPIENTS error message since you have specified recipientId = 1 for multiple recipients. Also you can remove the roleName as there is no template involved.
Here is an example that should work for your use case. I am using unique routing order and recipient ID for each of the recipients.
POST /v2/accounts/{accountId}/envelopes
{
"emailSubject": "Envelope with 1 cc - 1 signer - 1 cc",
"status": "sent",
"recipients": {
"signers": [
{
"email": "AndySigner#acme.com",
"name": "Andy Signer",
"recipientId": "2",
"routingOrder" : "2",
"tabs": {
"signHereTabs": [
{
"documentId": "1","pageNumber": "1", "xPosition": "80", "yPosition": "80",
}
]
}
}
],
"carbonCopies": [
{
"name": "Jane CC",
"email": "Janecc#acme.com",
"recipientId": "1",
"routingOrder": "1"
},
{
"name": "Bob CC",
"email": "BobCC#acme.com",
"recipientId": "3",
"routingOrder": "3"
}
],
},
"documents": [
{
"documentId": "1",
"name": "Contract",
"fileExtension": "txt",
"documentBase64": "RG9jIFRXTyBUV08gVFdP"
}
]
}

Related

I keep receiving an empty message error when trying to post a webhook

This is my first time using Discord embeds, let alone, making a webhook. Having a little bit of trouble trying to figure out what I'm doing wrong. Hopefully someone can help!
When I try to send an embed with a message with this code:
{
"username": "Official Discord Servers",
"avatar_url": "https://imgur.com/a/Cl3zspb",
"embeds": [{
"description": "Here is a list of official Discord servers maintained by our State. Note that most of these servers may restrict full access to those who are members of their respective departments:",
"color": 16007990,
"fields": [
{
"name": "State of Atoll",
"value": "[Discord Server](https://discord.gg/5KKgb2z)"
},
{
"name": "Atoll Law Enforcement Training Academy",
"value": "[Discord Server](https://discord.gg/GJnbavz)"
},
{
"name": "Atoll Department of Homeland Security",
"value": "[Discord Server](https://discord.gg/acnPFa7)"
},
{
"name": "Palm County Sheriff's Office",
"value": "[Discord Server](https://discord.gg/uYFANDs)"
},
{
"name": "Atoll State Police",
"value": "[Discord Server](https://discord.gg/WNHKtra)"
},
{
"name": "Atoll Department of Corrections",
"value": "[Discord Server](https://discord.gg/VbFew9s)"
},
{
"name": "Atoll National Guard",
"value": "[Discord Server](https://discord.gg/6zE9HyW)"
}]
}
I get this error:
{
"code": 50006,
"message": "Cannot send an empty message"
}
You need to send "content" as a key value pair containing the content of the message being sent.
"content": "Just testing webhooks"
It requires header Content-Type with value application/json. Also try setting content field.
Your issue is invalid JSON, so try using JSON validator
The JSON referred in the question cannot be parsed, it is not properly formed, it is missing closing brackets. Please find last set of }] brackets in my answer below, try this,
{
"username": "Official Discord Servers",
"avatar_url": "https://imgur.com/a/Cl3zspb",
"embeds": [{
"description": "Here is a list of official Discord servers maintained by our State. Note that most of these servers may restrict full access to those who are members of their respective departments:",
"color": 16007990,
"fields": [
{
"name": "State of Atoll",
"value": "[Discord Server](https://discord.gg/5KKgb2z)"
},
{
"name": "Atoll Law Enforcement Training Academy",
"value": "[Discord Server](https://discord.gg/GJnbavz)"
},
{
"name": "Atoll Department of Homeland Security",
"value": "[Discord Server](https://discord.gg/acnPFa7)"
},
{
"name": "Palm County Sheriff's Office",
"value": "[Discord Server](https://discord.gg/uYFANDs)"
},
{
"name": "Atoll State Police",
"value": "[Discord Server](https://discord.gg/WNHKtra)"
},
{
"name": "Atoll Department of Corrections",
"value": "[Discord Server](https://discord.gg/VbFew9s)"
},
{
"name": "Atoll National Guard",
"value": "[Discord Server](https://discord.gg/6zE9HyW)"
}]
}]
}
In my case, I was sending a plain text directly instead of JSON in the request. Then when I changed the message to the below it worked.
{content: "This is the message"}
If you are sending embeds, you can still keep the content set to null.

angular js fetching data from url

I am new to angular js.I am trying to fetch data from url.I know how to fetch data from json with single array.But if the json has many arrays,then how to fetch it?
For example:
The json is as follows:
{
"Details": [{
"approved": [{
"count": "2124",
"type": "Approved ",
"desc": "New registration"
}, {
"count": "902",
"type": "Deemed approved ",
"desc": "New registration"
}, {
"count": "60",
"type": "Approved ",
"desc": null
}, {
"count": "5",
"type": "Deemed approved ",
"desc": null
}, {
"count": "29",
"type": "Approved ",
"desc": null
}]
}, {
"pending": [{
"count": "492",
"type": "Amendment of core fields"
}, {
"count": "18",
"type": "New registration"
}, {
"count": "1",
"type": null
}]
}, {
"rejected": [{
"count": "29",
"type": "New registration"
}]
}, {
"resubmit": [{
"count": "9",
"type": "New registration"
}]
}]
}
Lets say you send the request as follows:
$http.get('/data').then(function(response) {
response // your JSON
});
Now inside response you will have your entire JSON as a javascript object. So you can use it as follows:
response.Details.approved[0].count // 2124
response.Details.pending[0].count // 492

Docusign Custom tags - formula tags

We are using Conga Composer to generate and send docs to customer (background mode) by adding DocuSign custom tags as integration parameters in the API call. we would want to add 3 days to the date signed value dynamically but formula tag is not supported in custom tags Documentation. Any thoughts how this can be achieved?
You will need a formula tag with the formula AddDays([DateSigned],3)
Here is a sample createEnvelope request.
POST /v2/accounts/{accountId}/envelopes
{
"emailSubject": "Please sign the agreement with two Date Tabs",
"status": "sent",
"recipients": {
"signers": [
{
"name": "Jane Doe",
"email": "JaneDoe#acme.com",
"recipientId": "1",
"tabs": {
"dateSignedTabs": [
{
"tabLabel": "ImportantDate",
"documentId": "1",
"pageNumber": "1",
"xPosition": "100",
"yPosition": "150"
}
],
"formulaTabs": [
{
"formula": "AddDays( [ImportantDate],3)",
"width": "100",
"documentId": "1",
"pageNumber": "1",
"xPosition": "300",
"yPosition": "150"
}
]
}
}
]
},
"documents": [
{
"documentId": "1",
"name": "Contract",
"fileExtension": "txt",
"documentBase64": "VGVzdCBEb2N1bWVudA=="
}
]
}
Docusign confirmed that this is not possible via anchor tags (custom tags).

Docusign Send Multiple Envelope to multiple Signer with one to one Document to Signer mapping

I have been working on Salesforce to Docusign Integration. I have multiple documents with Specific signer for each document i.e. one document should be send to one specific user, not all. But I want to do this in one Rest API call to docusign! The documents are stored in Accounts attachments which are created dynamically for each user which are specific to user.
I have been trying this using CompositeTemplates, what I am doing is, adding document and Signer in each inlineTemplate, But it is sending all the documents to all the users in sequence.
I don't want to show all document to all the user, they should see only document specific to them.
Below is the JSON which I am sending:
{
"status": "Sent",
"compositeTemplates": [
{
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"roleName": "Signer 1",
"recipientId": "1",
"name": "Anmol",
"email": "test#gmail.com"
}
]
},
"envelope": {
"status": "Sent",
"emailSubject": "test1"
},
"documents": [
{
"name": "Doc 1",
"fileExtension": "doc",
"documentId": "1",
"documentBase64": "JVBERi0xLjQKJeLjz9MKN58HkeCg8gJEomcWGJdEFtOYYklsXV2dlT6R6Owc+FXFMNSlpckKM6M/ioTGkROkEjkxBDrgthySkvMxGpQJYapHKWwcwXtRU9GCg=="
}
],
"customFields": {
"listCustomFields": [
{
"value": "00128000003tPKB",
"show": "true",
"required": "false",
"name": "Account",
"fieldId": "1",
"configurationType": "salesforce"
}
]
}
}
],
"compositeTemplateId": "1"
},
{
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"roleName": "Signer 2",
"recipientId": "1",
"name": "Anmol",
"email": "test1#gmail.com"
}
]
},
"envelope": {
"status": "Sent",
"emailSubject": "test2"
},
"documents": [
{
"name": "Doc 2",
"fileExtension": "doc",
"documentId": "2",
"documentBase64": "JVBERi0xLjYNJeLjz9MNCjEzIDAgb2JqDTw8L0xpbmVhcmlmDQoxMTYNCiUlRU9GDQo="
}
],
"customFields": {
"listCustomFields": [
{
"value": "00128000003tPKB",
"show": "true",
"required": "false",
"name": "Account",
"fieldId": "1",
"configurationType": "salesforce"
}
]
}
}
],
"compositeTemplateId": "2"
}
]
}
Any doc, code or suggestions about the approach I am following for this will be very helpful.
To do it in a single api call, specify the excludedDocuments property in the EnvelopeCreate request
excludedDocuments: Specifies the documents that are not visible to the recipient. Document Visibility must be enabled for the account and the enforceSignerVisibility property must be set to true for the envelope to use this.
Here is a sample Json for POST /v2/accounts/{accountId}/envelopes
Note: I have combined both your inline templates into a single inlineTemplate.
{
"status": "Sent",
"emailSubject": "Email Subject to all recipients",
"emailBlurb": "Email body to all recipients",
"compositeTemplates": [
{
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"recipientId": "1",
"name": "recipient one",
"email": "recipientone#dsxtr.com",
"excludedDocuments": [ "2" ]
},
{
"recipientId": "2",
"name": "recipient two",
"email": "recipienttwo#dsxtr.com",
"excludedDocuments": [ "1" ]
}
]
},
"documents": [
{
"name": "Doc 1",
"fileExtension": "doc",
"documentId": "1",
"documentBase64": ""
},
{
"name": "Doc 2",
"fileExtension": "doc",
"documentId": "2",
"documentBase64": ""
}
]
}
],
"compositeTemplateId": "1"
}
]
}
I believe you're looking for documentVisibility on the create envelope call.
There are other supporting documentVisibility endpoints here.

how to Bring pre-created custom field from docusign Sandbox to envelope using REST api?

I have created some custom fields in my Docusign Sandbox, but I'm unable to bring them onto my envelope while sending it for eSignature.
I want Docusign custom fields to write back data to Salesforce fields when signer has entered some value and signed the document
I have tried it with the below JSON. The envelope is created but I can't find the custom fields
{
"emailBlurb": "String content",
"emailSubject": "String content",
"enableWetSign": "true",
"recipientsLock": "false",
"status": "sent",
"customFields": {
"listCustomFields": [{
"name": "String content",
"required": "false",
"show": "true",
"value": "String content",
"listItems": [
"String content"
]
}],
"textCustomFields": [{
"name": "Insurance Expiration",
"required": "false",
"show": "true",
"value": "012/02/2111"
}]
},
"templateId": "152bacc1-9d5d-4243-9fe4-9dafe0785164",
"templateRoles": [{
"email": "r00ranjit#gmail.com",
"name": "ranjit",
"roleName": "CFO",
"emailNotification": {
"emailSubject": "String content",
"emailBody": "String content"
},
"tabs": {
"textTabs": [{
"tabLabel": "String content111",
"name": "String content1",
"value": "String content"
}]
}
}],
"emailSettings": {
"bccEmailAddresses": [{
"email": "r00ranjit#gmail.co"
}]
},
"compositeTemplates": [{
"inlineTemplates": [{
"sequence": "1",
"customFields": {
"textCustomFields": [{
"name": "Insurance Expiration",
"required": "true",
"show": "true",
"value": "06/06/2010"
}]
},
"recipients": {
"signers": [{
"name": "Millard Fillmore",
"email": "ranjit.r#attinadsoftware.com",
"recipientId": "1",
"routingOrder": "1"
}]
}
}]
}]
}
When you send from Salesforce, there is information passed to document (such as the SourceID and Source Object Type), that DocuSign Connect will attempt to match to a record to process a request to push the data back into Salesforce.
When you send from the API you need to provide this data in order for Salesforce to know where you want information published back.
DocuSign API how to sync tags in template with Salesforce fields
https://salesforce.stackexchange.com/questions/92069/how-to-set-docusign-envelope-external-source-id-field-via-docusign-api
Those should help.

Resources