List faxes in date range

Method

GET

Path

faxes

Request Parameters

Name Type Description
created_before RFC 3339 Timestamp The end of the range. Must be in RFC 3339 format, except that the timezone may be obmitted (e.g. '`2016-05-31T23:59:59`'). Defaults to now.
created_after RFC 3339 Timestamp The beginning of the range. Must be in RFC 3339 format, except that the timezone may be obmitted (e.g. '`2016-05-01T00:00:00`'). Defaults to one week ago.
direction string Either '`sent`' or '`received`'. Limits results to faxes with the specified direction.
status string Limits results to faxes with the specified status.
phone_number Phone Number A phone number in E.164 format that you want to use to filter results. The phone number must be an exact match, not a number fragment.
tag[TAG_NAME] string A tag name and value that you want to use to filter results. (e.g. You could pass a parameter called `tag[userId]` with value `123` to retrieve faxes for a user in your application that has ID 123.)

This operation also accepts paging parameters.

Response

A JSON object with success, message, data, and paging attributes. Results are paginated and the paging attribute holds information about the length of the data for your query. The data attribute holds an array of Fax objects in descending order of creation time.

Sample Call

curl -G -u 'API_KEY:API_SECRET' https://api.phaxio.com/v2/faxes \
    -d 'created_before=2016-02-01T00:00:00' \
    -d 'created_after=2016-01-01T00:00:00' \
    -d 'status=success'

Sample Response

{
    "success":true,
    "message":"Retrieved faxes successfully",
    "data":[
        {
            "id":123456,
            "direction":"sent",
            "num_pages":1,
            "status":"success",
            "is_test":false,
            "created_at":"2016-01-20T11:28:02.000-06:00",
            "from_number":null,
            "completed_at":"2016-01-20T11:28:54.000-06:00",
            "cost":7,
            "tags":{
                "order_id":"1234"
            },
            "recipients":[
                {
                    "phone_number":"+14141234567",
                    "status":"success",
                    "retry_count":0,
                    "completed_at":"2016-01-20T11:28:52.000-06:00",
                    "bitrate":14400,
                    "resolution":8040,
                    "error_type":null,
                    "error_id":null,
                    "error_message":null
                }
            ],
            "to_number":null,
            "error_id":null,
            "error_type":null,
            "error_message":null
        },
        {
            "id":123455,
            "direction":"sent",
            "num_pages":1,
            "status":"success",
            "is_test":false,
            "created_at":"2016-01-20T11:24:07.000-06:00",
            "from_number":null,
            "completed_at":"2016-01-20T11:25:24.000-06:00",
            "cost":7,
            "tags":{
                "order_id":"1233"
            },
            "recipients":[
                {
                    "phone_number":"+14141234567",
                    "status":"success",
                    "retry_count":0,
                    "completed_at":"2016-01-20T11:25:24.000-06:00",
                    "bitrate":14400,
                    "resolution":8040,
                    "error_type":null,
                    "error_id":null,
                    "error_message":null
                }
            ],
            "to_number":null,
            "error_id":null,
            "error_type":null,
            "error_message":null
        },
        {
            "id":123454,
            "direction":"sent",
            "num_pages":1,
            "status":"success",
            "is_test":false,
            "created_at":"2016-01-10T14:07:30.000-06:00",
            "from_number":null,
            "completed_at":"2016-01-10T14:09:03.000-06:00",
            "cost":14,
            "tags":{},
            "recipients":[
                {
                    "phone_number":"+14141234567",
                    "status":"success",
                    "retry_count":0,
                    "completed_at":"2016-01-10T14:08:45.000-06:00",
                    "bitrate":14400,
                    "resolution":8040,
                    "error_type":null,
                    "error_id":null,
                    "error_message":null
                },
                {
                    "phone_number":"+14141234568",
                    "status":"success",
                    "retry_count":0,
                    "completed_at":"2016-01-10T14:09:01.000-06:00",
                    "bitrate":9600,
                    "resolution":8040,
                    "error_type":null,
                    "error_id":null,
                    "error_message":null
                }
            ],
            "to_number":null,
            "error_id":null,
            "error_type":null,
            "error_message":null
        }
    ],
    "paging":{
        "total":3,
        "per_page":25,
        "page":1
    }
}