telnyx-texml-javascript
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成。请勿编辑。 -->
Telnyx Texml - JavaScript
Telnyx TeXML - JavaScript
Installation
安装
bash
npm install telnyxbash
npm install telnyxSetup
设置
javascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});All examples below assume is already initialized as shown above.
clientjavascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // 这是默认值,可省略
});以下所有示例均假设已按上述方式初始化。
clientError Handling
错误处理
All API calls can fail with network errors, rate limits (429), validation errors (422),
or authentication errors (401). Always handle errors in production code:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: rate limited — wait and retry with exponential backoff
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API error ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('Validation error — check required fields and formats');
}
}
}Common error codes: invalid API key, insufficient permissions,
resource not found, validation error (check field formats),
rate limited (retry with exponential backoff).
401403404422429所有API调用都可能因网络错误、速率限制(429)、验证错误(422)或认证错误(401)而失败。生产代码中务必处理错误:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('网络错误 — 检查连接性并重试');
} else if (err instanceof Telnyx.RateLimitError) {
// 429:速率受限 — 等待后使用指数退避策略重试
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API错误 ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('验证错误 — 检查必填字段和格式');
}
}
}常见错误代码:无效API密钥,权限不足,资源未找到,验证错误(检查字段格式),速率受限(使用指数退避策略重试)。
401403404422429Important Notes
重要说明
- Pagination: List methods return an auto-paginating iterator. Use to iterate through all pages automatically.
for await (const item of result) { ... }
- 分页:列表方法返回自动分页的迭代器。使用自动遍历所有页面。
for await (const item of result) { ... }
Fetch multiple call resources
获取多个通话资源
Returns multiple call resources for an account. This endpoint is eventually consistent.
GET /texml/Accounts/{account_sid}/Callsjavascript
const response = await client.texml.accounts.calls.retrieveCalls('account_sid');
console.log(response.calls);Returns: (array[object]), (integer), (string), (string), (integer), (integer), (integer), (string)
callsendfirst_page_urinext_page_uripagepage_sizestarturi返回账户下的多个通话资源。该接口最终一致。
GET /texml/Accounts/{account_sid}/Callsjavascript
const response = await client.texml.accounts.calls.retrieveCalls('account_sid');
console.log(response.calls);返回:(对象数组),(整数),(字符串),(字符串),(整数),(整数),(整数),(字符串)
callsendfirst_page_urinext_page_uripagepage_sizestarturiInitiate an outbound call
发起外呼通话
Initiate an outbound TeXML call. Telnyx will request TeXML from the XML Request URL configured for the connection in the Mission Control Portal.
POST /texml/Accounts/{account_sid}/CallsToFromApplicationSidOptional: (boolean), (string), (enum: GET, POST), (string), (boolean), (boolean), (array[object]), (enum: Premium, Regular), (string), (enum: Enable, Disable, DetectMessageEnd), (integer), (integer), (integer), (integer), (string), (boolean), (enum: mono, dual), (string), (string), (enum: GET, POST), (integer), (enum: inbound, outbound, both), (boolean), (string), (string), (enum: US, Europe, Canada, Australia, Middle East), (string), (enum: initiated, ringing, answered, completed), (enum: GET, POST), (string), (enum: barge, whisper, monitor), (string), (integer), (integer), (enum: trim-silence, do-not-trim), (string), (enum: GET, POST)
AsyncAmdAsyncAmdStatusCallbackAsyncAmdStatusCallbackMethodCallerIdCancelPlaybackOnDetectMessageEndCancelPlaybackOnMachineDetectionCustomHeadersDetectionModeFallbackUrlMachineDetectionMachineDetectionSilenceTimeoutMachineDetectionSpeechEndThresholdMachineDetectionSpeechThresholdMachineDetectionTimeoutPreferredCodecsRecordRecordingChannelsRecordingStatusCallbackRecordingStatusCallbackEventRecordingStatusCallbackMethodRecordingTimeoutRecordingTrackSendRecordingUrlSipAuthPasswordSipAuthUsernameSipRegionStatusCallbackStatusCallbackEventStatusCallbackMethodSuperviseCallSidSupervisingRoleTexmlTimeLimitTimeoutTrimUrlUrlMethodjavascript
const response = await client.texml.accounts.calls.calls('account_sid', {
ApplicationSid: 'example-app-sid',
From: '+13120001234',
To: '+13121230000',
});
console.log(response.from);Returns: (string), (string), (string)
fromstatusto发起TeXML外呼通话。Telnyx将从Mission Control门户中为连接配置的XML请求URL获取TeXML。
POST /texml/Accounts/{account_sid}/CallsToFromApplicationSid可选:(布尔值),(字符串),(枚举:GET、POST),(字符串),(布尔值),(布尔值),(对象数组),(枚举:Premium、Regular),(字符串),(枚举:Enable、Disable、DetectMessageEnd),(整数),(整数),(整数),(整数),(字符串),(布尔值),(枚举:mono、dual),(字符串),(字符串),(枚举:GET、POST),(整数),(枚举:inbound、outbound、both),(布尔值),(字符串),(字符串),(枚举:US、Europe、Canada、Australia、Middle East),(字符串),(枚举:initiated、ringing、answered、completed),(枚举:GET、POST),(字符串),(枚举:barge、whisper、monitor),(字符串),(整数),(整数),(枚举:trim-silence、do-not-trim),(字符串),(枚举:GET、POST)
AsyncAmdAsyncAmdStatusCallbackAsyncAmdStatusCallbackMethodCallerIdCancelPlaybackOnDetectMessageEndCancelPlaybackOnMachineDetectionCustomHeadersDetectionModeFallbackUrlMachineDetectionMachineDetectionSilenceTimeoutMachineDetectionSpeechEndThresholdMachineDetectionSpeechThresholdMachineDetectionTimeoutPreferredCodecsRecordRecordingChannelsRecordingStatusCallbackRecordingStatusCallbackEventRecordingStatusCallbackMethodRecordingTimeoutRecordingTrackSendRecordingUrlSipAuthPasswordSipAuthUsernameSipRegionStatusCallbackStatusCallbackEventStatusCallbackMethodSuperviseCallSidSupervisingRoleTexmlTimeLimitTimeoutTrimUrlUrlMethodjavascript
const response = await client.texml.accounts.calls.calls('account_sid', {
ApplicationSid: 'example-app-sid',
From: '+13120001234',
To: '+13121230000',
});
console.log(response.from);返回:(字符串),(字符串),(字符串)
fromstatustoFetch a call
获取单个通话
Returns an individual call identified by its CallSid. This endpoint is eventually consistent.
GET /texml/Accounts/{account_sid}/Calls/{call_sid}javascript
const call = await client.texml.accounts.calls.retrieve('call_sid', { account_sid: '550e8400-e29b-41d4-a716-446655440000' });
console.log(call.account_sid);Returns: (string), (enum: human, machine, not_sure), (string), (string), (string), (enum: inbound, outbound), (string), (string), (string), (string), (string), (string), (string), (string), (enum: ringing, in-progress, canceled, completed, failed, busy, no-answer), (string), (string), (string)
account_sidanswered_bycaller_namedate_createddate_updateddirectiondurationend_timefromfrom_formattedpriceprice_unitsidstart_timestatustoto_formatteduri返回由CallSid标识的单个通话资源。该接口最终一致。
GET /texml/Accounts/{account_sid}/Calls/{call_sid}javascript
const call = await client.texml.accounts.calls.retrieve('call_sid', { account_sid: '550e8400-e29b-41d4-a716-446655440000' });
console.log(call.account_sid);返回:(字符串),(枚举:human、machine、not_sure),(字符串),(字符串),(字符串),(枚举:inbound、outbound),(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(枚举:ringing、in-progress、canceled、completed、failed、busy、no-answer),(字符串),(字符串),(字符串)
account_sidanswered_bycaller_namedate_createddate_updateddirectiondurationend_timefromfrom_formattedpriceprice_unitsidstart_timestatustoto_formatteduriUpdate call
更新通话
Update TeXML call. Please note that the keys present in the payload MUST BE formatted in CamelCase as specified in the example.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}javascript
const call = await client.texml.accounts.calls.update('call_sid', { account_sid: '550e8400-e29b-41d4-a716-446655440000' });
console.log(call.account_sid);Returns: (string), (enum: human, machine, not_sure), (string), (string), (string), (enum: inbound, outbound), (string), (string), (string), (string), (string), (string), (string), (string), (enum: ringing, in-progress, canceled, completed, failed, busy, no-answer), (string), (string), (string)
account_sidanswered_bycaller_namedate_createddate_updateddirectiondurationend_timefromfrom_formattedpriceprice_unitsidstart_timestatustoto_formatteduri更新TeXML通话。请注意,请求体中的键必须按照示例指定的驼峰式格式编写。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}javascript
const call = await client.texml.accounts.calls.update('call_sid', { account_sid: '550e8400-e29b-41d4-a716-446655440000' });
console.log(call.account_sid);返回:(字符串),(枚举:human、machine、not_sure),(字符串),(字符串),(字符串),(枚举:inbound、outbound),(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(枚举:ringing、in-progress、canceled、completed、failed、busy、no-answer),(字符串),(字符串),(字符串)
account_sidanswered_bycaller_namedate_createddate_updateddirectiondurationend_timefromfrom_formattedpriceprice_unitsidstart_timestatustoto_formatteduriFetch recordings for a call
获取通话录音
Returns recordings for a call identified by call_sid.
GET /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.jsonjavascript
const response = await client.texml.accounts.calls.recordingsJson.retrieveRecordingsJson(
'call_sid',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.end);Returns: (integer), (uri), (string), (integer), (integer), (uri), (array[object]), (integer), (string)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_urirecordingsstarturi返回由call_sid标识的通话的录音资源。
GET /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.jsonjavascript
const response = await client.texml.accounts.calls.recordingsJson.retrieveRecordingsJson(
'call_sid',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.end);返回:(整数),(uri),(字符串),(整数),(整数),(uri),(对象数组),(整数),(字符串)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_urirecordingsstarturiRequest recording for a call
请求通话录音
Starts recording with specified parameters for call identified by call_sid.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.jsonjavascript
const response = await client.texml.accounts.calls.recordingsJson.recordingsJson('call_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.account_sid);Returns: (string), (string), (enum: 1, 2), (uuid), (date-time), (date-time), (string | null), (string | null), (string | null), (string | null), (string), (enum: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking), (date-time), (enum: inbound, outbound, both), (string)
account_sidcall_sidchannelsconference_siddate_createddate_updateddurationerror_codepriceprice_unitsidsourcestart_timetrackuri为call_sid标识的通话启动指定参数的录音。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.jsonjavascript
const response = await client.texml.accounts.calls.recordingsJson.recordingsJson('call_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.account_sid);返回:(字符串),(字符串),(枚举:1、2),(uuid),(date-time),(date-time),(字符串 | null),(字符串 | null),(字符串 | null),(字符串 | null),(字符串),(枚举:StartCallRecordingAPI、StartConferenceRecordingAPI、OutboundAPI、DialVerb、Conference、RecordVerb、Trunking),(date-time),(枚举:inbound、outbound、both),(字符串)
account_sidcall_sidchannelsconference_siddate_createddate_updateddurationerror_codepriceprice_unitsidsourcestart_timetrackuriUpdate recording on a call
更新通话录音
Updates recording resource for particular call.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings/{recording_sid}.jsonjavascript
const response = await client.texml.accounts.calls.recordings.recordingSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000', call_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.account_sid);Returns: (string), (string), (enum: 1, 2), (uuid), (date-time), (date-time), (string | null), (string | null), (string | null), (string | null), (string), (enum: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking), (date-time), (enum: inbound, outbound, both), (string)
account_sidcall_sidchannelsconference_siddate_createddate_updateddurationerror_codepriceprice_unitsidsourcestart_timetrackuri更新特定通话的录音资源。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings/{recording_sid}.jsonjavascript
const response = await client.texml.accounts.calls.recordings.recordingSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000', call_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.account_sid);返回:(字符串),(字符串),(枚举:1、2),(uuid),(date-time),(date-time),(字符串 | null),(字符串 | null),(字符串 | null),(字符串 | null),(字符串),(枚举:StartCallRecordingAPI、StartConferenceRecordingAPI、OutboundAPI、DialVerb、Conference、RecordVerb、Trunking),(date-time),(枚举:inbound、outbound、both),(字符串)
account_sidcall_sidchannelsconference_siddate_createddate_updateddurationerror_codepriceprice_unitsidsourcestart_timetrackuriRequest siprec session for a call
请求通话SIPREC会话
Starts siprec session with specified parameters for call identified by call_sid.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec.jsonjavascript
const response = await client.texml.accounts.calls.siprecJson('call_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.account_sid);Returns: (string), (string), (string), (string), (string), (string), (string), (enum: in-progress, stopped), (enum: both_tracks, inbound_track, outbound_track), (string)
account_sidcall_siddate_createddate_updatederror_codesidstart_timestatustrackuri为call_sid标识的通话启动指定参数的SIPREC会话。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec.jsonjavascript
const response = await client.texml.accounts.calls.siprecJson('call_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.account_sid);返回:(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(枚举:in-progress、stopped),(枚举:both_tracks、inbound_track、outbound_track),(字符串)
account_sidcall_siddate_createddate_updatederror_codesidstart_timestatustrackuriUpdates siprec session for a call
更新通话SIPREC会话
Updates siprec session identified by siprec_sid.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec/{siprec_sid}.jsonjavascript
const response = await client.texml.accounts.calls.siprec.siprecSidJson('siprec_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
call_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.account_sid);Returns: (string), (string), (string), (string), (string), (enum: in-progress, stopped), (string)
account_sidcall_siddate_updatederror_codesidstatusuri更新由siprec_sid标识的SIPREC会话。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec/{siprec_sid}.jsonjavascript
const response = await client.texml.accounts.calls.siprec.siprecSidJson('siprec_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
call_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.account_sid);返回:(字符串),(字符串),(字符串),(字符串),(字符串),(枚举:in-progress、stopped),(字符串)
account_sidcall_siddate_updatederror_codesidstatusuriStart streaming media from a call.
启动通话媒体流
Starts streaming media from a call to a specific WebSocket address.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams.jsonjavascript
const response = await client.texml.accounts.calls.streamsJson('call_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.account_sid);Returns: (string), (string), (date-time), (string), (string), (enum: in-progress), (string)
account_sidcall_siddate_updatednamesidstatusuri启动通话媒体流到指定WebSocket地址。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams.jsonjavascript
const response = await client.texml.accounts.calls.streamsJson('call_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.account_sid);返回:(字符串),(字符串),(date-time),(字符串),(字符串),(枚举:in-progress),(字符串)
account_sidcall_siddate_updatednamesidstatusuriUpdate streaming on a call
更新通话媒体流
Updates streaming resource for particular call.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams/{streaming_sid}.jsonjavascript
const response = await client.texml.accounts.calls.streams.streamingSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000', call_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.account_sid);Returns: (string), (string), (date-time), (string), (enum: stopped), (string)
account_sidcall_siddate_updatedsidstatusuri更新特定通话的媒体流资源。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams/{streaming_sid}.jsonjavascript
const response = await client.texml.accounts.calls.streams.streamingSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000', call_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.account_sid);返回:(字符串),(字符串),(date-time),(字符串),(枚举:stopped),(字符串)
account_sidcall_siddate_updatedsidstatusuriList conference resources
列出会议资源
Lists conference resources.
GET /texml/Accounts/{account_sid}/Conferencesjavascript
const response = await client.texml.accounts.conferences.retrieveConferences('account_sid');
console.log(response.conferences);Returns: (array[object]), (integer), (string), (string), (integer), (integer), (integer), (string)
conferencesendfirst_page_urinext_page_uripagepage_sizestarturi列出会议资源。
GET /texml/Accounts/{account_sid}/Conferencesjavascript
const response = await client.texml.accounts.conferences.retrieveConferences('account_sid');
console.log(response.conferences);返回:(对象数组),(整数),(字符串),(字符串),(整数),(整数),(整数),(字符串)
conferencesendfirst_page_urinext_page_uripagepage_sizestarturiFetch a conference resource
获取单个会议资源
Returns a conference resource.
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}javascript
const conference = await client.texml.accounts.conferences.retrieve('conference_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(conference.account_sid);Returns: (string), (string), (string), (string), (string), (string), (enum: participant-with-end-conference-on-exit-left, last-participant-left, conference-ended-via-api, time-exceeded), (string), (string), (enum: init, in-progress, completed), (object), (string)
account_sidapi_versioncall_sid_ending_conferencedate_createddate_updatedfriendly_namereason_conference_endedregionsidstatussubresource_urisuri返回单个会议资源。
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}javascript
const conference = await client.texml.accounts.conferences.retrieve('conference_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(conference.account_sid);返回:(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(枚举:participant-with-end-conference-on-exit-left、last-participant-left、conference-ended-via-api、time-exceeded),(字符串),(字符串),(枚举:init、in-progress、completed),(对象),(字符串)
account_sidapi_versioncall_sid_ending_conferencedate_createddate_updatedfriendly_namereason_conference_endedregionsidstatussubresource_urisuriUpdate a conference resource
更新会议资源
Updates a conference resource.
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}javascript
const conference = await client.texml.accounts.conferences.update('conference_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(conference.account_sid);Returns: (string), (string), (string), (string), (string), (string), (enum: participant-with-end-conference-on-exit-left, last-participant-left, conference-ended-via-api, time-exceeded), (string), (string), (enum: init, in-progress, completed), (object), (string)
account_sidapi_versioncall_sid_ending_conferencedate_createddate_updatedfriendly_namereason_conference_endedregionsidstatussubresource_urisuri更新会议资源。
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}javascript
const conference = await client.texml.accounts.conferences.update('conference_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(conference.account_sid);返回:(字符串),(字符串),(字符串),(字符串),(字符串),(字符串),(枚举:participant-with-end-conference-on-exit-left、last-participant-left、conference-ended-via-api、time-exceeded),(字符串),(字符串),(枚举:init、in-progress、completed),(对象),(字符串)
account_sidapi_versioncall_sid_ending_conferencedate_createddate_updatedfriendly_namereason_conference_endedregionsidstatussubresource_urisuriList conference participants
列出会议参与者
Lists conference participants
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participantsjavascript
const response = await client.texml.accounts.conferences.participants.retrieveParticipants(
'conference_sid',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.end);Returns: (integer), (string), (string), (integer), (integer), (array[object]), (integer), (string)
endfirst_page_urinext_page_uripagepage_sizeparticipantsstarturi列出会议参与者
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participantsjavascript
const response = await client.texml.accounts.conferences.participants.retrieveParticipants(
'conference_sid',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.end);返回:(整数),(字符串),(字符串),(整数),(整数),(对象数组),(整数),(字符串)
endfirst_page_urinext_page_uripagepage_sizeparticipantsstarturiDial a new conference participant
拨打新会议参与者
Dials a new conference participant
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participantsjavascript
const response = await client.texml.accounts.conferences.participants.participants(
'conference_sid',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.account_sid);Returns: (string), (string), (boolean), (string), (uuid), (boolean), (boolean), (boolean), (enum: connecting, connected, completed), (string)
account_sidcall_sidcoachingcoaching_call_sidconference_sidend_conference_on_exitholdmutedstatusuri拨打新会议参与者
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participantsjavascript
const response = await client.texml.accounts.conferences.participants.participants(
'conference_sid',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.account_sid);返回:(字符串),(字符串),(布尔值),(字符串),(uuid),(布尔值),(布尔值),(布尔值),(枚举:connecting、connected、completed),(字符串)
account_sidcall_sidcoachingcoaching_call_sidconference_sidend_conference_on_exitholdmutedstatusuriGet conference participant resource
获取会议参与者资源
Gets conference participant resource
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}javascript
const participant = await client.texml.accounts.conferences.participants.retrieve(
'call_sid_or_participant_label',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000', conference_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(participant.account_sid);Returns: (string), (string), (string), (string), (boolean), (string), (string), (uuid), (string), (string), (boolean), (boolean), (boolean), (enum: connecting, connected, completed), (string)
account_sidapi_versioncall_sidcall_sid_legacycoachingcoaching_call_sidcoaching_call_sid_legacyconference_siddate_createddate_updatedend_conference_on_exitholdmutedstatusuri获取会议参与者资源
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}javascript
const participant = await client.texml.accounts.conferences.participants.retrieve(
'call_sid_or_participant_label',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000', conference_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(participant.account_sid);返回:(字符串),(字符串),(字符串),(字符串),(布尔值),(字符串),(字符串),(uuid),(字符串),(字符串),(布尔值),(布尔值),(布尔值),(枚举:connecting、connected、completed),(字符串)
account_sidapi_versioncall_sidcall_sid_legacycoachingcoaching_call_sidcoaching_call_sid_legacyconference_siddate_createddate_updatedend_conference_on_exitholdmutedstatusuriUpdate a conference participant
更新会议参与者
Updates a conference participant
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}javascript
const participant = await client.texml.accounts.conferences.participants.update(
'call_sid_or_participant_label',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000', conference_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(participant.account_sid);Returns: (string), (string), (string), (string), (boolean), (string), (string), (uuid), (string), (string), (boolean), (boolean), (boolean), (enum: connecting, connected, completed), (string)
account_sidapi_versioncall_sidcall_sid_legacycoachingcoaching_call_sidcoaching_call_sid_legacyconference_siddate_createddate_updatedend_conference_on_exitholdmutedstatusuri更新会议参与者
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}javascript
const participant = await client.texml.accounts.conferences.participants.update(
'call_sid_or_participant_label',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000', conference_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(participant.account_sid);返回:(字符串),(字符串),(字符串),(字符串),(布尔值),(字符串),(字符串),(uuid),(字符串),(字符串),(布尔值),(布尔值),(布尔值),(枚举:connecting、connected、completed),(字符串)
account_sidapi_versioncall_sidcall_sid_legacycoachingcoaching_call_sidcoaching_call_sid_legacyconference_siddate_createddate_updatedend_conference_on_exitholdmutedstatusuriDelete a conference participant
删除会议参与者
Deletes a conference participant
DELETE /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}javascript
await client.texml.accounts.conferences.participants.delete('call_sid_or_participant_label', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
conference_sid: '550e8400-e29b-41d4-a716-446655440000',
});删除会议参与者
DELETE /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}javascript
await client.texml.accounts.conferences.participants.delete('call_sid_or_participant_label', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
conference_sid: '550e8400-e29b-41d4-a716-446655440000',
});List conference recordings
列出会议录音
Lists conference recordings
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordingsjavascript
const response = await client.texml.accounts.conferences.retrieveRecordings('conference_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.end);Returns: (integer), (string), (string), (integer), (integer), (array[object]), (array[object]), (integer), (string)
endfirst_page_urinext_page_uripagepage_sizeparticipantsrecordingsstarturi列出会议录音
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordingsjavascript
const response = await client.texml.accounts.conferences.retrieveRecordings('conference_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.end);返回:(整数),(字符串),(字符串),(整数),(整数),(对象数组),(对象数组),(整数),(字符串)
endfirst_page_urinext_page_uripagepage_sizeparticipantsrecordingsstarturiFetch recordings for a conference
获取会议录音
Returns recordings for a conference identified by conference_sid.
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordings.jsonjavascript
const response = await client.texml.accounts.conferences.retrieveRecordingsJson('conference_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.end);Returns: (integer), (uri), (string), (integer), (integer), (uri), (array[object]), (integer), (string)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_urirecordingsstarturi返回由conference_sid标识的会议的录音资源。
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordings.jsonjavascript
const response = await client.texml.accounts.conferences.retrieveRecordingsJson('conference_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(response.end);返回:(整数),(uri),(字符串),(整数),(整数),(uri),(对象数组),(整数),(字符串)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_urirecordingsstarturiList queue resources
列出队列资源
Lists queue resources.
GET /texml/Accounts/{account_sid}/Queuesjavascript
// Automatically fetches more pages as needed.
for await (const queueListResponse of client.texml.accounts.queues.list('account_sid')) {
console.log(queueListResponse.account_sid);
}Returns: (integer), (string), (string), (integer), (integer), (array[object]), (integer), (string)
endfirst_page_urinext_page_uripagepage_sizequeuesstarturi列出队列资源。
GET /texml/Accounts/{account_sid}/Queuesjavascript
// 自动按需获取更多页面。
for await (const queueListResponse of client.texml.accounts.queues.list('account_sid')) {
console.log(queueListResponse.account_sid);
}返回:(整数),(字符串),(字符串),(整数),(整数),(对象数组),(整数),(字符串)
endfirst_page_urinext_page_uripagepage_sizequeuesstarturiCreate a new queue
创建新队列
Creates a new queue resource.
POST /texml/Accounts/{account_sid}/Queuesjavascript
const queue = await client.texml.accounts.queues.create('account_sid');
console.log(queue.account_sid);Returns: (string), (integer), (integer), (string), (string), (integer), (string), (object), (string)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuri创建新队列资源。
POST /texml/Accounts/{account_sid}/Queuesjavascript
const queue = await client.texml.accounts.queues.create('account_sid');
console.log(queue.account_sid);返回:(字符串),(整数),(整数),(字符串),(字符串),(整数),(字符串),(对象),(字符串)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuriFetch a queue resource
获取单个队列资源
Returns a queue resource.
GET /texml/Accounts/{account_sid}/Queues/{queue_sid}javascript
const queue = await client.texml.accounts.queues.retrieve('queue_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(queue.account_sid);Returns: (string), (integer), (integer), (string), (string), (integer), (string), (object), (string)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuri返回单个队列资源。
GET /texml/Accounts/{account_sid}/Queues/{queue_sid}javascript
const queue = await client.texml.accounts.queues.retrieve('queue_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(queue.account_sid);返回:(字符串),(整数),(整数),(字符串),(字符串),(整数),(字符串),(对象),(字符串)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuriUpdate a queue resource
更新队列资源
Updates a queue resource.
POST /texml/Accounts/{account_sid}/Queues/{queue_sid}javascript
const queue = await client.texml.accounts.queues.update('queue_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(queue.account_sid);Returns: (string), (integer), (integer), (string), (string), (integer), (string), (object), (string)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuri更新队列资源。
POST /texml/Accounts/{account_sid}/Queues/{queue_sid}javascript
const queue = await client.texml.accounts.queues.update('queue_sid', {
account_sid: '550e8400-e29b-41d4-a716-446655440000',
});
console.log(queue.account_sid);返回:(字符串),(整数),(整数),(字符串),(字符串),(整数),(字符串),(对象),(字符串)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuriDelete a queue resource
删除队列资源
Delete a queue resource.
DELETE /texml/Accounts/{account_sid}/Queues/{queue_sid}javascript
await client.texml.accounts.queues.delete('queue_sid', { account_sid: '550e8400-e29b-41d4-a716-446655440000' });删除队列资源。
DELETE /texml/Accounts/{account_sid}/Queues/{queue_sid}javascript
await client.texml.accounts.queues.delete('queue_sid', { account_sid: '550e8400-e29b-41d4-a716-446655440000' });Fetch multiple recording resources
获取多个录音资源
Returns multiple recording resources for an account.
GET /texml/Accounts/{account_sid}/Recordings.jsonjavascript
const response = await client.texml.accounts.retrieveRecordingsJson('account_sid');
console.log(response.end);Returns: (integer), (uri), (string), (integer), (integer), (uri), (array[object]), (integer), (string)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_urirecordingsstarturi返回账户下的多个录音资源。
GET /texml/Accounts/{account_sid}/Recordings.jsonjavascript
const response = await client.texml.accounts.retrieveRecordingsJson('account_sid');
console.log(response.end);返回:(整数),(uri),(字符串),(整数),(整数),(uri),(对象数组),(整数),(字符串)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_urirecordingsstarturiFetch recording resource
获取单个录音资源
Returns recording resource identified by recording id.
GET /texml/Accounts/{account_sid}/Recordings/{recording_sid}.jsonjavascript
const texmlGetCallRecordingResponseBody =
await client.texml.accounts.recordings.json.retrieveRecordingSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(texmlGetCallRecordingResponseBody.account_sid);Returns: (string), (string), (enum: 1, 2), (uuid), (date-time), (date-time), (string | null), (string | null), (uri), (string), (enum: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking), (date-time), (enum: in-progress, completed, paused, stopped), (object), (string)
account_sidcall_sidchannelsconference_siddate_createddate_updateddurationerror_codemedia_urlsidsourcestart_timestatussubresources_urisuri返回由录音ID标识的录音资源。
GET /texml/Accounts/{account_sid}/Recordings/{recording_sid}.jsonjavascript
const texmlGetCallRecordingResponseBody =
await client.texml.accounts.recordings.json.retrieveRecordingSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(texmlGetCallRecordingResponseBody.account_sid);返回:(字符串),(字符串),(枚举:1、2),(uuid),(date-time),(date-time),(字符串 | null),(字符串 | null),(uri),(字符串),(枚举:StartCallRecordingAPI、StartConferenceRecordingAPI、OutboundAPI、DialVerb、Conference、RecordVerb、Trunking),(date-time),(枚举:in-progress、completed、paused、stopped),(对象),(字符串)
account_sidcall_sidchannelsconference_siddate_createddate_updateddurationerror_codemedia_urlsidsourcestart_timestatussubresources_urisuriDelete recording resource
删除录音资源
Deletes recording resource identified by recording id.
DELETE /texml/Accounts/{account_sid}/Recordings/{recording_sid}.jsonjavascript
await client.texml.accounts.recordings.json.deleteRecordingSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);删除由录音ID标识的录音资源。
DELETE /texml/Accounts/{account_sid}/Recordings/{recording_sid}.jsonjavascript
await client.texml.accounts.recordings.json.deleteRecordingSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);List recording transcriptions
列出录音转录资源
Returns multiple recording transcription resources for an account.
GET /texml/Accounts/{account_sid}/Transcriptions.jsonjavascript
const response = await client.texml.accounts.retrieveTranscriptionsJson('account_sid');
console.log(response.end);Returns: (integer), (uri), (string), (integer), (integer), (uri), (integer), (array[object]), (string)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_uristarttranscriptionsuri返回账户下的多个录音转录资源。
GET /texml/Accounts/{account_sid}/Transcriptions.jsonjavascript
const response = await client.texml.accounts.retrieveTranscriptionsJson('account_sid');
console.log(response.end);返回:(整数),(uri),(字符串),(整数),(整数),(uri),(整数),(对象数组),(字符串)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_uristarttranscriptionsuriFetch a recording transcription resource
获取单个录音转录资源
Returns the recording transcription resource identified by its ID.
GET /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.jsonjavascript
const response =
await client.texml.accounts.transcriptions.json.retrieveRecordingTranscriptionSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.account_sid);Returns: (string), (string), (string), (date-time), (date-time), (string | null), (string), (string), (enum: in-progress, completed), (string), (string)
account_sidapi_versioncall_siddate_createddate_updateddurationrecording_sidsidstatustranscription_texturi返回由ID标识的录音转录资源。
GET /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.jsonjavascript
const response =
await client.texml.accounts.transcriptions.json.retrieveRecordingTranscriptionSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);
console.log(response.account_sid);返回:(字符串),(字符串),(字符串),(date-time),(date-time),(字符串 | null),(字符串),(字符串),(枚举:in-progress、completed),(字符串),(字符串)
account_sidapi_versioncall_siddate_createddate_updateddurationrecording_sidsidstatustranscription_texturiDelete a recording transcription
删除录音转录资源
Permanently deletes a recording transcription.
DELETE /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.jsonjavascript
await client.texml.accounts.transcriptions.json.deleteRecordingTranscriptionSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);永久删除录音转录资源。
DELETE /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.jsonjavascript
await client.texml.accounts.transcriptions.json.deleteRecordingTranscriptionSidJson(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ account_sid: '550e8400-e29b-41d4-a716-446655440000' },
);Create a TeXML secret
创建TeXML密钥
Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML when using Mustache Templates in your TeXML. In your TeXML you will be able to use your secret name, and this name will be replaced by the actual secret value when processing the TeXML on Telnyx side. The secrets are not visible in any logs.
POST /texml/secretsnamevaluejavascript
const response = await client.texml.secrets({ name: 'My Secret Name', value: 'My Secret Value' });
console.log(response.data);Returns: (string), (enum: REDACTED)
namevalue创建TeXML密钥,后续可在TeXML中使用Mustache模板时作为动态参数。在TeXML中可使用密钥名称,Telnyx处理TeXML时会将名称替换为实际密钥值。密钥不会出现在任何日志中。
POST /texml/secretsnamevaluejavascript
const response = await client.texml.secrets({ name: 'My Secret Name', value: 'My Secret Value' });
console.log(response.data);返回:(字符串),(枚举:REDACTED)
namevalueList all TeXML Applications
列出所有TeXML应用
Returns a list of your TeXML Applications.
GET /texml_applicationsjavascript
// Automatically fetches more pages as needed.
for await (const texmlApplication of client.texmlApplications.list()) {
console.log(texmlApplication.id);
}Returns: (boolean), (enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany), (boolean), (string), (enum: RFC 2833, Inband, SIP INFO), (boolean), (integer), (string), (string), (object), (object), (string), (uri), (enum: get, post), (array[string]), (string), (uri), (enum: get, post), (uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_url返回TeXML应用列表。
GET /texml_applicationsjavascript
// 自动按需获取更多页面。
for await (const texmlApplication of client.texmlApplications.list()) {
console.log(texmlApplication.id);
}返回:(布尔值),(枚举:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany),(布尔值),(字符串),(枚举:RFC 2833、Inband、SIP INFO),(布尔值),(整数),(字符串),(字符串),(对象),(对象),(字符串),(uri),(枚举:get、post),(字符串数组),(字符串),(uri),(枚举:get、post),(uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_urlCreates a TeXML Application
创建TeXML应用
Creates a TeXML Application.
POST /texml_applicationsfriendly_namevoice_urlOptional: (boolean), (enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany), (boolean), (enum: RFC 2833, Inband, SIP INFO), (boolean), (integer), (object), (object), (uri), (enum: get, post), (array[string]), (uri), (enum: get, post)
activeanchorsite_overridecall_cost_in_webhooksdtmf_typefirst_command_timeoutfirst_command_timeout_secsinboundoutboundstatus_callbackstatus_callback_methodtagsvoice_fallback_urlvoice_methodjavascript
const texmlApplication = await client.texmlApplications.create({
friendly_name: 'call-router',
voice_url: 'https://example.com',
});
console.log(texmlApplication.data);Returns: (boolean), (enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany), (boolean), (string), (enum: RFC 2833, Inband, SIP INFO), (boolean), (integer), (string), (string), (object), (object), (string), (uri), (enum: get, post), (array[string]), (string), (uri), (enum: get, post), (uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_url创建TeXML应用。
POST /texml_applicationsfriendly_namevoice_url可选:(布尔值),(枚举:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany),(布尔值),(枚举:RFC 2833、Inband、SIP INFO),(布尔值),(整数),(对象),(对象),(uri),(枚举:get、post),(字符串数组),(uri),(枚举:get、post)
activeanchorsite_overridecall_cost_in_webhooksdtmf_typefirst_command_timeoutfirst_command_timeout_secsinboundoutboundstatus_callbackstatus_callback_methodtagsvoice_fallback_urlvoice_methodjavascript
const texmlApplication = await client.texmlApplications.create({
friendly_name: 'call-router',
voice_url: 'https://example.com',
});
console.log(texmlApplication.data);返回:(布尔值),(枚举:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany),(布尔值),(字符串),(枚举:RFC 2833、Inband、SIP INFO),(布尔值),(整数),(字符串),(字符串),(对象),(对象),(字符串),(uri),(枚举:get、post),(字符串数组),(字符串),(uri),(枚举:get、post),(uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_urlRetrieve a TeXML Application
获取TeXML应用
Retrieves the details of an existing TeXML Application.
GET /texml_applications/{id}javascript
const texmlApplication = await client.texmlApplications.retrieve('1293384261075731499');
console.log(texmlApplication.data);Returns: (boolean), (enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany), (boolean), (string), (enum: RFC 2833, Inband, SIP INFO), (boolean), (integer), (string), (string), (object), (object), (string), (uri), (enum: get, post), (array[string]), (string), (uri), (enum: get, post), (uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_url获取现有TeXML应用的详细信息。
GET /texml_applications/{id}javascript
const texmlApplication = await client.texmlApplications.retrieve('1293384261075731499');
console.log(texmlApplication.data);返回:(布尔值),(枚举:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany),(布尔值),(字符串),(枚举:RFC 2833、Inband、SIP INFO),(布尔值),(整数),(字符串),(字符串),(对象),(对象),(字符串),(uri),(枚举:get、post),(字符串数组),(字符串),(uri),(枚举:get、post),(uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_urlUpdate a TeXML Application
更新TeXML应用
Updates settings of an existing TeXML Application.
PATCH /texml_applications/{id}friendly_namevoice_urlOptional: (boolean), (enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany), (boolean), (enum: RFC 2833, Inband, SIP INFO), (boolean), (integer), (object), (object), (uri), (enum: get, post), (array[string]), (uri), (enum: get, post)
activeanchorsite_overridecall_cost_in_webhooksdtmf_typefirst_command_timeoutfirst_command_timeout_secsinboundoutboundstatus_callbackstatus_callback_methodtagsvoice_fallback_urlvoice_methodjavascript
const texmlApplication = await client.texmlApplications.update('1293384261075731499', {
friendly_name: 'call-router',
voice_url: 'https://example.com',
});
console.log(texmlApplication.data);Returns: (boolean), (enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany), (boolean), (string), (enum: RFC 2833, Inband, SIP INFO), (boolean), (integer), (string), (string), (object), (object), (string), (uri), (enum: get, post), (array[string]), (string), (uri), (enum: get, post), (uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_url更新现有TeXML应用的设置。
PATCH /texml_applications/{id}friendly_namevoice_url可选:(布尔值),(枚举:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany),(布尔值),(枚举:RFC 2833、Inband、SIP INFO),(布尔值),(整数),(对象),(对象),(uri),(枚举:get、post),(字符串数组),(uri),(枚举:get、post)
activeanchorsite_overridecall_cost_in_webhooksdtmf_typefirst_command_timeoutfirst_command_timeout_secsinboundoutboundstatus_callbackstatus_callback_methodtagsvoice_fallback_urlvoice_methodjavascript
const texmlApplication = await client.texmlApplications.update('1293384261075731499', {
friendly_name: 'call-router',
voice_url: 'https://example.com',
});
console.log(texmlApplication.data);返回:(布尔值),(枚举:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany),(布尔值),(字符串),(枚举:RFC 2833、Inband、SIP INFO),(布尔值),(整数),(字符串),(字符串),(对象),(对象),(字符串),(uri),(枚举:get、post),(字符串数组),(字符串),(uri),(枚举:get、post),(uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_urlDeletes a TeXML Application
删除TeXML应用
Deletes a TeXML Application.
DELETE /texml_applications/{id}javascript
const texmlApplication = await client.texmlApplications.delete('1293384261075731499');
console.log(texmlApplication.data);Returns: (boolean), (enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany), (boolean), (string), (enum: RFC 2833, Inband, SIP INFO), (boolean), (integer), (string), (string), (object), (object), (string), (uri), (enum: get, post), (array[string]), (string), (uri), (enum: get, post), (uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_url删除TeXML应用。
DELETE /texml_applications/{id}javascript
const texmlApplication = await client.texmlApplications.delete('1293384261075731499');
console.log(texmlApplication.data);返回:(布尔值),(枚举:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany),(布尔值),(字符串),(枚举:RFC 2833、Inband、SIP INFO),(布尔值),(整数),(字符串),(字符串),(对象),(对象),(字符串),(uri),(枚举:get、post),(字符串数组),(字符串),(uri),(枚举:get、post),(uri)
activeanchorsite_overridecall_cost_in_webhookscreated_atdtmf_typefirst_command_timeoutfirst_command_timeout_secsfriendly_nameidinboundoutboundrecord_typestatus_callbackstatus_callback_methodtagsupdated_atvoice_fallback_urlvoice_methodvoice_url