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.porting.events.list()) {
console.log(eventListResponse);
}{
"data": [
{
"id": "eef3340b-8903-4466-b445-89b697315a3a",
"event_type": "porting_order.deleted",
"porting_order_id": "9471c873-e3eb-4ca1-957d-f9a451334d52",
"available_notification_methods": [
"email"
],
"payload_status": "created",
"payload": {
"id": "96dfa9e4-c753-4fd3-97cd-42d66f26cf0c",
"customer_reference": "my-ref-001",
"deleted_at": "2021-03-19T10:07:15.527Z",
"record_type": "porting_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 porting 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.porting.events.list()) {
console.log(eventListResponse);
}{
"data": [
{
"id": "eef3340b-8903-4466-b445-89b697315a3a",
"event_type": "porting_order.deleted",
"porting_order_id": "9471c873-e3eb-4ca1-957d-f9a451334d52",
"available_notification_methods": [
"email"
],
"payload_status": "created",
"payload": {
"id": "96dfa9e4-c753-4fd3-97cd-42d66f26cf0c",
"customer_reference": "my-ref-001",
"deleted_at": "2021-03-19T10:07:15.527Z",
"record_type": "porting_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 filter parameter (deepObject style). Originally: filter[type], filter[porting_order_id], filter[created_at][gte], filter[created_at][lte]
Show child attributes
Filter by event type.
porting_order.deleted, porting_order.loa_updated, porting_order.messaging_changed, porting_order.status_changed, porting_order.sharing_token_expired, porting_order.new_comment, porting_order.split "porting_order.deleted"
Filter by porting order ID.
"34dc46a9-53ed-4e01-9454-26227ea13326"
Successful response
Show child attributes
Uniquely identifies the event.
"eef3340b-8903-4466-b445-89b697315a3a"
Identifies the event type
porting_order.deleted, porting_order.loa_updated, porting_order.messaging_changed, porting_order.status_changed, porting_order.sharing_token_expired, porting_order.new_comment, porting_order.split "porting_order.deleted"
Identifies the porting order associated with the event.
"9471c873-e3eb-4ca1-957d-f9a451334d52"
Indicates the notification methods used.
email, webhook, webhook_v1 The status of the payload generation.
created, completed "created"
Show child attributes
Identifies the porting order that was deleted.
"96dfa9e4-c753-4fd3-97cd-42d66f26cf0c"
Identifies the customer reference associated with the porting order.
"my-ref-001"
ISO 8601 formatted date indicating when the porting order was deleted.
"2021-03-19T10:07:15.527Z"
Identifies the type of the resource.
"porting_event"
ISO 8601 formatted date indicating when the resource was created.
"2021-03-19T10:07:15.527000Z"
ISO 8601 formatted date indicating when the resource was updated.
"2021-03-19T10:07:15.527000Z"
Was this page helpful?