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 room of client.rooms.list()) {
console.log(room.id);
}{
"data": [
{
"id": "7b61621f-62e0-4aad-ab11-9fd19e272e73",
"max_participants": 50,
"unique_name": "My Room",
"created_at": "2021-04-16T09:46:20.954863Z",
"updated_at": "2021-04-16T10:24:55.962200Z",
"active_session_id": "7b61621f-62e0-4aad-ab11-9fd19e272e74",
"enable_recording": true,
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"webhook_event_url": "https://www.example.com",
"sessions": [
{
"id": "7b61621f-62e0-4aad-ab11-9fd19e272e74",
"room_id": "7b61621f-62e0-4aad-ab11-9fd19e272e73",
"active": true,
"created_at": "2021-04-16T09:46:20.954863Z",
"updated_at": "2021-04-16T10:24:55.962200Z",
"participants": [],
"record_type": "room_session"
}
],
"record_type": "room"
}
],
"meta": {
"total_pages": 3,
"page_number": 2,
"total_results": 55,
"page_size": 25
}
}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 room of client.rooms.list()) {
console.log(room.id);
}{
"data": [
{
"id": "7b61621f-62e0-4aad-ab11-9fd19e272e73",
"max_participants": 50,
"unique_name": "My Room",
"created_at": "2021-04-16T09:46:20.954863Z",
"updated_at": "2021-04-16T10:24:55.962200Z",
"active_session_id": "7b61621f-62e0-4aad-ab11-9fd19e272e74",
"enable_recording": true,
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"webhook_event_url": "https://www.example.com",
"sessions": [
{
"id": "7b61621f-62e0-4aad-ab11-9fd19e272e74",
"room_id": "7b61621f-62e0-4aad-ab11-9fd19e272e73",
"active": true,
"created_at": "2021-04-16T09:46:20.954863Z",
"updated_at": "2021-04-16T10:24:55.962200Z",
"participants": [],
"record_type": "room_session"
}
],
"record_type": "room"
}
],
"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.
To decide if room sessions should be included in the response.
true
Consolidated filter parameter (deepObject style). Originally: filter[date_created_at][eq], filter[date_created_at][gte], filter[date_created_at][lte], filter[date_updated_at][eq], filter[date_updated_at][gte], filter[date_updated_at][lte], filter[unique_name]
Show child attributes
Show child attributes
ISO 8601 date for filtering rooms created on that date.
"2021-04-25"
ISO 8601 date for filtering rooms created on or after that date.
"2021-04-25"
ISO 8601 date for filtering rooms created on or before that date.
"2021-04-25"
Show child attributes
ISO 8601 date for filtering rooms updated on that date.
"2021-04-25"
ISO 8601 date for filtering rooms updated on or after that date.
"2021-04-25"
ISO 8601 date for filtering rooms updated on or before that date.
"2021-04-25"
Unique_name for filtering rooms.
"my_video_room"
List rooms response.
Show child attributes
A unique identifier for the room.
"0ccc7b54-4df3-4bca-a65a-3da1ecc777f0"
Maximum participants allowed in the room.
50
The unique (within the Telnyx account scope) name of the room.
"My room"
ISO 8601 timestamp when the room was created.
"2021-03-26T17:51:59.588408Z"
ISO 8601 timestamp when the room was updated.
"2021-03-26T17:51:59.588408Z"
The identifier of the active room session if any.
"0ccc7b54-4df3-4bca-a65a-3da1ecc777f0"
Show child attributes
A unique identifier for the room session.
"0ccc7b54-4df3-4bca-a65a-3da1ecc777f0"
Identify the room hosting that room session.
"0ccc7b54-4df3-4bca-a65a-3da1ecc777b0"
Shows if the room session is active or not.
false
ISO 8601 timestamp when the room session was created.
"2021-03-26T17:51:59.588408Z"
ISO 8601 timestamp when the room session was updated.
"2021-03-26T17:51:59.588408Z"
ISO 8601 timestamp when the room session has ended.
"2021-03-26T17:51:59.588408Z"
Show child attributes
A unique identifier for the room participant.
"0ccc7b54-4df3-4bca-a65a-3da1ecc777f0"
Identify the room session that participant is part of.
"0ccc7b54-4df3-4bca-a65a-3da1ecc777b0"
Context provided to the given participant through the client SDK
"Alice"
ISO 8601 timestamp when the participant joined the session.
"2021-03-26T17:51:59.588408Z"
ISO 8601 timestamp when the participant was updated.
"2021-03-26T17:51:59.588408Z"
ISO 8601 timestamp when the participant left the session.
"2021-03-26T17:51:59.588408Z"
"room_participant"
"room_session"
Enable or disable recording for that room.
true
The URL where webhooks related to this room will be sent. Must include a scheme, such as 'https'.
"https://example.com"
The failover URL where webhooks related to this room will be sent if sending to the primary URL fails. Must include a scheme, such as 'https'.
"https://failover.example.com"
Specifies how many seconds to wait before timing out a webhook.
0 <= x <= 3025
"room"
Was this page helpful?