Other way to upload document instead of using signature Request service, described in core API services, is to use Upload service. Upload service only uploads content of document in base 64 format, without definition of additional parameters like in signature Request service. If you are using Upload service than signature Request service refers only to document ID that was already uploaded (also in case of first-round signing process).
Upload service is used, when there is one system responsible for document preparation + upload and the other system knows how to configure signatureRequest parameters. It is necessary that the system which uploads the document to OKdokument API, provides unique document ID to the system which is registering the signing request. Service specifications:
URL | https://apidev.okdokument.com/JSON/document |
Method | POST |
Authentication | set header x-api-key |
Content type | application/json |
Response | HTTP 200 when uploaded successfully |
JSON request body parts (Content type):
Key | Format | Required | Default value | Description |
filename | String | No | Name of the document. This parameter is mandatory if you want to do the file conversion to PDF format. For conversion the file postfix must be: contract.doccontract.docxcontract.xlscontract.xlsx | |
state | String | No | tosign | The state of the document: tosign – document ready for signingtags – pre-processing document, searching for tags and inserting signature acrofields. After inserting signature acrofields, document changes state to tosign. |
file | JSON Object | Yes, | JSON Object of PDF file | |
content | base64 String | Yes | The binary content of the uploaded PDF file in base64 format. https://base64.guru/converter/encode/file Maximal document size is 10 MB Parameter content can be also called with $content. |
Request body example:
{
"filename": "example1.docx",
"state": "tags",
"file": {
"content": "xyz_JVBERi0xLjc=="
}
}
Response body example
{ "message": "msg.document.upload",
"result": "y7Ki_u1mrUwijfb-o_S1JiphSsoXya8iypH380F"}