Request/Response model
Overview
Using this request, an App can send a fax. If successful, the Service returns the Id of the newly created Fax resource.
The request is made by an App that is registered to a User account.
To send a fax in a desired context, issue a HTTP POST request:
HTTP-Method = "POST"URI-Fragment
= "/uapi/faxes/" User-Id "/" Extension-NumberQuery-Parameters
= null Request-Payload = Fax
Return-Object = Fax
POST /uapi/faxes/@me/0003*210 HTTP/1.1
HOST uapi.voipnow.com
Authorization: token
Content-Length:469
Content-Type: multipart/form-data; boundary=------------325343636
------------325343636--------
Content-Disposition:form-data; name="files"; filename="/path/to/file/fax.txt"
Content-Type;application/octet-stream
This is my fax
------------325343636
Content-Disposition:form-data; name="request";
{
"recipients":["7778888"]
}
------------325343636
Request
This section describes how to format the request to the service.
URI fragment
Name | Type | Required | Description |
---|---|---|---|
userId | Yes | Id of the User on behalf of whom the Fax is sent. | |
extension | UAPI-Extension-Number | Yes | Number of the Extension sending the Fax. Cannot be set to @self. |
Response
Success
If successful, the request returns the Id of the newly created Fax resource and the following HTTP statuses:
HTTP Code | Description |
---|---|
200 | The fax is sent. |
204 | There are no faxes to be sent. |
Failure
When it fails, the request returns the following error codes:
HTTP Code | Code | Description |
---|---|---|
400 | fx_recipients_invalid | Value supplied in the Recipients parameter is missing or invalid. Any phone number, including extension numbers can be a recipient. |
400 | fx_file_invalid | One of the files that must be sent as fax are invalid. Allowed file types are: jpg, tif, pdf and txt. |
400 | fx_max_files_reached | Failed to send the fax because the number of files that can be sent was exceeded. |
400 | internal_server_error | Failed to send the fax due to an internal error. |
Response body
If any 4xx or 5xx status codes is returned, the body contains the error response. When the request is successful and 200 OK is returned, the body contains a JSON representation.
Example
Below you can find an example that will help you understand the request and the response.
This example sends a fax from Extension 0003*210 to 7778888. This fax does not need any other approval.
The request is transmitted as a multi-part message where the content of the fax is sent in the part names files. The part named request contains the resource properties and in this case identifies the recipients.
POST /uapi/faxes/@me/0003*210 HTTP/1.1 HOST uapi.voipnow.com Authorization: Bearer token Content-Length:469 Content-Type: multipart/form-data; boundary=------------325343636 ------------325343636-------- Content-Disposition:form-data; name="files"; filename="/path/to/file/fax.txt" Content-Type;application/octet-stream This is my fax ------------325343636 Content-Disposition:form-data; name="request"; { "recipients":["7778888"] } ------------325343636
Assuming the request has been successful, the Service returns the following answer:
HTTP/1.1 200 OK ... { "id":"1", "uid":"5d8e2193e92f2d5e31cff1017724cfe9" }
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.