import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const document = await client.documents.retrieve('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(document.data);{
"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"
}
}Retrieve a document.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const document = await client.documents.retrieve('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(document.data);{
"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"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Identifies the resource.
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Successful response
Show child attributes
Was this page helpful?