How to send an agreement with merge fields using API | Adobe Sign

Objective

How to send an agreement using API that has prefilled values for the specific form fields ( mergefield )?

Prerequisite of this call is to first complete the "Transient Upload” step and obtain a "transientDocumentId" (using: secure.na1.echosign.com/public/docs/restapi/v5#!/transientDocuments/createTransientDocument) to use here.

This call includes the “mergeFieldInfo” section where default values for specific form fields are given.

This pre-fills the data from another system in the API call.

These fields in the agreement are either editable or read-only.

Environment

Adobe Sign REST API.

Steps

Pre-requisites:

  1. Transient Document id
  2. Field names and their values

Sample request call

Request:
POST /api/rest/v5/agreements HTTP/1.1
Host: api.na1.echosign.com (or you can specify your shard name, which you can find using the getbaseURis call: https://secure.na1.echosign.com/public/docs/restapi/v5#!/base_uris/getBaseUris
Access-Token: 2AAABLblqZhA_D1mluNKQP7py5vXtt-1UHl9NR25e_C3LnKTUH14IblbrXODbXGRozyr7ChBkJNM*
x-user-email: sender@yourdomain.com
Content-Type: application/json
Cache-Control: no-cache

{
   "documentCreationInfo": {
       "signatureType": "ESIGN",
       "recipientSetInfos": [
           {
               "recipientSetMemberInfos": [
                   {
                       "email": “signerEmail@domain.com"
                   }
               ],
               "recipientSetRole": "SIGNER"
           }
        ],
     
       "signatureFlow": "SENDER_SIGNATURE_NOT_REQUIRED",
       "message": "Please Sign this from us!",
       "fileInfos": [
           {
               "transientDocumentId": "3AAABLblqZhD1uP3ZnkJximC0JV1S677PR5xmybSJ-SJn6OtEy2tVqFyMN4xUAbhKTSkLw2Zb6HEF4zAGsrUd2ycoB8fFHQJhrci0O6267VztmIL4nCicSqvAjO7HckATHAsovVmuYwI9_FDDgHg0ogyti62L13HQFZIQRe9iyQMvvzbmksM7ODNK_HEepEKRCeJTtis9FOlz6uRCcIMNlbX_2GU8utWT"
           }
       ],
       "name": "MSA Edited”,
        "mergeFieldInfo": [
            {
                "fieldName": "AccountName",
                "defaultValue": "Sam's Garage"
            },
            {
                "fieldName": "AccountNumber",
                "defaultValue": "8756999"
            },
            {
                "fieldName": "Zip",
                "defaultValue": "94501"
            },
            {
                "fieldName": "City",
                "defaultValue": "CityVille"
            },
            {
                "fieldName": "State",
                "defaultValue": "CA"
            },
            {
                "fieldName": "Street",
                "defaultValue": "123 Some Road"
            },
            {
                "fieldName": "Title1",
                "defaultValue": "COO"
            },
            {
                "fieldName": "Description",
                "defaultValue": "Some new description here"
            }
        ]
   }

}

The response to this call is the “agreementId” which you need to store in your system for subsequent calls(signingUrl, status, formData etc.)

Response:
{
  "agreementId": "3AAABLblqZhCf_7xDcrOgKFwAabp1S-OFfvUdHf2wJsSMwlB95_x_WdUeab67jOkJi1IJzWuSJ0zdNNKugS1blZB4LT5vNVyJ"
}
Adobe logo

Sign in to your account