Signing documents via Documentolog API

Fast launch and legal force

Document

In progress

Signing

Completed

About the integration

Legally significant document signing in your product

Who this solution is for:

  • Banks and fintech companies: loan agreements, contracts, supplementary agreements, etc.

  • B2B SaaS systems: contracts, acts, and NDAs

  • Marketplaces: reconciliation acts, contracts with sellers/buyers,

  • Other types of companies

Documentolog API capabilities:

  • Creating documents and sending them for signing via API request

  • Using the legally significant Documentolog infrastructure

  • Support for multiple signing methods: EDS, Egov QR, SMS, Adobe Sign

  • Embedding the signing process via iframe into your interface

  • Receiving the signing result via Webhook

Process description

Sending and signing a document

  1. The initiator uploads the contract file to the system — PDF, Word, Excel and other formats are supported.
  2. The initiator specifies the recipient — by phone number, IIN, BIN, or email.
  3. The initiator chooses the sending type: view only or signing.
  4. The initiator clicks «Send» and, if necessary, signs the document themselves — after which the document is sent to the recipient.
  5. The recipient receives a link or notification and opens the document on their device. If the recipient is registered in Documentolog Business, the document will appear in their system automatically.
  6. The recipient independently chooses a convenient signing method and signs the document.
  7. The initiator receives a notification about the signing and the finalized file

The recipient did not sign the document

The recipient opens the document on their device:

  1. If the recipient decides not to sign — they click «Reject». The initiator immediately receives a notification and can contact the recipient to clarify the reasons.
  2. If the recipient closed the document without making a decision — the link remains active for 30 days. The initiator sees the «Not signed» status and can send a reminder.

Developer documentation

This documentation describes the process of obtaining an access token and using it for embedding into an iframe.
This is necessary for working with documents and signing them via API

To begin integration, you need to register in the system:

  1. On the https://documentolog.com/ website, click "Start for free" and register in the Documentolog Business system.

  2. To gain access to the Documentolog API, you need to purchase the Business plan. More details: https://documentolog.com/tariffs

  3. After paying for the plan, go to the "Integrations" section

  4. Go to the "API Documentolog" tab

Part 1: Getting the Access Token

1.1 Access Token request

To get the access token, execute the following cURL request:

36 lines

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

curl --location 'https://apiv1dlkz.doculite.kz/json/external/oauth/token' \

--header 'api-key: {{api-key}}' \

--header 'Content-Type: application/json' \

--data '{

"aAttachments": [

"https://dlkz.doculite.kz/rct/sample.pdf"

],

"sSetWebhookUrl": "https://your-server.com/webhook",

"iSendToRecipient": 1,

"mRecipient": [

"000000000000"

],

"mPhonesForSms": [

{

"enableBMG": false,

"phone": "+X (XXX) XXX-XX-XX",

"fio": "Simple name",

"iin": "",

"type": "sms"

}

],

"iRecipientSignatureRequired": 1,

"mAvailableSignatureMethodsForRecipient": [

"eds",

"egov-qr",

"adobe-sign",

"sms"

],

"mAvailableSignatureMethods": [

"eds",

"egov-qr",

"adobe-sign",

"sms"

],

"sSender": "000000000000"

}'

1.2 Request parameters

Request body parameters:

  • aAttachmentsarray of links to files that need to be signed

  • sSetWebhookUrlURL to receive a webhook notification after signing

  • iSendToRecipientflag to send the document to the recipient (1 — send)

  • mRecipientarray of IINs of the document recipients

  • mPhonesForSmsSMS signing parameters for recipients

    • enableBMGwhether to use the BMG service for sending SMS

    • phonerecipient phone number in the format +X (XXX) XXX-XX-XX

    • fiofull name of the recipient

    • iinIIN of the recipient

    • typesending type (sms)

  • iRecipientSignatureRequiredwhether the recipient's signature is required (1 — yes)

  • mAvailableSignatureMethodsForRecipientavailable signing methods for the recipient

  • mAvailableSignatureMethodsavailable signing methods for the sender

  • sSenderIIN of the document sender

1.3 Request result

If the request is successful, you will receive a JSON response with the status and token data:

8 lines

01

02

03

04

05

06

07

08

{

"status": 1,

"data": {

"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",

"scope": "document-create|document-sign|document-show",

"token_type": "Bearer"

}

}

  • access_tokenJWT token for iframe authorization

  • scopeallowed operations (create, sign, view)

  • token_typetoken type (Bearer)

Part 2: Embedding the token into iframe

After receiving the access_token, form the URL for the iframe and embed it into your page.

Form the URL by substituting the access_token value from the response:

1 line

01

https://apiv1dlkz.doculite.kz/external/sign/embedded?sParams={{data.access_token}}

Example of embedding iframe in HTML:

1 line

01

<iframe src="https://apiv1dlkz.doculite.kz/external/sign/embedded?sParams=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..." width="400px" height="600px"></iframe>

Appearance of the iframe for signing the document

Appearance of the iframe for signing the document

Part 3: postMessage event

3.1 Signing result

After the document is signed, the iframe sends a postMessage event with the result. Subscribe to the 'message' event to receive the data:

6 lines

01

02

03

04

05

06

{

isDocumentolog: true,

type: 'sign',

success: true | false,

signType: 'eds' | 'egov_gr'

}

  • isDocumentologflag indicating the event belongs to Documentolog

  • typeevent type

  • successoperation result (true — success, false — error)

  • signTypesigning method (eds or egov_gr)

3.2 User closed the iframe

If the user closed the signing form without signing, a separate message is sent:

5 lines

01

02

03

04

05

{

isDocumentolog: true,

type: 'user-close',

success: false,

}

  • isDocumentologflag indicating the event belongs to Documentolog

  • typeevent type

  • successoperation result (true — success, false — error)

3.3 Document already signed

If the document opened in the iframe has already been signed, the following message is sent:

5 lines

01

02

03

04

05

{

isDocumentolog: true,

type: 'already-signed',

success: true,

}

  • typeevent type

  • successoperation result (true — success, false — error)

Part 4: Webhook

4.1 Webhook events

While working with the document, POST requests with information about key events are sent to the URL specified in the sSetWebhookUrl parameter:

4 lines

01

02

03

04

{

"event": "document_sent",

"doc_id": "KZ000000000000000001234567"

}

8 lines

01

02

03

04

05

06

07

08

{

"event": "signer_signed"|"signer_declined",

"doc_id": "KZ000000000000000001234567",

"signer": {

"name": "Сейтқали Нұрлан",

"recipient": "000000000000"

}

}

  • eventevent type (document_sent, signer_signed, signer_declined)

  • doc_iddocument identifier

  • signersigner data

    • namefull name of the signer

    • recipientIIN of the signer

4.2 Signing completion

After all parties complete signing the document, a final event is sent to the webhook URL with links for viewing and downloading the files:

24 lines

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

{

"event": "document_completed",

"doc_id": "KZ000000000000000001234567",

"document": "https://apiv1dlkz.doculite.kz/external/document/view-document/dcs_universal_type/1234",

"download_all_files": "https://apiv1dlkz.doculite.kz/external/media/download-many?files=4444",

"download_files": [

{

"name": "sample.pdf",

"link": "https://apiv1dlkz.doculite.kz/external/media/download/4444"

}

],

"download_files_with_eds": [

{

"name": "sample.pdf",

"link": "https://apiv1dlkz.doculite.kz/external/media/download-eds/dcs_universal_type/1234/4444"

}

],

"download_files_with_eds_ez": [

{

"name": "sample.pdf",

"link": "https://apiv1dlkz.doculite.kz/external/media/download-eds-ez/dcs_universal_type/1234/4444"

}

]

}

  • eventevent type (document_completed)

  • doc_iddocument identifier

  • documentlink to view the document

  • download_all_fileslink to download all files in a single archive

  • download_fileslist of files to download

  • download_files_with_edslist of files with attached EDS signatures

  • download_files_with_eds_ezlist of files with EDS signatures in Ez format