The Upload Service provides an alternative method for submitting documents to the system. While functionally similar to the Signature Request service.
Unlike the standard signature request which requires document data to be encoded as a Base64 string within a JSON payload, the Upload Service utilizes Multipart Form Data (multipart/form-data).
Service specifications #
| URL | https://apidev.okdokument.com/JSON/upload |
| Method | POST |
| Authentication | Header x-api-key |
| Content Type | multipart/form-data |
| Response Type | application/json |
Request description #
Request parameters:
| Key | Type | Description |
| dataText | text | Document metadata in JSON format |
| data | file | Document data in JSON format. You can use the dataText parameter to send metadata as text directly in the request, or the data parameter to send metadata as a file. |
| file | file | The PDF document to be uploaded. |
HTTP- Click to view HTTP code snippet
POST /JSON/upload HTTP/1.1
Host: localhost:8080
x-api-key: 7796b696_bd2b1aaf7ef4f09be9f52ce2d8d599674d81aa9d6a4421696dc4d93dd0619d682ce56b4d64a9ef097761ced99e0f67265b5f76085e5b0ee7ca4696b2ad6fe2b2
Content-Length: 573
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="dataText"
{
"rules": {
"signAnywhereEnabled": false
},
"allowedFields": {
"SIGNATURE": [
"SC_signature"
],
"TEXT": [
"TO_text",
"TC_text"
]
}
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="PDF/TestLenso.pdf"
Content-Type: application/pdf
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Data text example :
{
"rules": {
"signAnywhereEnabled": false
},
"allowedFields": {
"SIGNATURE": [
"SC_signature"
],
"TEXT": [
"TO_text",
"TC_text"
]
}
}Signature Request OFF #
If signatureRequestId : off is present in data request system performs a “Storage Only” upload. The file is saved and validated, but no signature process is initiated
Request body example :
{
"signatureRequestId": "off"
}Response example :
{
"message": "msg.document.upload",
"result": "00h2dY9Zo8KN-MXBFTX1Sa7GmISgDXf0Ntw3jUqReRmjFtnrDf2S3J-Fbe49iVQA"
}