const telnyx = require('telnyx')('YOUR_API_KEY'); const { data: faxes } = await telnyx.faxes.list();
{- "data": [
- {
- "connection_id": "c-1",
- "created_at": "2020-05-05T09:59:12",
- "direction": "outbound",
- "from": "+123",
- "id": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
- "quality": "high",
- "record_type": "fax",
- "status": "queued",
- "store_media": true,
- "to": "+456",
- "updated_at": "2020-05-05T09:59:12",
- "webhook_failover_url": "",
}
], - "meta": {
- "page_number": 2,
- "page_size": 1,
- "total_pages": 3,
- "total_results": 3
}
}
Send a fax. Files have size limits and page count limit validations. If a file is bigger than 50MB or has more than 350 pages it will fail with file_size_limit_exceeded
and page_count_limit_exceeded
respectively.
Expected Webhooks:
fax.queued
fax.media.processed
fax.sending.started
fax.delivered
fax.failed
Send fax request
Send fax response
{- "connection_id": "234423",
- "from": "+13125790015",
- "media_name": "my_media_uploaded_to_media_storage_api",
- "monochrome": false,
- "quality": "high",
- "store_media": false,
- "t38_enabled": true,
- "to": "+13127367276",
}
{- "data": {
- "connection_id": "c-1",
- "created_at": "2020-05-05T09:59:12",
- "direction": "outbound",
- "from": "+123",
- "id": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
- "quality": "high",
- "record_type": "fax",
- "status": "queued",
- "store_media": true,
- "to": "+456",
- "updated_at": "2020-05-05T09:59:12",
- "webhook_failover_url": "",
}
}
{- "data": {
- "event_type": "fax.delivered",
- "id": "95479a2e-b947-470a-a88f-2da6dd07ae0f",
- "occurred_at": "2020-05-05T13:08:22.039204Z",
- "payload": {
- "call_duration_secs": 25,
- "connection_id": "234423",
- "direction": "outbound",
- "fax_id": "f8338808-3dc6-4f2b-942a-5d1f39255784",
- "from": "+17733372107",
- "page_count": 2,
- "status": "delivered",
- "to": "+15107882622",
- "user_id": "19a75cea-02c6-4b9a-84fa-c9bc8341feb8"
}, - "record_type": "event"
}
}
const telnyx = require('telnyx')('YOUR_API_KEY'); const { data: fax } = await telnyx.faxes.retrieve("id"); fax.del();
{- "errors": [
- {
- "code": "string",
- "detail": "string",
- "meta": { },
- "source": {
- "parameter": "string",
- "pointer": "/json/pointer"
}, - "title": "string"
}
]
}
Get fax response
object (Fax) | |||||||||||||||||||||||||||||||||
|
const telnyx = require('telnyx')('YOUR_API_KEY'); const { data: fax } = await telnyx.faxes.retrieve("id");
{- "data": {
- "connection_id": "c-1",
- "created_at": "2020-05-05T09:59:12",
- "direction": "outbound",
- "from": "+123",
- "id": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
- "quality": "high",
- "record_type": "fax",
- "status": "queued",
- "store_media": true,
- "to": "+456",
- "updated_at": "2020-05-05T09:59:12",
- "webhook_failover_url": "",
}
}
Cancel the outbound fax that is in one of the following states: queued
, media.processed
, originated
or sending
Successful response upon accepting cancel fax command
Fax does not exist
Unprocessable entity
{- "data": {
- "result": "ok"
}
}