AssureSign: JSON Content For The Submit Method with a Template

  • 15 February 2022
  • 0 replies
  • 98 views

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.7/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:
    22638iFFAA7AFFAE830802.png

     



    Example mapping into location for Envelope:
    22639iA5108C96763AB8DB.png

     



    Example for mapping into location for Signatory:
    22640i145EB2C0CF32C8F3.png

     

  4. Collect your Template ID:
    22641i756AF696D842F64A.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:
    22642i31B6013247F7C4D0.png

     


0 replies

Be the first to reply!

Reply