List call events
Filters call events by given filter parameters. Events are ordered by occurred_at. If filter for leg_id or application_session_id is not present, it only filters events from the last 24 hours.
Note: Only one filter[occurred_at] can be passed.
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 callEventListResponse of client.callEvents.list()) {
console.log(callEventListResponse.call_leg_id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.call_events.list()
page = page.data[0]
print(page.call_leg_id)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.CallEvents.List(context.TODO(), telnyx.CallEventListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.callevents.CallEventListPage;
import com.telnyx.sdk.models.callevents.CallEventListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallEventListPage page = client.callEvents().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.call_events.list
puts(page)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$page = $client->callEvents->list(
filter: [
'applicationName' => ['contains' => 'contains'],
'applicationSessionID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
'connectionID' => 'connection_id',
'failed' => false,
'from' => '+12025550142',
'legID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
'name' => 'name',
'occurredAt' => [
'eq' => '2019-03-29T11:10:00Z',
'gt' => '2019-03-29T11:10:00Z',
'gte' => '2019-03-29T11:10:00Z',
'lt' => '2019-03-29T11:10:00Z',
'lte' => '2019-03-29T11:10:00Z',
],
'outboundOutboundVoiceProfileID' => '1293384261075731499',
'product' => 'texml',
'status' => 'init',
'to' => '+12025550142',
'type' => 'webhook',
],
pageNumber: 0,
pageSize: 0,
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx call-events list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/call_events \
--header 'Authorization: Bearer <token>'{
"data": [
{
"record_type": "call_event",
"call_leg_id": "308fe500-5213-11e9-ace7-02420a0f0668",
"call_session_id": "308fec30-5213-11e9-9d3f-02420a0f0668",
"event_timestamp": "2019-03-29T11:10:19.127783Z",
"name": "call.hangup",
"type": "webhook",
"metadata": {}
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Consolidated filter parameter (deepObject style). Originally: filter[application_name][contains], filter[outbound.outbound_voice_profile_id], filter[leg_id], filter[application_session_id], filter[connection_id], filter[product], filter[failed], filter[from], filter[to], filter[name], filter[type], filter[occurred_at][eq/gt/gte/lt/lte], filter[status]
Show child attributes
Show child attributes
Consolidated page parameter (deepObject style). Originally: page[after], page[before], page[limit], page[size], page[number]
Show child attributes
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 callEventListResponse of client.callEvents.list()) {
console.log(callEventListResponse.call_leg_id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.call_events.list()
page = page.data[0]
print(page.call_leg_id)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.CallEvents.List(context.TODO(), telnyx.CallEventListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.callevents.CallEventListPage;
import com.telnyx.sdk.models.callevents.CallEventListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallEventListPage page = client.callEvents().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.call_events.list
puts(page)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$page = $client->callEvents->list(
filter: [
'applicationName' => ['contains' => 'contains'],
'applicationSessionID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
'connectionID' => 'connection_id',
'failed' => false,
'from' => '+12025550142',
'legID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
'name' => 'name',
'occurredAt' => [
'eq' => '2019-03-29T11:10:00Z',
'gt' => '2019-03-29T11:10:00Z',
'gte' => '2019-03-29T11:10:00Z',
'lt' => '2019-03-29T11:10:00Z',
'lte' => '2019-03-29T11:10:00Z',
],
'outboundOutboundVoiceProfileID' => '1293384261075731499',
'product' => 'texml',
'status' => 'init',
'to' => '+12025550142',
'type' => 'webhook',
],
pageNumber: 0,
pageSize: 0,
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx call-events list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/call_events \
--header 'Authorization: Bearer <token>'{
"data": [
{
"record_type": "call_event",
"call_leg_id": "308fe500-5213-11e9-ace7-02420a0f0668",
"call_session_id": "308fec30-5213-11e9-9d3f-02420a0f0668",
"event_timestamp": "2019-03-29T11:10:19.127783Z",
"name": "call.hangup",
"type": "webhook",
"metadata": {}
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}