Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated using 4PSA automated script
Excerpt

This method allows uses to send faxes in particular contexts such as User, Organization or global.

Table of Contents
maxLevel3
excludeApps Using This, Quick Examples, Need Help?

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:

Panel
borderStyle
borderColor#DADADA
bgColor#FFFFFF
borderWidth1
titleBGColor#F0F0F0
borderWidthborderStyle1dashed
titleModeldashed
HTTP-Method       = "POST"

              URI-Fragment      = "/uapi/faxes/" User-Id "/" Extension-Number 

              Query-Parameters 
            = null
Request-Payload   = Fax
Return-Object = Fax
Panel
borderColor#DADADA
bgColor#FFFFFF
borderWidth1
titleBGColor#F0F0F0
borderWidthborderStyle1dashed
titleExampleborderStyledashed
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.

Anchor
urifragment
urifragment

URI fragment

Anchor
URI-frg-userid
URI-frg-userid

NameTypeRequiredDescription

userId

  User-Id

Yes

Id of the User on behalf of whom the Fax is sent.
It can take one of the following values:
@me - refers to the authenticated User .
@viewer - also refers to the authenticated User.
@owner - refers to the User that owns the Extension used to make the phone call.
User-Id - refers to the unique identifier of the User
Default: @me

extension  UAPI-Extension-Number YesNumber 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 CodeDescription
200The fax is sent.
204There are no faxes to be sent.

Failure

When it fails, the request returns the following error codes:

HTTP CodeCodeDescription
400fx_recipients_invalid

Value supplied in the Recipients parameter is missing or invalid. Any phone number, including extension numbers can be a recipient.
There can't be more recipients than the maximum number set up in the system.

400fx_file_invalidOne of the files that must be sent as fax are invalid. Allowed file types are: jpg, tif, pdf and txt.
400fx_max_files_reachedFailed to send the fax because the number of files that can be sent was exceeded.
400internal_server_errorFailed 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

Anchor
example
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.

Code Block
titleHTTP Request
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:

Code Block
titleHTTP Response
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.