All URIs are relative to https://api.telnyx.com/v2
Method | HTTP request | Description |
---|---|---|
answerCall | POST /calls/{call_control_id}/actions/answer | Answer call |
bridgeCall | POST /calls/{call_control_id}/actions/bridge | Bridge calls |
callGatherUsingAI | POST /calls/{call_control_id}/actions/gather_using_ai | Gather using AI |
callStartAIAssistant | POST /calls/{call_control_id}/actions/ai_assistant_start | Start AI Assistant (BETA) |
callStopAIAssistant | POST /calls/{call_control_id}/actions/ai_assistant_stop | Stop AI Assistant (BETA) |
dialCall | POST /calls | Dial |
enqueueCall | POST /calls/{call_control_id}/actions/enqueue | Enqueue call |
gatherCall | POST /calls/{call_control_id}/actions/gather | Gather |
gatherUsingAudio | POST /calls/{call_control_id}/actions/gather_using_audio | Gather using audio |
gatherUsingSpeak | POST /calls/{call_control_id}/actions/gather_using_speak | Gather using speak |
hangupCall | POST /calls/{call_control_id}/actions/hangup | Hangup call |
leaveQueue | POST /calls/{call_control_id}/actions/leave_queue | Remove call from a queue |
noiseSuppressionStart | POST /calls/{call_control_id}/actions/suppression_start | Noise Suppression Start (BETA) |
noiseSuppressionStop | POST /calls/{call_control_id}/actions/suppression_stop | Noise Suppression Stop (BETA) |
pauseCallRecording | POST /calls/{call_control_id}/actions/record_pause | Record pause |
referCall | POST /calls/{call_control_id}/actions/refer | SIP Refer a call |
rejectCall | POST /calls/{call_control_id}/actions/reject | Reject a call |
resumeCallRecording | POST /calls/{call_control_id}/actions/record_resume | Record resume |
sendDTMF | POST /calls/{call_control_id}/actions/send_dtmf | Send DTMF |
sendSIPInfo | POST /calls/{call_control_id}/actions/send_sip_info | Send SIP info |
speakCall | POST /calls/{call_control_id}/actions/speak | Speak text |
startCallFork | POST /calls/{call_control_id}/actions/fork_start | Forking start |
startCallPlayback | POST /calls/{call_control_id}/actions/playback_start | Play audio URL |
startCallRecord | POST /calls/{call_control_id}/actions/record_start | Recording start |
startCallStreaming | POST /calls/{call_control_id}/actions/streaming_start | Streaming start |
startCallTranscription | POST /calls/{call_control_id}/actions/transcription_start | Transcription start |
startSiprecSession | POST /calls/{call_control_id}/actions/siprec_start | SIPREC start |
stopCallFork | POST /calls/{call_control_id}/actions/fork_stop | Forking stop |
stopCallGather | POST /calls/{call_control_id}/actions/gather_stop | Gather stop |
stopCallPlayback | POST /calls/{call_control_id}/actions/playback_stop | Stop audio playback |
stopCallRecording | POST /calls/{call_control_id}/actions/record_stop | Recording stop |
stopCallStreaming | POST /calls/{call_control_id}/actions/streaming_stop | Streaming stop |
stopCallTranscription | POST /calls/{call_control_id}/actions/transcription_stop | Transcription stop |
stopSiprecSession | POST /calls/{call_control_id}/actions/siprec_stop | SIPREC stop |
transferCall | POST /calls/{call_control_id}/actions/transfer | Transfer call |
updateClientState | PUT /calls/{call_control_id}/actions/client_state_update | Update client state |
CallControlCommandResponse answerCall(callControlId, answerRequest)
Answer call
Answer an incoming call. You must issue this command before executing subsequent commands on an incoming call.
Expected Webhooks (see callback schema below):
call.answered
streaming.started
,streaming.stopped
orstreaming.failed
ifstream_url
was set
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
AnswerRequest answerRequest = new AnswerRequest(); // AnswerRequest | Answer call request
try {
CallControlCommandResponse result = apiInstance.answerCall(callControlId, answerRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#answerCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
answerRequest | AnswerRequest | Answer call request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse bridgeCall(callControlId, bridgeRequest)
Bridge calls
Bridge two call control calls.
Expected Webhooks (see callback schema below):
call.bridged
for Leg Acall.bridged
for Leg B
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
BridgeRequest bridgeRequest = new BridgeRequest(); // BridgeRequest | Bridge call request
try {
CallControlCommandResponse result = apiInstance.bridgeCall(callControlId, bridgeRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#bridgeCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
bridgeRequest | BridgeRequest | Bridge call request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse callGatherUsingAI(callControlId, gatherUsingAIRequest)
Gather using AI
Gather parameters defined in the request payload using a voice assistant.
You can pass parameters described as a JSON Schema object and the voice assistant will attempt to gather these informations.
Expected Webhooks (see callback schema below):
call.ai_gather.ended
call.ai_gather.partial_results
(ifsend_partial_results
is set totrue
)call.ai_gather.tool_call
(ifassistant.tools
are configured)
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
GatherUsingAIRequest gatherUsingAIRequest = new GatherUsingAIRequest(); // GatherUsingAIRequest | Gather using AI request
try {
CallControlCommandResponse result = apiInstance.callGatherUsingAI(callControlId, gatherUsingAIRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#callGatherUsingAI");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
gatherUsingAIRequest | GatherUsingAIRequest | Gather using AI request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse callStartAIAssistant(callControlId, aiAssistantStartRequest)
Start AI Assistant (BETA)
BETA - Start an AI assistant on the call.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
AIAssistantStartRequest aiAssistantStartRequest = new AIAssistantStartRequest(); // AIAssistantStartRequest | AI Assistant request
try {
CallControlCommandResponse result = apiInstance.callStartAIAssistant(callControlId, aiAssistantStartRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#callStartAIAssistant");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
aiAssistantStartRequest | AIAssistantStartRequest | AI Assistant request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse callStopAIAssistant(callControlId, aiAssistantStopRequest)
Stop AI Assistant (BETA)
BETA - Stop an AI assistant on the call.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
AIAssistantStopRequest aiAssistantStopRequest = new AIAssistantStopRequest(); // AIAssistantStopRequest | AI Assistant request
try {
CallControlCommandResponse result = apiInstance.callStopAIAssistant(callControlId, aiAssistantStopRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#callStopAIAssistant");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
aiAssistantStopRequest | AIAssistantStopRequest | AI Assistant request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
RetrieveCallStatusResponse dialCall(callRequest)
Dial
Dial a number or SIP URI from a given connection. A successful response will include a call_leg_id
which can be used to correlate the command with subsequent webhooks.
Expected Webhooks (see schema below):
call.initiated
call.answered
orcall.hangup
call.machine.detection.ended
ifanswering_machine_detection
was requestedcall.machine.greeting.ended
ifanswering_machine_detection
was requested to detect the end of machine greetingcall.machine.premium.detection.ended
ifanswering_machine_detection=premium
was requestedcall.machine.premium.greeting.ended
ifanswering_machine_detection=premium
was requested and a beep was detectedstreaming.started
,streaming.stopped
orstreaming.failed
ifstream_url
was set
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
CallRequest callRequest = new CallRequest(); // CallRequest | Call request
try {
RetrieveCallStatusResponse result = apiInstance.dialCall(callRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#dialCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callRequest | CallRequest | Call request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response with details about a call status. | - |
0 | Unexpected error | - |
CallControlCommandResponse enqueueCall(callControlId, enqueueRequest)
Enqueue call
Put the call in a queue.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
EnqueueRequest enqueueRequest = new EnqueueRequest(); // EnqueueRequest | Enqueue call request
try {
CallControlCommandResponse result = apiInstance.enqueueCall(callControlId, enqueueRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#enqueueCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
enqueueRequest | EnqueueRequest | Enqueue call request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse gatherCall(callControlId, gatherRequest)
Gather
Gather DTMF signals to build interactive menus.
You can pass a list of valid digits. The Answer
command must be issued before the gather
command.
Expected Webhooks (see callback schema below):
call.dtmf.received
(you may receive many of these webhooks)call.gather.ended
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
GatherRequest gatherRequest = new GatherRequest(); // GatherRequest | Gather
try {
CallControlCommandResponse result = apiInstance.gatherCall(callControlId, gatherRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#gatherCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
gatherRequest | GatherRequest | Gather |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse gatherUsingAudio(callControlId, gatherUsingAudioRequest)
Gather using audio
Play an audio file on the call until the required DTMF signals are gathered to build interactive menus.
You can pass a list of valid digits along with an 'invalid_audio_url', which will be played back at the beginning of each prompt. Playback will be interrupted when a DTMF signal is received. The Answer command must be issued before the
gather_using_audio` command.
Expected Webhooks (see callback schema below):
call.playback.started
call.playback.ended
call.dtmf.received
(you may receive many of these webhooks)call.gather.ended
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
GatherUsingAudioRequest gatherUsingAudioRequest = new GatherUsingAudioRequest(); // GatherUsingAudioRequest | Gather using audio request
try {
CallControlCommandResponse result = apiInstance.gatherUsingAudio(callControlId, gatherUsingAudioRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#gatherUsingAudio");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
gatherUsingAudioRequest | GatherUsingAudioRequest | Gather using audio request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse gatherUsingSpeak(callControlId, gatherUsingSpeakRequest)
Gather using speak
Convert text to speech and play it on the call until the required DTMF signals are gathered to build interactive menus.
You can pass a list of valid digits along with an 'invalid_payload', which will be played back at the beginning of each prompt. Speech will be interrupted when a DTMF signal is received. The Answer
command must be issued before the gather_using_speak
command.
Expected Webhooks (see callback schema below):
call.dtmf.received
(you may receive many of these webhooks)call.gather.ended
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
GatherUsingSpeakRequest gatherUsingSpeakRequest = new GatherUsingSpeakRequest(); // GatherUsingSpeakRequest | Gather using speak request
try {
CallControlCommandResponse result = apiInstance.gatherUsingSpeak(callControlId, gatherUsingSpeakRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#gatherUsingSpeak");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
gatherUsingSpeakRequest | GatherUsingSpeakRequest | Gather using speak request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse hangupCall(callControlId, hangupRequest)
Hangup call
Hang up the call.
Expected Webhooks (see callback schema below):
call.hangup
call.recording.saved
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
HangupRequest hangupRequest = new HangupRequest(); // HangupRequest | Hangup request
try {
CallControlCommandResponse result = apiInstance.hangupCall(callControlId, hangupRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#hangupCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
hangupRequest | HangupRequest | Hangup request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse leaveQueue(callControlId, leaveQueueRequest)
Remove call from a queue
Removes the call from a queue.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
LeaveQueueRequest leaveQueueRequest = new LeaveQueueRequest(); // LeaveQueueRequest | Removes the call from the queue, the call currently is enqueued in.
try {
CallControlCommandResponse result = apiInstance.leaveQueue(callControlId, leaveQueueRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#leaveQueue");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
leaveQueueRequest | LeaveQueueRequest | Removes the call from the queue, the call currently is enqueued in. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse noiseSuppressionStart(callControlId, noiseSuppressionStart)
Noise Suppression Start (BETA)
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
NoiseSuppressionStart noiseSuppressionStart = new NoiseSuppressionStart(); // NoiseSuppressionStart | Start streaming media request
try {
CallControlCommandResponse result = apiInstance.noiseSuppressionStart(callControlId, noiseSuppressionStart);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#noiseSuppressionStart");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
noiseSuppressionStart | NoiseSuppressionStart | Start streaming media request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse noiseSuppressionStop(callControlId, noiseSuppressionStop)
Noise Suppression Stop (BETA)
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
NoiseSuppressionStop noiseSuppressionStop = new NoiseSuppressionStop(); // NoiseSuppressionStop | Start streaming media request
try {
CallControlCommandResponse result = apiInstance.noiseSuppressionStop(callControlId, noiseSuppressionStop);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#noiseSuppressionStop");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
noiseSuppressionStop | NoiseSuppressionStop | Start streaming media request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse pauseCallRecording(callControlId, pauseRecordingRequest)
Record pause
Pause recording the call. Recording can be resumed via Resume recording command.
Expected Webhooks:
There are no webhooks associated with this command.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
PauseRecordingRequest pauseRecordingRequest = new PauseRecordingRequest(); // PauseRecordingRequest | Pause recording call request
try {
CallControlCommandResponse result = apiInstance.pauseCallRecording(callControlId, pauseRecordingRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#pauseCallRecording");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
pauseRecordingRequest | PauseRecordingRequest | Pause recording call request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse referCall(callControlId, referRequest)
SIP Refer a call
Initiate a SIP Refer on a Call Control call. You can initiate a SIP Refer at any point in the duration of a call.
Expected Webhooks (see callback schema below):
call.refer.started
call.refer.completed
call.refer.failed
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
ReferRequest referRequest = new ReferRequest(); // ReferRequest | Refer request
try {
CallControlCommandResponse result = apiInstance.referCall(callControlId, referRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#referCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
referRequest | ReferRequest | Refer request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse rejectCall(callControlId, rejectRequest)
Reject a call
Reject an incoming call.
Expected Webhooks (see callback schema below):
call.hangup
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
RejectRequest rejectRequest = new RejectRequest(); // RejectRequest | Reject request
try {
CallControlCommandResponse result = apiInstance.rejectCall(callControlId, rejectRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#rejectCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
rejectRequest | RejectRequest | Reject request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse resumeCallRecording(callControlId, resumeRecordingRequest)
Record resume
Resume recording the call.
Expected Webhooks:
There are no webhooks associated with this command.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
ResumeRecordingRequest resumeRecordingRequest = new ResumeRecordingRequest(); // ResumeRecordingRequest | Resume recording call request
try {
CallControlCommandResponse result = apiInstance.resumeCallRecording(callControlId, resumeRecordingRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#resumeCallRecording");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
resumeRecordingRequest | ResumeRecordingRequest | Resume recording call request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse sendDTMF(callControlId, sendDTMFRequest)
Send DTMF
Sends DTMF tones from this leg. DTMF tones will be heard by the other end of the call.
Expected Webhooks:
There are no webhooks associated with this command.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
SendDTMFRequest sendDTMFRequest = new SendDTMFRequest(); // SendDTMFRequest | Send DTMF request
try {
CallControlCommandResponse result = apiInstance.sendDTMF(callControlId, sendDTMFRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#sendDTMF");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
sendDTMFRequest | SendDTMFRequest | Send DTMF request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse sendSIPInfo(callControlId, sendSIPInfoRequest)
Send SIP info
Sends SIP info from this leg.
Expected Webhooks:
call.sip_info.received
(to be received on the target call leg)
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
SendSIPInfoRequest sendSIPInfoRequest = new SendSIPInfoRequest(); // SendSIPInfoRequest | Send SIP INFO request
try {
CallControlCommandResponse result = apiInstance.sendSIPInfo(callControlId, sendSIPInfoRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#sendSIPInfo");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
sendSIPInfoRequest | SendSIPInfoRequest | Send SIP INFO request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse speakCall(callControlId, speakRequest)
Speak text
Convert text to speech and play it back on the call. If multiple speak text commands are issued consecutively, the audio files will be placed in a queue awaiting playback.
Expected Webhooks (see callback schema below):
call.speak.started
call.speak.ended
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
SpeakRequest speakRequest = new SpeakRequest(); // SpeakRequest | Speak request
try {
CallControlCommandResponse result = apiInstance.speakCall(callControlId, speakRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#speakCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
speakRequest | SpeakRequest | Speak request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse startCallFork(callControlId, startForkingRequest)
Forking start
Call forking allows you to stream the media from a call to a specific target in realtime.
This stream can be used to enable realtime audio analysis to support a
variety of use cases, including fraud detection, or the creation of AI-generated audio responses.
Requests must specify either the target
attribute or the rx
and tx
attributes.
Expected Webhooks (see callback schema below):
call.fork.started
call.fork.stopped
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StartForkingRequest startForkingRequest = new StartForkingRequest(); // StartForkingRequest | Fork media request
try {
CallControlCommandResponse result = apiInstance.startCallFork(callControlId, startForkingRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#startCallFork");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
startForkingRequest | StartForkingRequest | Fork media request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse startCallPlayback(callControlId, playAudioUrlRequest)
Play audio URL
Play an audio file on the call. If multiple play audio commands are issued consecutively, the audio files will be placed in a queue awaiting playback.
Notes:
- When
overlay
is enabled,target_legs
is limited toself
. - A customer cannot Play Audio with
overlay=true
unless there is a Play Audio withoverlay=false
actively playing.
Expected Webhooks (see callback schema below):
call.playback.started
call.playback.ended
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
PlayAudioUrlRequest playAudioUrlRequest = new PlayAudioUrlRequest(); // PlayAudioUrlRequest | Play audio URL request
try {
CallControlCommandResponse result = apiInstance.startCallPlayback(callControlId, playAudioUrlRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#startCallPlayback");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
playAudioUrlRequest | PlayAudioUrlRequest | Play audio URL request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse startCallRecord(callControlId, startRecordingRequest)
Recording start
Start recording the call. Recording will stop on call hang-up, or can be initiated via the Stop Recording command.
Expected Webhooks (see callback schema below):
call.recording.saved
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StartRecordingRequest startRecordingRequest = new StartRecordingRequest(); // StartRecordingRequest | Start recording audio request
try {
CallControlCommandResponse result = apiInstance.startCallRecord(callControlId, startRecordingRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#startCallRecord");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
startRecordingRequest | StartRecordingRequest | Start recording audio request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse startCallStreaming(callControlId, startStreamingRequest)
Streaming start
Start streaming the media from a call to a specific WebSocket address or Dialogflow connection in near-realtime. Audio will be delivered as base64-encoded RTP payload (raw audio), wrapped in JSON payloads.
Please find more details about media streaming messages specification under the link.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StartStreamingRequest startStreamingRequest = new StartStreamingRequest(); // StartStreamingRequest | Start streaming media request
try {
CallControlCommandResponse result = apiInstance.startCallStreaming(callControlId, startStreamingRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#startCallStreaming");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
startStreamingRequest | StartStreamingRequest | Start streaming media request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse startCallTranscription(callControlId, transcriptionStartRequest)
Transcription start
Start real-time transcription. Transcription will stop on call hang-up, or can be initiated via the Transcription stop command.
Expected Webhooks (see callback schema below):
call.transcription
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
TranscriptionStartRequest transcriptionStartRequest = new TranscriptionStartRequest(); // TranscriptionStartRequest | Transcription start request
try {
CallControlCommandResponse result = apiInstance.startCallTranscription(callControlId, transcriptionStartRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#startCallTranscription");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
transcriptionStartRequest | TranscriptionStartRequest | Transcription start request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse startSiprecSession(callControlId, startSiprecRequest)
SIPREC start
Start siprec session to configured in SIPREC connector SRS.
Expected Webhooks:
siprec.started
siprec.stopped
siprec.failed
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StartSiprecRequest startSiprecRequest = new StartSiprecRequest(); // StartSiprecRequest | Start siprec session to configured in SIPREC connector SRS.
try {
CallControlCommandResponse result = apiInstance.startSiprecSession(callControlId, startSiprecRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#startSiprecSession");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
startSiprecRequest | StartSiprecRequest | Start siprec session to configured in SIPREC connector SRS. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse stopCallFork(callControlId, stopForkingRequest)
Forking stop
Stop forking a call.
Expected Webhooks (see callback schema below):
call.fork.stopped
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StopForkingRequest stopForkingRequest = new StopForkingRequest(); // StopForkingRequest | Stop forking media request
try {
CallControlCommandResponse result = apiInstance.stopCallFork(callControlId, stopForkingRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#stopCallFork");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
stopForkingRequest | StopForkingRequest | Stop forking media request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse stopCallGather(callControlId, stopGatherRequest)
Gather stop
Stop current gather.
Expected Webhooks (see callback schema below):
call.gather.ended
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StopGatherRequest stopGatherRequest = new StopGatherRequest(); // StopGatherRequest | Stop current gather
try {
CallControlCommandResponse result = apiInstance.stopCallGather(callControlId, stopGatherRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#stopCallGather");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
stopGatherRequest | StopGatherRequest | Stop current gather |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse stopCallPlayback(callControlId, playbackStopRequest)
Stop audio playback
Stop audio being played on the call.
Expected Webhooks (see callback schema below):
call.playback.ended
orcall.speak.ended
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
PlaybackStopRequest playbackStopRequest = new PlaybackStopRequest(); // PlaybackStopRequest | Stop audio playback request
try {
CallControlCommandResponse result = apiInstance.stopCallPlayback(callControlId, playbackStopRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#stopCallPlayback");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
playbackStopRequest | PlaybackStopRequest | Stop audio playback request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse stopCallRecording(callControlId, stopRecordingRequest)
Recording stop
Stop recording the call.
Expected Webhooks (see callback schema below):
call.recording.saved
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StopRecordingRequest stopRecordingRequest = new StopRecordingRequest(); // StopRecordingRequest | Stop recording call request
try {
CallControlCommandResponse result = apiInstance.stopCallRecording(callControlId, stopRecordingRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#stopCallRecording");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
stopRecordingRequest | StopRecordingRequest | Stop recording call request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse stopCallStreaming(callControlId, stopStreamingRequest)
Streaming stop
Stop streaming a call to a WebSocket.
Expected Webhooks (see callback schema below):
streaming.stopped
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StopStreamingRequest stopStreamingRequest = new StopStreamingRequest(); // StopStreamingRequest | Stop streaming media request
try {
CallControlCommandResponse result = apiInstance.stopCallStreaming(callControlId, stopStreamingRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#stopCallStreaming");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
stopStreamingRequest | StopStreamingRequest | Stop streaming media request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse stopCallTranscription(callControlId, transcriptionStopRequest)
Transcription stop
Stop real-time transcription.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
TranscriptionStopRequest transcriptionStopRequest = new TranscriptionStopRequest(); // TranscriptionStopRequest | Transcription stop request
try {
CallControlCommandResponse result = apiInstance.stopCallTranscription(callControlId, transcriptionStopRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#stopCallTranscription");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
transcriptionStopRequest | TranscriptionStopRequest | Transcription stop request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse stopSiprecSession(callControlId, stopSiprecRequest)
SIPREC stop
Stop SIPREC session.
Expected Webhooks:
siprec.stopped
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
StopSiprecRequest stopSiprecRequest = new StopSiprecRequest(); // StopSiprecRequest | Stop siprec session
try {
CallControlCommandResponse result = apiInstance.stopSiprecSession(callControlId, stopSiprecRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#stopSiprecSession");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
stopSiprecRequest | StopSiprecRequest | Stop siprec session |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse transferCall(callControlId, transferCallRequest)
Transfer call
Transfer a call to a new destination. If the transfer is unsuccessful, a call.hangup
webhook for the other call (Leg B) will be sent indicating that the transfer could not be completed. The original call will remain active and may be issued additional commands, potentially transfering the call to an alternate destination.
Expected Webhooks (see callback schema below):
call.initiated
call.bridged
to Leg Bcall.answered
orcall.hangup
call.machine.detection.ended
ifanswering_machine_detection
was requestedcall.machine.greeting.ended
ifanswering_machine_detection
was requested to detect the end of machine greetingcall.machine.premium.detection.ended
ifanswering_machine_detection=premium
was requestedcall.machine.premium.greeting.ended
ifanswering_machine_detection=premium
was requested and a beep was detected
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
TransferCallRequest transferCallRequest = new TransferCallRequest(); // TransferCallRequest | Transfer call request
try {
CallControlCommandResponse result = apiInstance.transferCall(callControlId, transferCallRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#transferCall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
transferCallRequest | TransferCallRequest | Transfer call request |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |
CallControlCommandResponse updateClientState(callControlId, clientStateUpdateRequest)
Update client state
Updates client state
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CallCommandsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CallCommandsApi apiInstance = new CallCommandsApi(defaultClient);
String callControlId = "callControlId_example"; // String | Unique identifier and token for controlling the call
ClientStateUpdateRequest clientStateUpdateRequest = new ClientStateUpdateRequest(); // ClientStateUpdateRequest | Updates client state for every subsequent webhook
try {
CallControlCommandResponse result = apiInstance.updateClientState(callControlId, clientStateUpdateRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CallCommandsApi#updateClientState");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
callControlId | String | Unique identifier and token for controlling the call | |
clientStateUpdateRequest | ClientStateUpdateRequest | Updates client state for every subsequent webhook |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response upon making a call control command. | - |
0 | Unexpected error | - |