Create
Create a document upload session.
Arguments
Name (bold if mandatory) | Type | 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 POST /outbound/faxes 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
Standard HTTP response codes apply.
Response Code | Meaning |
---|---|
415 UNSUPPORTED MEDIA TYPE | The file type you’re trying to upload isn’t in the list of supported file types. |
413 REQUEST ENTITY TOO LARGE | The file size is too large. See System Limitations. |
Sample Calls
Raw HTTP
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
Create shared PDF session
curl "https://rest.interfax.net/outbound/documents?size=82318&name=sampledoc.pdf&sharing=shared" ^
-X POST ^
-H content-length:0 ^
-u username:password