Follow

JSON Content for the Submit Method

Last updated 2020-06-15 18:18:08 UTC

STEPS FOR SENDING WITH A TEMPLATE

  1. Ensure you have an API user and are able to get the token.
  2. In your REST coding interface, use endpoint, ensuring you've altered the items in italics to match your organization's settings:  yourASdomainhere/api/documentnow/versionnumberhere/submit/

    An example would be:
    sb.assuresign.net/api/documentnow/v3.6/submit/

  3. Set up your template in the Simple Setup User Interface. Anything you want to pass into the template should be created as a Sender Input AND mapped to the correct locations (Edit Envelope/Edit Document). Take note of the names of the Sender Inputs you’ve created, as that will be the name part of the name/value pair in the API call.

    Example Sender Inputs:
    SenderInput.png

    Example mapping into location for Envelope:
    MappingEnvelope.png

    Example for mapping into location for Signatory:
    MappingSignatory.png
  4. Collect your Template ID:
    CollectTemplateID.png

  5. Now that the Sender Inputs have been mapped to the correct locations in the template and you have your Template ID, we’re ready to populate this into the API call.  The value of each sender input is put into a "values" collection of name/value pairs:
    {
    "request": {
    "templates": [
    {
    "templateID": "8542012e-b9cb-4a5c-bd4c-ab25011d6c7d",
    "values": [
    {
    "name": "Envelope Name",
    "value": "My 3rd Submission"
    },
    {
    "name": "EnvelopeOrderID",
    "value": "9876542345678"
    },
    {
    "name": "DocumentOrderID",
    "value": "97586etfgv8i"
    },
    {
    "name": "Expiration Date",
    "value": "2/27/2020"
    },
    {
    "name": "Language",
    "value": "en-US"
    },
    {
    "name": "Signer 1 Name",
    "value": "SendAPI W. Template"
    },
    {
    "name": "Signer 1 Email",
    "value": "signer1@email.com"
    },
    {
    "name": "Signer 1 Mobile Phone",
    "value": "123-456-7890"
    },
    {
    "files": [
    {
    "fileToUpload": {
    "data": "AllYourBase64DataHere"
    "fileName": "SomeFileName.pdf"
    },
    "extension": "pdf"
    }
    ],
    "overlayStartPage": 0
    }
    ]

    }
    ]
    }
    }
    Sender inputs that are documents are constructed differently in the JSON.  Instead of a value, you should set a files collection, as shown in the example above.
  6. Which will result in this, when called:
    Result.png
Have more questions? Submit a request