Update call
Update TeXML call. Please note that the keys present in the payload MUST BE formatted in CamelCase as specified in the example.
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.update('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.update(
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.Update(
context.TODO(),
"call_sid",
telnyx.TexmlAccountCallUpdateParams{
AccountSid: "account_sid",
UpdateCall: telnyx.UpdateCallParam{},
},
)
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.CallUpdateParams;
import com.telnyx.sdk.models.texml.accounts.calls.CallUpdateResponse;
import com.telnyx.sdk.models.texml.accounts.calls.UpdateCall;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallUpdateParams params = CallUpdateParams.builder()
.accountSid("account_sid")
.callSid("call_sid")
.updateCall(UpdateCall.builder().build())
.build();
CallUpdateResponse call = client.texml().accounts().calls().update(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
call = telnyx.texml.accounts.calls.update("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->update(
'call_sid',
accountSid: 'account_sid',
fallbackMethod: 'GET',
fallbackURL: 'https://www.example.com/intruction-c.xml',
method: 'GET',
status: 'completed',
statusCallback: 'https://www.example.com/callback',
statusCallbackMethod: 'GET',
texml: '<?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello</Say></Response>',
url: 'https://www.example.com/intruction-b.xml',
);
var_dump($call);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx texml:accounts:calls update \
--api-key 'My API Key' \
--account-sid account_sid \
--call-sid call_sidcurl --request POST \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Calls/{call_sid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data Status=completed{
"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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The CallSid that identifies the call to update.
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.
"f5586561-8ff0-4291-a51b-c7dfe4139ff9"
Body
Update Call request object
The value to set the call status to. Setting the status to completed ends the call.
"completed"
The URL where TeXML will make a request to retrieve a new set of TeXML instructions to continue the call flow.
"https://www.example.com/intruction-b.xml"
HTTP request type used for Url.
GET, POST "GET"
A failover URL for which Telnyx will retrieve the TeXML call instructions if the Url is not responding.
"https://www.example.com/intruction-c.xml"
HTTP request type used for FallbackUrl.
GET, POST "GET"
URL destination for Telnyx to send status callback events to for the call.
"https://www.example.com/callback"
HTTP request type used for StatusCallback.
GET, POST "GET"
TeXML to replace the current one with.
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Say>Hello</Say></Response>"
Response
Call resource.
The id of the account the resource belongs to.
"61bf923e-5e4d-4595-a110-56190ea18a1b"
The value of the answering machine detection result, if this feature was enabled for the call.
human, machine, not_sure "human"
Caller ID, if present.
"CALLER"
The timestamp of when the resource was created.
"Thu, 15 Jun 2023 09:56:45 +0000"
The timestamp of when the resource was last updated.
"Thu, 15 Jun 2023 09:56:45 +0000"
The direction of this call.
inbound, outbound "inbound"
The duration of this call, given in seconds.
"12"
The end time of this call.
"Thu, 15 Jun 2023 09:56:45 +0000"
The phone number or SIP address that made this call.
"+13123456789"
The from number formatted for display.
"(312) 345-6789"
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.
"0.10"
The unit in which the price is given.
"USD"
The identifier of this call.
"v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA"
The start time of this call.
"Thu, 15 Jun 2023 09:56:45 +0000"
The status of this call.
ringing, in-progress, canceled, completed, failed, busy, no-answer "completed"
The phone number or SIP address that received this call.
"+13987654321"
The to number formatted for display.
"(398) 765-4321"
The relative URI for this call.
"/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA.json"
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
});
const call = await client.texml.accounts.calls.update('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.update(
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.Update(
context.TODO(),
"call_sid",
telnyx.TexmlAccountCallUpdateParams{
AccountSid: "account_sid",
UpdateCall: telnyx.UpdateCallParam{},
},
)
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.CallUpdateParams;
import com.telnyx.sdk.models.texml.accounts.calls.CallUpdateResponse;
import com.telnyx.sdk.models.texml.accounts.calls.UpdateCall;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallUpdateParams params = CallUpdateParams.builder()
.accountSid("account_sid")
.callSid("call_sid")
.updateCall(UpdateCall.builder().build())
.build();
CallUpdateResponse call = client.texml().accounts().calls().update(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
call = telnyx.texml.accounts.calls.update("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->update(
'call_sid',
accountSid: 'account_sid',
fallbackMethod: 'GET',
fallbackURL: 'https://www.example.com/intruction-c.xml',
method: 'GET',
status: 'completed',
statusCallback: 'https://www.example.com/callback',
statusCallbackMethod: 'GET',
texml: '<?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello</Say></Response>',
url: 'https://www.example.com/intruction-b.xml',
);
var_dump($call);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx texml:accounts:calls update \
--api-key 'My API Key' \
--account-sid account_sid \
--call-sid call_sidcurl --request POST \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Calls/{call_sid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data Status=completed{
"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"
}