Check out our upcoming events and meetups! View events →
List all documents ordered by created_at descending.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const docServiceDocument of client.documents.list()) {
console.log(docServiceDocument.id);
}{
"data": [
{
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "document",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"content_type": "application/pdf",
"size": {
"unit": "bytes",
"amount": 123456
},
"status": "pending",
"sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
"filename": "test-document.pdf",
"customer_reference": "MY REF 001",
"av_scan_status": "scanned"
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Consolidated filter parameter for documents (deepObject style). Originally: filter[filename][contains], filter[customer_reference][eq], filter[customer_reference][in][], filter[created_at][gt], filter[created_at][lt]
Show child attributes
{
"filename": { "contains": "invoice" },
"customer_reference": { "in": ["REF001", "REF002"] },
"created_at": { "gt": "2021-01-01T00:00:00Z" }
}Consolidated sort parameter for documents (deepObject style). Originally: sort[]
Specifies the sort order for results. If you want to sort by a field in ascending order, include it as a sort parameter. If you want to sort in descending order, prepend a - in front of the field name.
filename, created_at, updated_at, -filename, -created_at, -updated_at ["filename"]Consolidated page parameter (deepObject style). Originally: page[size], page[number]
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const docServiceDocument of client.documents.list()) {
console.log(docServiceDocument.id);
}{
"data": [
{
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "document",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"content_type": "application/pdf",
"size": {
"unit": "bytes",
"amount": 123456
},
"status": "pending",
"sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
"filename": "test-document.pdf",
"customer_reference": "MY REF 001",
"av_scan_status": "scanned"
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}