This chapter explains how to configure the REST connection in SIGNATUS settings, under the section “Upload using REST channel”.
3.1 Upload document #
Upload is used to transfer signed documents from the SIGNATUS application to the server.
| URL | Configured in “REST upload URL” setting Example: /rest/document |
| Method | POST |
| Request body | The uploaded file content combined with metadata items using the “multipart/form-data” encoding The uploaded PDF or zip file sent as a binary file This main part is named using the setting “REST upload content key” Optional document metadata (name-value pairs in plain text) |
| Response | HTTP 200 OK: Upload successful (server typically returns an ID of the uploaded document) HTTP 403 Forbidden: Access denied |
The request body contains metadata items combined from the following sources:
- Metadata received in the List response (just before the document was downloaded)
- Metadata defined in “REST upload metadata” configuration
- Filename – the actual name of the file generated by the SIGNATUS application
Example upload request:
POST /url/to/upload HTTP/1.1
Content-Type: multipart/form-data; boundary=---1482331303188---
User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; SM-P605 Build/LMY47X)
Host: <server host>
Content-Length: 1020320
-----1482331303188---
Content-Disposition: form-data; name="filedata"; filename="aaa_1482331285073.pdf"
Content-Type: application/pdf
Content-Transfer-Encoding: binary
%PDF-1.7
....
-----1482331303188---
Content-Disposition: form-data; name="filename"
Content-Type: text/plain; charset=UTF-8
aaa_1482331285073.pdf
-----1482331303188---
Content-Disposition: form-data; name="state"
Content-Type: text/plain; charset=UTF-8
signed
-----1482331303188---
Content-Disposition: form-data; name="caseid"
Content-Type: text/plain; charset=UTF-8
Businesscase1
