Fetch multiple call resources
Returns multiple call resouces for an account. This endpoint is eventually consistent.
GET
/
texml
/
Accounts
/
{account_sid}
/
Calls
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.texml.accounts.calls.retrieveCalls('account_sid');
console.log(response.calls);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.texml.accounts.calls.retrieve_calls(
account_sid="account_sid",
)
print(response.calls)
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"),
)
response, err := client.Texml.Accounts.Calls.GetCalls(
context.TODO(),
"account_sid",
telnyx.TexmlAccountCallGetCallsParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Calls)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.texml.accounts.calls.CallRetrieveCallsParams;
import com.telnyx.sdk.models.texml.accounts.calls.CallRetrieveCallsResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallRetrieveCallsResponse response = client.texml().accounts().calls().retrieveCalls("account_sid");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.retrieve_calls("account_sid")
puts(response)<?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 {
$response = $client->texml->accounts->calls->retrieveCalls(
'account_sid',
endTime: 'EndTime',
endTimeGt: 'EndTime_gt',
endTimeLt: 'EndTime_lt',
from: 'From',
page: 0,
pageSize: 0,
pageToken: 'PageToken',
startTime: 'StartTime',
startTimeGt: 'StartTime_gt',
startTimeLt: 'StartTime_lt',
status: 'canceled',
to: 'To',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx texml:accounts:calls retrieve-calls \
--api-key 'My API Key' \
--account-sid account_sidcurl --request GET \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Calls \
--header 'Authorization: Bearer <token>'{
"calls": [],
"end": 0,
"first_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1",
"next_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=1&PageSize=1&PageToken=MTY4AjgyNDkwNzIxMQ",
"page": 0,
"page_size": 1,
"start": 0,
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1"
}{
"errors": [
{
"detail": "Resource not found"
}
]
}Authorizations
Path Parameters
The UUID of the Telnyx account that owns the resource, for example f5586561-8ff0-4291-a51b-c7dfe4139ff9. The account_sid path segment is kept for Twilio API compatibility, but the value is a Telnyx account UUID, not a Twilio AC... SID. It must match the account that owns the API key used to authenticate the request, otherwise the endpoint returns 404. The same value is sent as AccountSid in TeXML webhooks.
Example:
"f5586561-8ff0-4291-a51b-c7dfe4139ff9"
Query Parameters
Response
Multiple call resources.
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.texml.accounts.calls.retrieveCalls('account_sid');
console.log(response.calls);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.texml.accounts.calls.retrieve_calls(
account_sid="account_sid",
)
print(response.calls)
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"),
)
response, err := client.Texml.Accounts.Calls.GetCalls(
context.TODO(),
"account_sid",
telnyx.TexmlAccountCallGetCallsParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Calls)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.texml.accounts.calls.CallRetrieveCallsParams;
import com.telnyx.sdk.models.texml.accounts.calls.CallRetrieveCallsResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallRetrieveCallsResponse response = client.texml().accounts().calls().retrieveCalls("account_sid");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.retrieve_calls("account_sid")
puts(response)<?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 {
$response = $client->texml->accounts->calls->retrieveCalls(
'account_sid',
endTime: 'EndTime',
endTimeGt: 'EndTime_gt',
endTimeLt: 'EndTime_lt',
from: 'From',
page: 0,
pageSize: 0,
pageToken: 'PageToken',
startTime: 'StartTime',
startTimeGt: 'StartTime_gt',
startTimeLt: 'StartTime_lt',
status: 'canceled',
to: 'To',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx texml:accounts:calls retrieve-calls \
--api-key 'My API Key' \
--account-sid account_sidcurl --request GET \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Calls \
--header 'Authorization: Bearer <token>'{
"calls": [],
"end": 0,
"first_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1",
"next_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=1&PageSize=1&PageToken=MTY4AjgyNDkwNzIxMQ",
"page": 0,
"page_size": 1,
"start": 0,
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1"
}{
"errors": [
{
"detail": "Resource not found"
}
]
}