DocuSign - Attach Completed Documents to Salesforce Object

642 Views Asked by At

I'm trying to attach a completed docusign document to a custom object (Compliance_Item__c) either under the notes and attachments or files related list in salesforce. I'm thinking it's an issue with my request but I'm unsure as to what needs to be changed to properly pass in the custom object's record id.

This is the request I am making to Docusign to create the envelope via REST Api.

{
  "status": "sent",
  "inlineTemplates": [
    {
      "customFields": {
        "textCustomFields": [
          {
            "name": "Compliance_Item__c",
            "value": "' + complianceItem.Id + '",
            "configurationType": "salesforce"
          }
        ]
      }
    }
  ],
  "templateRoles": [
    {
      "clientUserId": 1,
      "roleName": "Signer 1",
      "name": "' + contact.Name + '",
      "email": "' + contact.Email + '",
      "tabs": {
        "textTabs": [
          {
            "tabLabel": "SignerCompany",
            "xPosition": "104",
            "yPosition": "174",
            "name": "SignerCompany",
            "value": "' + contact.Company_Name__c + '"
          },
          {
            "tabLabel": "SignerTitle",
            "xPosition": "104",
            "yPosition": "202",
            "name": "SignerTitle",
            "value": "' + contact.Title + '"
          }
        ]
      }
    }
  ],
  "returnUrl": "https://demo.docusign.net",
  "email": "[email protected]",
  "authenticationMethod": "email",
  "userName": "WW Vendor",
  "emailSubject": "Please DocuSign Test Document",
  "templateId": "' + templateId + '"
}

Here's an image of the docusign settings for connecting to my salesforce custom object.

Docusign Salesforce Connect Object

1

There are 1 best solutions below

0
On

We don’t have a good recipe for this specific use case, but the PowerForm write-back process is fairly similar. The only real difference is that they would be attaching the envelope instead of updating fields. You may also want to reach out to your DocuSign representative if you need additional functionality.