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 eventListResponse of client.portouts.events.list()) {
console.log(eventListResponse);
}{
"data": [
{
"id": "eef3340b-8903-4466-b445-89b697315a3a",
"event_type": "portout.status_changed",
"portout_id": "9471c873-e3eb-4ca1-957d-f9a451334d52",
"available_notification_methods": [
"email"
],
"payload_status": "created",
"payload": {
"id": "96dfa9e4-c753-4fd3-97cd-42d66f26cf0c",
"status": "authorized",
"phone_numbers": [
"+35312345678"
],
"carrier_name": "Testing Carrier",
"spid": "987H",
"user_id": "96dfa9e4-c753-4fd3-97cd-42d66f26cf0c",
"subscriber_name": "John Doe",
"rejection_reason": null,
"attempted_pin": "1234"
},
"record_type": "portout_event",
"created_at": "2021-03-19T10:07:15.527000Z",
"updated_at": "2021-03-19T10:07:15.527000Z"
}
],
"meta": {
"total_pages": 3,
"page_number": 2,
"total_results": 55,
"page_size": 25
}
}Returns a list of all port-out events.
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 eventListResponse of client.portouts.events.list()) {
console.log(eventListResponse);
}{
"data": [
{
"id": "eef3340b-8903-4466-b445-89b697315a3a",
"event_type": "portout.status_changed",
"portout_id": "9471c873-e3eb-4ca1-957d-f9a451334d52",
"available_notification_methods": [
"email"
],
"payload_status": "created",
"payload": {
"id": "96dfa9e4-c753-4fd3-97cd-42d66f26cf0c",
"status": "authorized",
"phone_numbers": [
"+35312345678"
],
"carrier_name": "Testing Carrier",
"spid": "987H",
"user_id": "96dfa9e4-c753-4fd3-97cd-42d66f26cf0c",
"subscriber_name": "John Doe",
"rejection_reason": null,
"attempted_pin": "1234"
},
"record_type": "portout_event",
"created_at": "2021-03-19T10:07:15.527000Z",
"updated_at": "2021-03-19T10:07:15.527000Z"
}
],
"meta": {
"total_pages": 3,
"page_number": 2,
"total_results": 55,
"page_size": 25
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Consolidated page parameter (deepObject style). Originally: page[number], page[size]
Show child attributes
Consolidated filter parameter (deepObject style). Originally: filter[event_type], filter[portout_id], filter[created_at]
Show child attributes
Was this page helpful?