Create a document upload
Create a document upload session.
Copy
POST /outbound/documents?size={number}&name={string}[&disposition={singleUse|multiUse|permanent} &sharing={private|shared}]
Arguments
| Name | Type | Mandatory | Comments | Default |
|---|---|---|---|---|
| size | Number |
|
Size of the document to be uploaded (in bytes) | None, mandatory |
| name | String |
|
The document file name, which can subsequently be queried with the Get fax list operation. The filename must end with an extension defining the file type, e.g. dailyrates.docx or newsletter.pdf, and the file type must be in the list of Supported file types. | None, mandatory |
| disposition | String | This sets the retention policy of the uploaded document, that is, how long it can be used by the Send fax operation: SingleUse= can be used once, MultiUse = deleted 60 minutes after the last usage , or Permanent = remains available until removed. | SingleUse | |
| sharing | String | Private or Shared. | private |
Response
If successful, the HTTP Location header contains the fully-qualifed URI of the newly-created fax resource, e.g. Location: https://rest.interfax.net/outbound/documents/8547z59r65q2.
Response codes
| Response Code | Meaning |
|---|---|
| 415 UNSUPPORTED MEDIA TYPE | The file type you’re trying to upload isn’t supported. See Supported file types. |
| 413 REQUEST ENTITY TOO LARGE | The file size is too large. See System limitations. |
Sample calls
Raw HTTP
Copy
POST /outbound/documents?size=42681&name=dailyrates.pdf HTTP/1.1
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Host: https://rest.interfax.net
Location: https://rest.interfax.net/outbound/documents/e3a612042bd1445dae41d62451b1bab1
cURL
Copy
curl "https://rest.interfax.net/outbound/documents?size=82318&name=sampledoc.pdf&sharing=shared" ^
-X POST ^
-H content-length:0 ^
-u username:password