Contact us at support@legalesign.com if no relevant article exists yet.
Home > API > Callbacks on the API v.1

Callbacks on the API v.1

The API offers two types of callback.  Use callbacks and not polling. To sync your database use /document/ and special query parameter ?cache=1. See  API /document/ endpoint for more information.

i) Option 1 ('all') - Eventying every 6 minutes; or
ii) Option 2 ('signed'): notification when a document is signed.

Option 1. Everything every 6 minutes.

Data is POSTED to you in two sections, 'data’ and 'signed’. The data section is a JSON object that is a list of dictionaries of the changes. The dictionaries are a record of each change to document and siger status in the order they occured. The second section is a signed string (base64 encoded) you can use to verify the data is genuine should you wish. Contact us for the X509 certificate.

The data contains a list of dictionaries that contains the notification information.

Attributes Explantion
timestamp ISO format of when the change occured
resource_uri The object the notification relates to.
name What the message relates to
value The value the message relates to.

Example:

 {
    u'data':
        [
          u'[
                {
                "timestamp": "2018-03-20T07:09:52",
                "name": "status",
                "value": "40",
                "resource_uri": "/api/v1/signer/[signer-id]/"
                },
                {
                "timestamp": "2018-03-20T07:09:52",
                "name": "status", "value": "30",
                "resource_uri": "/api/v1/document/[doc-id]/"
                }
            ]'
        ],
    u'signed':
        [u'long_string_of_numbers_and_digits']
    }

This tells you that signer "/api/v1/signer/[signer-id]/" changed to status 40 (signed) at 2018-03-20T07:09:52, and that document '/api/v1/document/[doc-id]/' was fully signed (status 30) at 2018-03-20T07:09:52. (A signed document has status 30, while a signed signer has status 40.) The dictionary will contain each status change in order they occured with the timestamp, so it is likely to contain multiple status changes for a single signer.

 

 

Option 2. Realtime update when a document is signed

Example of the POST that will be sent to you

    {
      "resource_uri": "/api/v1/document/[doc-id]/",
      "group": "/api/v1/group/your-group/",
      "name": "name of doc",
      "uuid": "[doc-id]"
    }

Whenever a document is signed you’ll get a POST containing the resource URI, group, name of document and its id. This is just a regular POST dictionary, it is not a JSON object.

(If you used the API to create the document in the first place, the status resource_uri of the document is included in the 'Location’ header of the 201 'created’ response.)

Back to main website
Email us at support@legalesign.com