Create a draft

To create a draft signature process on Connectors APIs you need before to authenticate and get a valid access-token that allows you to perform operations on Connectors APIs.

Authentication

Visit Authentication section to know how get a valid access-token

Once you have a valid access-token you could follow this example that explains the steps you have to perform in order to create a draft.

Upload the documents you want to sign

To upload one or more documents you have to perform a multipart-form/data HTTP POST request and send PDF document content to Connectors APIs

POST /documents/upload

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

Authorization

  • A Bearer token authentication is required by specifying as value the JWT access-token

Parameters

Name Type Description
fileName File The file content in binary format

The HTTP response should look like this

{
    "documentIds": [
        "b3a178d5-516e-4e86-99e6-e8ff38ba7813"
    ]
}

Create the draft

Now that you have your document uploaded you could procede by creating the draft. To create the draft you have to provide a JSON definition where you could specify:

  • The draft name
  • The documents you want to sign
  • Subscribe actions in response to events

POST /processes/draft

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

Authorization

  • A Bearer token authentication is required by specifying as value the JWT access-token

Parameters

{
  "name": "Draft process",
  "documents": [
    "b3a178d5-516e-4e86-99e6-e8ff38ba7813"
  ],
  "events": [
      {
          "eventType": "envelopeFinished",
          "actions": [
              {
                  "type": "email",
                  "to": "your-email@domain.com",
                  "subject": "Signature process completed",
                  "body": "Body of the email"
              },
              {
                  "type": "http",
                  "method": "POST",
                  "envelopeGuidRequired": true,
                  "callbackUrl": "https://third-app-portal.com/callback",
                  "documentIds": true
              }
          ]
      },
      {
          "eventType": "workstepFinished",
          "actions": [
              {
                  "type": "email",
                  "to": "your-email@domain.com",
                  "subject": "Signature step completed",
                  "body": "Body of the email"
              },
              {
                  "type": "http",
                  "method": "POST",
                  "envelopeGuidRequired": true,
                  "callbackUrl": "https://third-app-portal.com/callback",
                  "documentIds": true
              }
          ]
      }
  ]
}

The HTTP response contains a link that you can open from the browser to complete and sign the created draft

{
    "signingUri": "https://esaw-domain.com/Agentredirect/index?draftId=9b5d3193-4370-4a09-9425-7e65a49dc16d",
    "processId": "9b5d3193-4370-4a09-9425-7e65a49dc16d"
}

Events

During the lifecycle of a signature process, if specified in JSON definitions, actions will be launched in response to events triggered by eSignAnyWhere or user

Get the process status

After and during the signature process you could verify the status of the process by requesting:

POST /processes/{processId}

HTTP request headers

  • Accept: application/json

Authorization

  • A Bearer token authentication is required by specifying as value the JWT access-token

Parameters

Name Type Description
processId String Process identifier

The HTTP response contains a status overview of the signature process

{
    "status": "Completed",
    "recipientsStatus": [
        {
            "id": "69cb9d83-4cfb-42bc-ada0-e64614dcf2fd",
            "email": "your-email@domain.com",
            "firstName": "Name",
            "lastName": "Surname",
            "orderIndex": 1,
            "signedDate": "2020-11-06T17:31:22.317Z",
            "status": "Signed",
            "workstepRedirectUrl": ""
        }
    ],
    "completedDocuments": [
        {
            "auditDocument": "",
            "documentId": "b1b4cd0a-e549-410d-ac18-e707d8d093d1",
            "fileName": "file.pdf"
        }
    ],
    "auditDocument": "5d74d929-8c70-41f6-acfe-5d79a478c43a"
}