Everything about Fax Sending
/uploads?convert=fax
File type | Required to be passed to uploads endpoint first? |
---|---|
No | |
docx | Yes |
doc | Yes |
rtf | Yes |
Send a fax using supplied supported file-types.
With this option, you can use an existing URL to a pdf
document. For example, you might generate the pdf
on your server.
When using an existing url make sure that it is publicly accessible as it will not work if it is private.
With this option, you can use the /uploads endpoint to upload the document. The /uploads
endpoint returns a URL that can be used in the /fax/send
endpoint.
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
file_url | string | true | none | URL of file to send |
source | string | true | none | Your method of sending e.g. 'wordpress', 'php', 'c#'. |
to | string | true | none | Recipient fax number in E.164 format. |
list_id | integer(int32) | false | none | Your list ID if sending to a whole list. Can be used instead of 'to'. |
from | string | true | yes | Your sender id. Must be a valid fax number. |
schedule | integer(int32) | false | none | Leave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp |
custom_string | string | false | none | Your reference. Will be passed back with all replies and delivery reports. |
country | string | false | none | ISO alpha-2 character country code e.g. 'US', we use this to format the recipient number if it's not in international format. |
from_email | string | false | none | An email address where the reply should be emailed to. |
Refer to Status Codes for definitions of HTTP status code responses.
Successful response
{- "file_url": "{{fileURL}}",
- "messages": [
- {
- "source": "php",
- "from": "+61411111111",
- "to": "+61411111111",
- "custom_string": "A custom string to fax"
}
]
}
{- "http_code": 200,
- "response_code": "SUCCESS",
- "response_msg": "Fax queued for delivery.",
- "data": {
- "total_price": 13.2,
- "total_count": 1,
- "queued_count": 1,
- "messages": [
- {
- "user_id": 1,
- "subaccount_id": 1,
- "list_id": null,
- "message_id": "6BBEB11E-CAA6-4B04-8537-63619F3D6B37",
- "to": "+61261111122",
- "from": "+61298441484",
- "carrier": "",
- "country": "AU",
- "custom_string": "custom_string",
- "schedule": "1436874701",
- "message_pages": 6,
- "message_price": "13.2000",
- "status_code": "201",
- "status_text": "Sent",
- "date_added": 1457504350,
- "from_email": "john@doe.com",
- "status": "SUCCESS"
}
], - "_currency": {
- "currency_name_short": "AUD",
- "currency_prefix_d": "$",
- "currency_prefix_c": "c",
- "currency_name_long": "Australian Dollars"
}
}
}
Calculate Total Price for Fax Messages sent
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
file_url | string | true | none | URL of file to send |
source | string | true | none | Your method of sending e.g. 'wordpress', 'php', 'c#'. |
to | string | true | none | Recipient fax number in E.164 format. |
list_id | integer(int32) | false | none | Your list ID if sending to a whole list. Can be used instead of 'to'. |
from | string | true | yes | Your sender id. Must be a valid fax number. |
schedule | integer(int32) | false | none | Leave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp |
custom_string | string | false | none | Your reference. Will be passed back with all replies and delivery reports. |
country | string | false | none | ISO alpha-2 character country code e.g. 'US', we use this to format the recipient number if it's not in international format. |
from_email | string | false | none | An email address where the reply should be emailed to. |
Refer to Status Codes for definitions of HTTP status code responses.
Successful response
{- "file_url": "{{fileURL}}",
- "messages": [
- {
- "source": "php",
- "from": "+61411111111",
- "to": "+61411111111",
- "from_email": "test@test.com",
- "schedule": "1436874701",
- "custom_string": "custom_string"
}
]
}
{- "http_code": 200,
- "response_code": "SUCCESS",
- "response_msg": "Here are some prices.",
- "data": {
- "total_price": 13.2,
- "total_count": 1,
- "queued_count": 1,
- "messages": [
- {
- "user_id": 1,
- "subaccount_id": 1,
- "list_id": null,
- "message_id": "6BBEB11E-CAA6-4B04-8537-63619F3D6B37",
- "to": "+61261111122",
- "from": "+61298441484",
- "carrier": "",
- "country": "AU",
- "custom_string": "custom_string",
- "schedule": "1436874701",
- "message_pages": 6,
- "message_price": "13.2000",
- "status_code": "201",
- "status_text": "Sent",
- "date_added": 1457504350,
- "from_email": "john@doe.com",
- "status": "SUCCESS"
}
], - "_currency": {
- "currency_name_short": "AUD",
- "currency_prefix_d": "$",
- "currency_prefix_c": "c",
- "currency_name_long": "Australian Dollars"
}
}
}
Get List of Fax Receipts
Push Delivery Receipts
If you prefer, we can push message replies to your server as they arrive with us.
The following variables will be posted to the URL specified:
Variable | Description |
---|---|
timestamp_send |
Timestamp of the original send request in UNIX format. e.g 1439173980 |
timestamp |
Timestamp of delivery report in UNIX format. e.g 1439173981 |
message_id |
Message ID, returned when originally sending the message. |
status |
Delivered or Undelivered |
status_code |
Status code. Refer to 'Fax Delivery Status Codes' in docs. |
status_text |
Status text. |
error_code |
Error code. |
error_text |
Error text. |
custom_string |
A custom string used when sending the original message. |
user_id |
The user ID of the user who sent the message. |
subaccount_id |
The subaccount ID of the user who sent the message. |
message_type |
'fax' (constant). |
Pull Delivery Receipts
Receive delivery reports by polling. You can poll our server and retrieve delivery reports at a time that suits you.
Refer to Status Codes for definitions of HTTP status code responses.
Successful response
curl --include \ --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \ 'https://rest.clicksend.com/v3/fax/receipts'
{- "http_code": 200,
- "response_code": "SUCCESS",
- "response_msg": "Here are your delivery receipts.",
- "data": {
- "total": 2,
- "per_page": 15,
- "current_page": 1,
- "last_page": 1,
- "next_page_url": null,
- "prev_page_url": null,
- "from": 1,
- "to": 2,
- "data": [
- {
- "timestamp_send": "1450854013",
- "timestamp": "1451200622",
- "message_id": "88AB118E-EB1B-478C-98CE-6C73ABA23F67",
- "status_code": "Completed",
- "status_text": "",
- "error_code": "",
- "error_text": "",
- "custom_string": "",
- "subaccount_id": 1,
- "message_type": "fax"
}
]
}
}
Get a single fax receipt based on message id.
Parameter | In | Type | Required | Description |
---|---|---|---|---|
message_id | path | string | true | ID of the message receipt to retrieve |
Refer to Status Codes for definitions of HTTP status code responses.
Successful response
curl --include \ --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \ 'https://rest.clicksend.com/v3/fax/receipts/{message_id}'
{- "http_code": 200,
- "response_code": "SUCCESS",
- "response_msg": "Here is your fax receipt.",
- "data": {
- "user_id": 1,
- "subaccount_id": 1,
- "list_id": null,
- "message_id": "6BBEB11E-CAA6-4B04-8537-63619F3D6B37",
- "to": "+61261111122",
- "from": "+61298441484",
- "carrier": "",
- "country": "AU",
- "custom_string": "custom_string",
- "schedule": "1436874701",
- "message_pages": 6,
- "message_price": "13.2000",
- "status_code": "201",
- "status_text": "Sent",
- "date_added": 1457504350,
- "from_email": "john@doe.com",
- "status": "SUCCESS"
}
}
Get a list of Fax History.
Parameter | In | Type | Required | Description |
---|---|---|---|---|
date_from | query | integer(int32) | false | Start date (Unix Timestamp e.g. 1436849372) |
date_to | query | integer(int32) | false | End date (Unix Timestamp e.g. 1436879372) |
q | query | string | false | Custom query Example: status:Sent,status_code:201. |
order | query | string | false | Order result by Example: date_added:desc,list_id:desc. |
page | query | integer(int32) | false | Page number |
limit | query | integer(int32) | false | Number of records per page |
Refer to Status Codes for definitions of HTTP status code responses.
This endpoint requires authentication, more info...
Refer to Status Codes for definitions of HTTP status code responses.
Successful response
curl --include \ --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==" \ 'https://rest.clicksend.com/v3/fax/
{- "http_code": 200,
- "response_code": "SUCCESS",
- "response_msg": "Here is your history.",
- "data": {
- "total": 2,
- "per_page": 15,
- "current_page": 1,
- "last_page": 1,
- "next_page_url": null,
- "prev_page_url": null,
- "from": 1,
- "to": 2,
- "data": [
- {
- "user_id": 1,
- "subaccount_id": 1,
- "list_id": null,
- "message_id": "6BBEB11E-CAA6-4B04-8537-63619F3D6B37",
- "to": "+61261111122",
- "from": "+61298441484",
- "carrier": "",
- "country": "AU",
- "custom_string": "custom_string",
- "schedule": "1436874701",
- "message_pages": 6,
- "message_price": "13.2000",
- "status_code": "201",
- "status_text": "Sent",
- "date_added": 1457504350,
- "from_email": "john@doe.com",
- "status": "SUCCESS"
}
]
}
}