Skip to main content
GET
/
texml
/
Accounts
/
{account_sid}
/
Calls
/
{call_sid}
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const call = await client.texml.accounts.calls.retrieve('call_sid', { account_sid: 'account_sid' });

console.log(call.account_sid);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
call = client.texml.accounts.calls.retrieve(
call_sid="call_sid",
account_sid="account_sid",
)
print(call.account_sid)
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"),
)
call, err := client.Texml.Accounts.Calls.Get(
context.TODO(),
"call_sid",
telnyx.TexmlAccountCallGetParams{
AccountSid: "account_sid",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", call.AccountSid)
}
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.CallRetrieveParams;
import com.telnyx.sdk.models.texml.accounts.calls.CallRetrieveResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

CallRetrieveParams params = CallRetrieveParams.builder()
.accountSid("account_sid")
.callSid("call_sid")
.build();
CallRetrieveResponse call = client.texml().accounts().calls().retrieve(params);
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

call = telnyx.texml.accounts.calls.retrieve("call_sid", account_sid: "account_sid")

puts(call)
<?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 {
$call = $client->texml->accounts->calls->retrieve(
'call_sid', accountSid: 'account_sid'
);

var_dump($call);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx texml:accounts:calls retrieve \
--api-key 'My API Key' \
--account-sid account_sid \
--call-sid call_sid
curl --request GET \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Calls/{call_sid} \
--header 'Authorization: Bearer <token>'
{
  "account_sid": "61bf923e-5e4d-4595-a110-56190ea18a1b",
  "answered_by": "human",
  "caller_name": "+13122010094",
  "date_created": "Thu, 15 Jun 2023 09:56:45 +0000",
  "date_updated": "Thu, 15 Jun 2023 09:56:56 +0000",
  "direction": "inbound",
  "duration": "11",
  "end_time": "Thu, 15 Jun 2023 09:56:56 +0000",
  "from": "+13123456789",
  "from_formatted": "(312) 345-6789",
  "sid": "v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA",
  "start_time": "Thu, 15 Jun 2023 09:56:45 +0000",
  "status": "completed",
  "to": "+13987654321",
  "to_formatted": "(398) 765-4321",
  "uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA.json"
}
{
"errors": [
{
"detail": "Resource not found"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

call_sid
string
required

The CallSid that identifies the call to update.

account_sid
string
required

The id of the account the resource belongs to.

Response

Call resource.

account_sid
string

The id of the account the resource belongs to.

Example:

"61bf923e-5e4d-4595-a110-56190ea18a1b"

answered_by
enum<string>

The value of the answering machine detection result, if this feature was enabled for the call.

Available options:
human,
machine,
not_sure
Example:

"human"

caller_name
string

Caller ID, if present.

Example:

"CALLER"

date_created
string

The timestamp of when the resource was created.

Example:

"Thu, 15 Jun 2023 09:56:45 +0000"

date_updated
string

The timestamp of when the resource was last updated.

Example:

"Thu, 15 Jun 2023 09:56:45 +0000"

direction
enum<string>

The direction of this call.

Available options:
inbound,
outbound
Example:

"inbound"

duration
string

The duration of this call, given in seconds.

Example:

"12"

end_time
string

The end time of this call.

Example:

"Thu, 15 Jun 2023 09:56:45 +0000"

from
string

The phone number or SIP address that made this call.

Example:

"+13123456789"

from_formatted
string

The from number formatted for display.

Example:

"(312) 345-6789"

price
string

The price of this call, the currency is specified in the price_unit field. Only populated when the call cost feature is enabled for the account.

Example:

"0.10"

price_unit
string

The unit in which the price is given.

Example:

"USD"

sid
string

The identifier of this call.

Example:

"v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA"

start_time
string

The start time of this call.

Example:

"Thu, 15 Jun 2023 09:56:45 +0000"

status
enum<string>

The status of this call.

Available options:
ringing,
in-progress,
canceled,
completed,
failed,
busy,
no-answer
Example:

"completed"

to
string

The phone number or SIP address that received this call.

Example:

"+13987654321"

to_formatted
string

The to number formatted for display.

Example:

"(398) 765-4321"

uri
string

The relative URI for this call.

Example:

"/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA.json"