Upload a chunk
Upload a chunk to an existing document upload session.
Copy
POST /outbound/documents/{id}
Arguments
| Name | Type | Mandatory | Comments | Default |
|---|---|---|---|---|
| id | String |
|
The document ID to which to add this buffer (to get an ID, create a document upload session) . | None, mandatory. |
Request headers
Header Range needs to indicate which byte numbers are being uploaded in the current chunk (up to 1 Mb per chunk), for example, Range: bytes=0-32568.
Note: Chunks must be sequential, they cannot be loaded in random order.
Request content
The request content area holds the chunk being uploaded.
Response
Response codes
Standard HTTP response codes apply, but these are interesting here:
| Response Code | Meaning |
|---|---|
| 202 ACCEPTED | The chunk has been accepted, but you haven’t uploaded the entire document yet. |
| 200 OK | The chunk has been accepted, and you have uploaded the entire document. |
| 413 REQUEST ENTITY TOO LARGE | You’ve already uploaded the entire expected buffer. |
Response headers
| Response Header | Meaning |
|---|---|
| X-Content-Range: bytes 0-{mmmmm}/{nnnnn} | Which bytes of the document have been received |
Sample calls
Raw HTTP
Copy
POST /outbound/documents/9ac5137ac9384d HTTP/1.1
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Host: rest.interfax.net
Range: bytes=0-42680
Content-Length: 42681
cURL
Copy
curl "https://rest.interfax.net/outbound/documents/9ac5137ac9384d" ^
--data-binary "@fax_order.pdf" ^
-u username:password ^
-H "Range: bytes=0-42680"