Sign Documents Sync

Integrating Document Signing with ADO Technologies

The synchronous document signing process allows clients to sign PDF documents in real-time. This process involves obtaining an authentication token and then using that token to sign the documents. The following steps outline how to interact with the API to achieve this.

  1. Obtain Authentication Token: First, authenticate the service and obtain an access token via the OpenID Connect `client_credentials` grant type.
  2. Sign Documents: Use the obtained token to submit PDF documents for signing, along with the client information or identity validation transaction number.

Token Generation (Authentication)

This endpoint authenticates the service and obtains an access token via OpenID Connect. 

Example Request

curl -X 'POST' \
  'https://example.com/token' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'client_id=your_client_id&client_secret=your_client_secret&grant_type=client_credentials'

Responses

200 OK: Access token obtained successfully.

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}

400 Bad Request: Invalid request.

{
  "error": "Invalid credentials."
}

Document Signing Endpoint

This endpoint receives PDF documents and the client information or identity validation transaction number, and returns the list of signed documents with their reference, internal document number, signed document, status, and error reason if applicable.

Example Request

curl -X 'POST' \
  'https://example.com/sign-documents' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'x-account-id: your_account_id' \
  -H 'x-project-id: your_project_id' \
  -H 'Authorization: Bearer your_access_token' \
  -F 'documentPairs[0].referenceNumber=ref123' \
  -F 'documentPairs[0].document=@/path/to/your/document.pdf' \
  -F 'clientInfo=transactionNumber' \
  -F 'x1=300' \
  -F 'y1=300' \
  -F 'x2=500' \
  -F 'y2=150' \
  -F 'signaturePage=0'

Responses:

200 OK: List of signed documents with their reference, internal document number, signed document, status, and error reason if applicable.

{
  "signedDocuments": [
    {
      "referenceNumber": "ref123",
      "documentId": "doc001",
      "signedDocument": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "status": "SUCCESS",
      "errorReason": null
    },
    {
      "referenceNumber": "ref456",
      "documentId": "doc002",
      "signedDocument": null,
      "status": "FAIL",
      "errorReason": "Identity validation error."
    }
  ]
}

400 Bad Request: Invalid request.

{
  "error": "Missing documents or client information."
}

401 Unauthorized: Unauthorized. The token was not provided or is invalid.

{
  "error": "Token not provided or invalid."
}

403 Forbidden: Forbidden. The token has expired.

{
  "error": "Token expired."
}

500 Internal Server Error: Internal server error.

{
  "error": "Error signing the documents."
}


Revision #6
Created 26 June 2024 20:13:48 by Admin
Updated 27 November 2024 17:02:22 by roger de avila