telnyx-texml-ruby

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成,请勿编辑。 -->

Telnyx Texml - Ruby

Telnyx Texml - Ruby

Installation

安装

bash
gem install telnyx
bash
gem install telnyx

Setup

配置

ruby
require "telnyx"

client = Telnyx::Client.new(
  api_key: ENV["TELNYX_API_KEY"], # This is the default and can be omitted
)
All examples below assume
client
is already initialized as shown above.
ruby
require "telnyx"

client = Telnyx::Client.new(
  api_key: ENV["TELNYX_API_KEY"], # 这是默认配置,可以省略
)
以下所有示例均假设
client
已按照上述方式完成初始化。

Error 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:
ruby
begin
  result = client.messages.send_(to: "+13125550001", from: "+13125550002", text: "Hello")
rescue Telnyx::Errors::APIConnectionError
  puts "Network error — check connectivity and retry"
rescue Telnyx::Errors::RateLimitError
  # 429: rate limited — wait and retry with exponential backoff
  sleep(1) # Check Retry-After header for actual delay
rescue Telnyx::Errors::APIStatusError => e
  puts "API error #{e.status}: #{e.message}"
  if e.status == 422
    puts "Validation error — check required fields and formats"
  end
end
Common error codes:
401
invalid API key,
403
insufficient permissions,
404
resource not found,
422
validation error (check field formats),
429
rate limited (retry with exponential backoff).
所有API调用都可能出现网络错误、速率限制(429)、校验错误(422)或身份验证错误(401),生产环境代码中请务必做好错误处理:
ruby
begin
  result = client.messages.send_(to: "+13125550001", from: "+13125550002", text: "Hello")
rescue Telnyx::Errors::APIConnectionError
  puts "网络错误——检查网络连接后重试"
rescue Telnyx::Errors::RateLimitError
  # 429:触发速率限制——等待后采用指数退避策略重试
  sleep(1) # 可查看Retry-After响应头获取具体的延迟时长
rescue Telnyx::Errors::APIStatusError => e
  puts "API错误 #{e.status}: #{e.message}"
  if e.status == 422
    puts "校验错误——检查必填字段和格式是否正确"
  end
end
常见错误码:
401
API密钥无效、
403
权限不足、
404
资源不存在、
422
校验错误(检查字段格式)、
429
触发速率限制(采用指数退避策略重试)。

Important Notes

重要注意事项

  • Pagination: Use
    .auto_paging_each
    for automatic iteration:
    page.auto_paging_each { |item| puts item.id }
    .
  • 分页: 使用
    .auto_paging_each
    实现自动遍历:
    page.auto_paging_each { |item| puts item.id }

Fetch multiple call resources

获取多个通话资源

Returns multiple call resources for an account. This endpoint is eventually consistent.
GET /texml/Accounts/{account_sid}/Calls
ruby
response = client.texml.accounts.calls.retrieve_calls("account_sid")

puts(response)
Returns:
calls
(array[object]),
end
(integer),
first_page_uri
(string),
next_page_uri
(string),
page
(integer),
page_size
(integer),
start
(integer),
uri
(string)
返回账号下的多个通话资源,该接口为最终一致性。
GET /texml/Accounts/{account_sid}/Calls
ruby
response = client.texml.accounts.calls.retrieve_calls("account_sid")

puts(response)
返回参数:
calls
(对象数组)、
end
(整数)、
first_page_uri
(字符串)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
start
(整数)、
uri
(字符串)

Initiate 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}/Calls
— Required:
To
,
From
,
ApplicationSid
Optional:
AsyncAmd
(boolean),
AsyncAmdStatusCallback
(string),
AsyncAmdStatusCallbackMethod
(enum: GET, POST),
CallerId
(string),
CancelPlaybackOnDetectMessageEnd
(boolean),
CancelPlaybackOnMachineDetection
(boolean),
CustomHeaders
(array[object]),
DetectionMode
(enum: Premium, Regular),
FallbackUrl
(string),
MachineDetection
(enum: Enable, Disable, DetectMessageEnd),
MachineDetectionSilenceTimeout
(integer),
MachineDetectionSpeechEndThreshold
(integer),
MachineDetectionSpeechThreshold
(integer),
MachineDetectionTimeout
(integer),
PreferredCodecs
(string),
Record
(boolean),
RecordingChannels
(enum: mono, dual),
RecordingStatusCallback
(string),
RecordingStatusCallbackEvent
(string),
RecordingStatusCallbackMethod
(enum: GET, POST),
RecordingTimeout
(integer),
RecordingTrack
(enum: inbound, outbound, both),
SendRecordingUrl
(boolean),
SipAuthPassword
(string),
SipAuthUsername
(string),
SipRegion
(enum: US, Europe, Canada, Australia, Middle East),
StatusCallback
(string),
StatusCallbackEvent
(enum: initiated, ringing, answered, completed),
StatusCallbackMethod
(enum: GET, POST),
SuperviseCallSid
(string),
SupervisingRole
(enum: barge, whisper, monitor),
Texml
(string),
TimeLimit
(integer),
Timeout
(integer),
Trim
(enum: trim-silence, do-not-trim),
Url
(string),
UrlMethod
(enum: GET, POST)
ruby
response = client.texml.accounts.calls.calls(
  "account_sid",
  application_sid: "example-app-sid",
  from: "+13120001234",
  to: "+13121230000"
)

puts(response)
Returns:
from
(string),
status
(string),
to
(string)
发起TeXML外呼,Telnyx会从Mission Control控制台中为连接配置的XML请求URL获取TeXML内容。
POST /texml/Accounts/{account_sid}/Calls
— 必填参数:
To
From
ApplicationSid
可选参数:
AsyncAmd
(布尔值)、
AsyncAmdStatusCallback
(字符串)、
AsyncAmdStatusCallbackMethod
(枚举值:GET、POST)、
CallerId
(字符串)、
CancelPlaybackOnDetectMessageEnd
(布尔值)、
CancelPlaybackOnMachineDetection
(布尔值)、
CustomHeaders
(对象数组)、
DetectionMode
(枚举值:Premium、Regular)、
FallbackUrl
(字符串)、
MachineDetection
(枚举值:Enable、Disable、DetectMessageEnd)、
MachineDetectionSilenceTimeout
(整数)、
MachineDetectionSpeechEndThreshold
(整数)、
MachineDetectionSpeechThreshold
(整数)、
MachineDetectionTimeout
(整数)、
PreferredCodecs
(字符串)、
Record
(布尔值)、
RecordingChannels
(枚举值:mono、dual)、
RecordingStatusCallback
(字符串)、
RecordingStatusCallbackEvent
(字符串)、
RecordingStatusCallbackMethod
(枚举值:GET、POST)、
RecordingTimeout
(整数)、
RecordingTrack
(枚举值:inbound、outbound、both)、
SendRecordingUrl
(布尔值)、
SipAuthPassword
(字符串)、
SipAuthUsername
(字符串)、
SipRegion
(枚举值:US、Europe、Canada、Australia、Middle East)、
StatusCallback
(字符串)、
StatusCallbackEvent
(枚举值:initiated、ringing、answered、completed)、
StatusCallbackMethod
(枚举值:GET、POST)、
SuperviseCallSid
(字符串)、
SupervisingRole
(枚举值:barge、whisper、monitor)、
Texml
(字符串)、
TimeLimit
(整数)、
Timeout
(整数)、
Trim
(枚举值:trim-silence、do-not-trim)、
Url
(字符串)、
UrlMethod
(枚举值:GET、POST)
ruby
response = client.texml.accounts.calls.calls(
  "account_sid",
  application_sid: "example-app-sid",
  from: "+13120001234",
  to: "+13121230000"
)

puts(response)
返回参数:
from
(字符串)、
status
(字符串)、
to
(字符串)

Fetch a call

获取单条通话信息

Returns an individual call identified by its CallSid. This endpoint is eventually consistent.
GET /texml/Accounts/{account_sid}/Calls/{call_sid}
ruby
call = client.texml.accounts.calls.retrieve("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(call)
Returns:
account_sid
(string),
answered_by
(enum: human, machine, not_sure),
caller_name
(string),
date_created
(string),
date_updated
(string),
direction
(enum: inbound, outbound),
duration
(string),
end_time
(string),
from
(string),
from_formatted
(string),
price
(string),
price_unit
(string),
sid
(string),
start_time
(string),
status
(enum: ringing, in-progress, canceled, completed, failed, busy, no-answer),
to
(string),
to_formatted
(string),
uri
(string)
返回CallSid对应的单条通话信息,该接口为最终一致性。
GET /texml/Accounts/{account_sid}/Calls/{call_sid}
ruby
call = client.texml.accounts.calls.retrieve("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(call)
返回参数:
account_sid
(字符串)、
answered_by
(枚举值:human、machine、not_sure)、
caller_name
(字符串)、
date_created
(字符串)、
date_updated
(字符串)、
direction
(枚举值:inbound、outbound)、
duration
(字符串)、
end_time
(字符串)、
from
(字符串)、
from_formatted
(字符串)、
price
(字符串)、
price_unit
(字符串)、
sid
(字符串)、
start_time
(字符串)、
status
(枚举值:ringing、in-progress、canceled、completed、failed、busy、no-answer)、
to
(字符串)、
to_formatted
(字符串)、
uri
(字符串)

Update 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}
ruby
call = client.texml.accounts.calls.update("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(call)
Returns:
account_sid
(string),
answered_by
(enum: human, machine, not_sure),
caller_name
(string),
date_created
(string),
date_updated
(string),
direction
(enum: inbound, outbound),
duration
(string),
end_time
(string),
from
(string),
from_formatted
(string),
price
(string),
price_unit
(string),
sid
(string),
start_time
(string),
status
(enum: ringing, in-progress, canceled, completed, failed, busy, no-answer),
to
(string),
to_formatted
(string),
uri
(string)
更新TeXML通话信息,请注意请求体中的键必须按照示例所示采用驼峰命名格式。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}
ruby
call = client.texml.accounts.calls.update("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(call)
返回参数:
account_sid
(字符串)、
answered_by
(枚举值:human、machine、not_sure)、
caller_name
(字符串)、
date_created
(字符串)、
date_updated
(字符串)、
direction
(枚举值:inbound、outbound)、
duration
(字符串)、
end_time
(字符串)、
from
(字符串)、
from_formatted
(字符串)、
price
(字符串)、
price_unit
(字符串)、
sid
(字符串)、
start_time
(字符串)、
status
(枚举值:ringing、in-progress、canceled、completed、failed、busy、no-answer)、
to
(字符串)、
to_formatted
(字符串)、
uri
(字符串)

Fetch recordings for a call

获取通话录音列表

Returns recordings for a call identified by call_sid.
GET /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json
ruby
response = client.texml.accounts.calls.recordings_json.retrieve_recordings_json(
  "call_sid",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
Returns:
end
(integer),
first_page_uri
(uri),
next_page_uri
(string),
page
(integer),
page_size
(integer),
previous_page_uri
(uri),
recordings
(array[object]),
start
(integer),
uri
(string)
返回CallSid对应通话的录音列表。
GET /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json
ruby
response = client.texml.accounts.calls.recordings_json.retrieve_recordings_json(
  "call_sid",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
返回参数:
end
(整数)、
first_page_uri
(uri)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
previous_page_uri
(uri)、
recordings
(对象数组)、
start
(整数)、
uri
(字符串)

Request recording for a call

发起通话录音

Starts recording with specified parameters for call identified by call_sid.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json
ruby
response = client.texml.accounts.calls.recordings_json.recordings_json("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
account_sid
(string),
call_sid
(string),
channels
(enum: 1, 2),
conference_sid
(uuid),
date_created
(date-time),
date_updated
(date-time),
duration
(string | null),
error_code
(string | null),
price
(string | null),
price_unit
(string | null),
sid
(string),
source
(enum: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking),
start_time
(date-time),
track
(enum: inbound, outbound, both),
uri
(string)
为指定CallSid的通话按照配置参数启动录音。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json
ruby
response = client.texml.accounts.calls.recordings_json.recordings_json("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回参数:
account_sid
(字符串)、
call_sid
(字符串)、
channels
(枚举值:1、2)、
conference_sid
(uuid)、
date_created
(日期时间)、
date_updated
(日期时间)、
duration
(字符串 | 空)、
error_code
(字符串 | 空)、
price
(字符串 | 空)、
price_unit
(字符串 | 空)、
sid
(字符串)、
source
(枚举值:StartCallRecordingAPI、StartConferenceRecordingAPI、OutboundAPI、DialVerb、Conference、RecordVerb、Trunking)、
start_time
(日期时间)、
track
(枚举值:inbound、outbound、both)、
uri
(字符串)

Update recording on a call

更新通话录音

Updates recording resource for particular call.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings/{recording_sid}.json
ruby
response = client.texml.accounts.calls.recordings.recording_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000",
  call_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
Returns:
account_sid
(string),
call_sid
(string),
channels
(enum: 1, 2),
conference_sid
(uuid),
date_created
(date-time),
date_updated
(date-time),
duration
(string | null),
error_code
(string | null),
price
(string | null),
price_unit
(string | null),
sid
(string),
source
(enum: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking),
start_time
(date-time),
track
(enum: inbound, outbound, both),
uri
(string)
更新指定通话的录音资源。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings/{recording_sid}.json
ruby
response = client.texml.accounts.calls.recordings.recording_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000",
  call_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
返回参数:
account_sid
(字符串)、
call_sid
(字符串)、
channels
(枚举值:1、2)、
conference_sid
(uuid)、
date_created
(日期时间)、
date_updated
(日期时间)、
duration
(字符串 | 空)、
error_code
(字符串 | 空)、
price
(字符串 | 空)、
price_unit
(字符串 | 空)、
sid
(字符串)、
source
(枚举值:StartCallRecordingAPI、StartConferenceRecordingAPI、OutboundAPI、DialVerb、Conference、RecordVerb、Trunking)、
start_time
(日期时间)、
track
(枚举值:inbound、outbound、both)、
uri
(字符串)

Request 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.json
ruby
response = client.texml.accounts.calls.siprec_json("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
account_sid
(string),
call_sid
(string),
date_created
(string),
date_updated
(string),
error_code
(string),
sid
(string),
start_time
(string),
status
(enum: in-progress, stopped),
track
(enum: both_tracks, inbound_track, outbound_track),
uri
(string)
为指定CallSid的通话按照配置参数启动siprec会话。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec.json
ruby
response = client.texml.accounts.calls.siprec_json("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回参数:
account_sid
(字符串)、
call_sid
(字符串)、
date_created
(字符串)、
date_updated
(字符串)、
error_code
(字符串)、
sid
(字符串)、
start_time
(字符串)、
status
(枚举值:in-progress、stopped)、
track
(枚举值:both_tracks、inbound_track、outbound_track)、
uri
(字符串)

Updates siprec session for a call

更新通话siprec会话

Updates siprec session identified by siprec_sid.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec/{siprec_sid}.json
ruby
response = client.texml.accounts.calls.siprec.siprec_sid_json(
  "siprec_sid",
  account_sid: "550e8400-e29b-41d4-a716-446655440000",
  call_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
Returns:
account_sid
(string),
call_sid
(string),
date_updated
(string),
error_code
(string),
sid
(string),
status
(enum: in-progress, stopped),
uri
(string)
更新siprec_sid对应的siprec会话。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec/{siprec_sid}.json
ruby
response = client.texml.accounts.calls.siprec.siprec_sid_json(
  "siprec_sid",
  account_sid: "550e8400-e29b-41d4-a716-446655440000",
  call_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
返回参数:
account_sid
(字符串)、
call_sid
(字符串)、
date_updated
(字符串)、
error_code
(字符串)、
sid
(字符串)、
status
(枚举值:in-progress、stopped)、
uri
(字符串)

Start 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.json
ruby
response = client.texml.accounts.calls.streams_json("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
account_sid
(string),
call_sid
(string),
date_updated
(date-time),
name
(string),
sid
(string),
status
(enum: in-progress),
uri
(string)
将通话的媒体流推送到指定的WebSocket地址。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams.json
ruby
response = client.texml.accounts.calls.streams_json("call_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回参数:
account_sid
(字符串)、
call_sid
(字符串)、
date_updated
(日期时间)、
name
(字符串)、
sid
(字符串)、
status
(枚举值:in-progress)、
uri
(字符串)

Update streaming on a call

更新通话媒体流

Updates streaming resource for particular call.
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams/{streaming_sid}.json
ruby
response = client.texml.accounts.calls.streams.streaming_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000",
  call_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
Returns:
account_sid
(string),
call_sid
(string),
date_updated
(date-time),
sid
(string),
status
(enum: stopped),
uri
(string)
更新指定通话的媒体流资源。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams/{streaming_sid}.json
ruby
response = client.texml.accounts.calls.streams.streaming_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000",
  call_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
返回参数:
account_sid
(字符串)、
call_sid
(字符串)、
date_updated
(日期时间)、
sid
(字符串)、
status
(枚举值:stopped)、
uri
(字符串)

List conference resources

获取会议资源列表

Lists conference resources.
GET /texml/Accounts/{account_sid}/Conferences
ruby
response = client.texml.accounts.conferences.retrieve_conferences("account_sid")

puts(response)
Returns:
conferences
(array[object]),
end
(integer),
first_page_uri
(string),
next_page_uri
(string),
page
(integer),
page_size
(integer),
start
(integer),
uri
(string)
返回会议资源列表。
GET /texml/Accounts/{account_sid}/Conferences
ruby
response = client.texml.accounts.conferences.retrieve_conferences("account_sid")

puts(response)
返回参数:
conferences
(对象数组)、
end
(整数)、
first_page_uri
(字符串)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
start
(整数)、
uri
(字符串)

Fetch a conference resource

获取单条会议资源

Returns a conference resource.
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}
ruby
conference = client.texml.accounts.conferences.retrieve("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(conference)
Returns:
account_sid
(string),
api_version
(string),
call_sid_ending_conference
(string),
date_created
(string),
date_updated
(string),
friendly_name
(string),
reason_conference_ended
(enum: participant-with-end-conference-on-exit-left, last-participant-left, conference-ended-via-api, time-exceeded),
region
(string),
sid
(string),
status
(enum: init, in-progress, completed),
subresource_uris
(object),
uri
(string)
返回指定的会议资源。
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}
ruby
conference = client.texml.accounts.conferences.retrieve("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(conference)
返回参数:
account_sid
(字符串)、
api_version
(字符串)、
call_sid_ending_conference
(字符串)、
date_created
(字符串)、
date_updated
(字符串)、
friendly_name
(字符串)、
reason_conference_ended
(枚举值:participant-with-end-conference-on-exit-left、last-participant-left、conference-ended-via-api、time-exceeded)、
region
(字符串)、
sid
(字符串)、
status
(枚举值:init、in-progress、completed)、
subresource_uris
(对象)、
uri
(字符串)

Update a conference resource

更新会议资源

Updates a conference resource.
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}
ruby
conference = client.texml.accounts.conferences.update("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(conference)
Returns:
account_sid
(string),
api_version
(string),
call_sid_ending_conference
(string),
date_created
(string),
date_updated
(string),
friendly_name
(string),
reason_conference_ended
(enum: participant-with-end-conference-on-exit-left, last-participant-left, conference-ended-via-api, time-exceeded),
region
(string),
sid
(string),
status
(enum: init, in-progress, completed),
subresource_uris
(object),
uri
(string)
更新指定的会议资源。
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}
ruby
conference = client.texml.accounts.conferences.update("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(conference)
返回参数:
account_sid
(字符串)、
api_version
(字符串)、
call_sid_ending_conference
(字符串)、
date_created
(字符串)、
date_updated
(字符串)、
friendly_name
(字符串)、
reason_conference_ended
(枚举值:participant-with-end-conference-on-exit-left、last-participant-left、conference-ended-via-api、time-exceeded)、
region
(字符串)、
sid
(字符串)、
status
(枚举值:init、in-progress、completed)、
subresource_uris
(对象)、
uri
(字符串)

List conference participants

获取会议参会者列表

Lists conference participants
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants
ruby
response = client.texml.accounts.conferences.participants.retrieve_participants(
  "conference_sid",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
Returns:
end
(integer),
first_page_uri
(string),
next_page_uri
(string),
page
(integer),
page_size
(integer),
participants
(array[object]),
start
(integer),
uri
(string)
返回会议参会者列表。
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants
ruby
response = client.texml.accounts.conferences.participants.retrieve_participants(
  "conference_sid",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
返回参数:
end
(整数)、
first_page_uri
(字符串)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
participants
(对象数组)、
start
(整数)、
uri
(字符串)

Dial a new conference participant

邀请新的参会者加入会议

Dials a new conference participant
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants
ruby
response = client.texml.accounts.conferences.participants.participants("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
account_sid
(string),
call_sid
(string),
coaching
(boolean),
coaching_call_sid
(string),
conference_sid
(uuid),
end_conference_on_exit
(boolean),
hold
(boolean),
muted
(boolean),
status
(enum: connecting, connected, completed),
uri
(string)
拨号邀请新的参会者加入会议。
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants
ruby
response = client.texml.accounts.conferences.participants.participants("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回参数:
account_sid
(字符串)、
call_sid
(字符串)、
coaching
(布尔值)、
coaching_call_sid
(字符串)、
conference_sid
(uuid)、
end_conference_on_exit
(布尔值)、
hold
(布尔值)、
muted
(布尔值)、
status
(枚举值:connecting、connected、completed)、
uri
(字符串)

Get conference participant resource

获取会议参会者信息

Gets conference participant resource
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}
ruby
participant = 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"
)

puts(participant)
Returns:
account_sid
(string),
api_version
(string),
call_sid
(string),
call_sid_legacy
(string),
coaching
(boolean),
coaching_call_sid
(string),
coaching_call_sid_legacy
(string),
conference_sid
(uuid),
date_created
(string),
date_updated
(string),
end_conference_on_exit
(boolean),
hold
(boolean),
muted
(boolean),
status
(enum: connecting, connected, completed),
uri
(string)
返回指定的会议参会者资源。
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}
ruby
participant = 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"
)

puts(participant)
返回参数:
account_sid
(字符串)、
api_version
(字符串)、
call_sid
(字符串)、
call_sid_legacy
(字符串)、
coaching
(布尔值)、
coaching_call_sid
(字符串)、
coaching_call_sid_legacy
(字符串)、
conference_sid
(uuid)、
date_created
(字符串)、
date_updated
(字符串)、
end_conference_on_exit
(布尔值)、
hold
(布尔值)、
muted
(布尔值)、
status
(枚举值:connecting、connected、completed)、
uri
(字符串)

Update a conference participant

更新会议参会者信息

Updates a conference participant
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}
ruby
participant = 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"
)

puts(participant)
Returns:
account_sid
(string),
api_version
(string),
call_sid
(string),
call_sid_legacy
(string),
coaching
(boolean),
coaching_call_sid
(string),
coaching_call_sid_legacy
(string),
conference_sid
(uuid),
date_created
(string),
date_updated
(string),
end_conference_on_exit
(boolean),
hold
(boolean),
muted
(boolean),
status
(enum: connecting, connected, completed),
uri
(string)
更新指定的会议参会者信息。
POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}
ruby
participant = 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"
)

puts(participant)
返回参数:
account_sid
(字符串)、
api_version
(字符串)、
call_sid
(字符串)、
call_sid_legacy
(字符串)、
coaching
(布尔值)、
coaching_call_sid
(字符串)、
coaching_call_sid_legacy
(字符串)、
conference_sid
(uuid)、
date_created
(字符串)、
date_updated
(字符串)、
end_conference_on_exit
(布尔值)、
hold
(布尔值)、
muted
(布尔值)、
status
(枚举值:connecting、connected、completed)、
uri
(字符串)

Delete a conference participant

移除会议参会者

Deletes a conference participant
DELETE /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}
ruby
result = 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"
)

puts(result)
将指定参会者移出会议。
DELETE /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}
ruby
result = 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"
)

puts(result)

List conference recordings

获取会议录音列表

Lists conference recordings
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordings
ruby
response = client.texml.accounts.conferences.retrieve_recordings("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
end
(integer),
first_page_uri
(string),
next_page_uri
(string),
page
(integer),
page_size
(integer),
participants
(array[object]),
recordings
(array[object]),
start
(integer),
uri
(string)
返回会议录音列表。
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordings
ruby
response = client.texml.accounts.conferences.retrieve_recordings("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回参数:
end
(整数)、
first_page_uri
(字符串)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
participants
(对象数组)、
recordings
(对象数组)、
start
(整数)、
uri
(字符串)

Fetch recordings for a conference

获取会议录音资源

Returns recordings for a conference identified by conference_sid.
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordings.json
ruby
response = client.texml.accounts.conferences.retrieve_recordings_json("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
end
(integer),
first_page_uri
(uri),
next_page_uri
(string),
page
(integer),
page_size
(integer),
previous_page_uri
(uri),
recordings
(array[object]),
start
(integer),
uri
(string)
返回conference_sid对应会议的录音列表。
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordings.json
ruby
response = client.texml.accounts.conferences.retrieve_recordings_json("conference_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回参数:
end
(整数)、
first_page_uri
(uri)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
previous_page_uri
(uri)、
recordings
(对象数组)、
start
(整数)、
uri
(字符串)

List queue resources

获取队列资源列表

Lists queue resources.
GET /texml/Accounts/{account_sid}/Queues
ruby
page = client.texml.accounts.queues.list("account_sid")

puts(page)
Returns:
end
(integer),
first_page_uri
(string),
next_page_uri
(string),
page
(integer),
page_size
(integer),
queues
(array[object]),
start
(integer),
uri
(string)
返回队列资源列表。
GET /texml/Accounts/{account_sid}/Queues
ruby
page = client.texml.accounts.queues.list("account_sid")

puts(page)
返回参数:
end
(整数)、
first_page_uri
(字符串)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
queues
(对象数组)、
start
(整数)、
uri
(字符串)

Create a new queue

创建队列

Creates a new queue resource.
POST /texml/Accounts/{account_sid}/Queues
ruby
queue = client.texml.accounts.queues.create("account_sid")

puts(queue)
Returns:
account_sid
(string),
average_wait_time
(integer),
current_size
(integer),
date_created
(string),
date_updated
(string),
max_size
(integer),
sid
(string),
subresource_uris
(object),
uri
(string)
创建新的队列资源。
POST /texml/Accounts/{account_sid}/Queues
ruby
queue = client.texml.accounts.queues.create("account_sid")

puts(queue)
返回参数:
account_sid
(字符串)、
average_wait_time
(整数)、
current_size
(整数)、
date_created
(字符串)、
date_updated
(字符串)、
max_size
(整数)、
sid
(字符串)、
subresource_uris
(对象)、
uri
(字符串)

Fetch a queue resource

获取单条队列资源

Returns a queue resource.
GET /texml/Accounts/{account_sid}/Queues/{queue_sid}
ruby
queue = client.texml.accounts.queues.retrieve("queue_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(queue)
Returns:
account_sid
(string),
average_wait_time
(integer),
current_size
(integer),
date_created
(string),
date_updated
(string),
max_size
(integer),
sid
(string),
subresource_uris
(object),
uri
(string)
返回指定的队列资源。
GET /texml/Accounts/{account_sid}/Queues/{queue_sid}
ruby
queue = client.texml.accounts.queues.retrieve("queue_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(queue)
返回参数:
account_sid
(字符串)、
average_wait_time
(整数)、
current_size
(整数)、
date_created
(字符串)、
date_updated
(字符串)、
max_size
(整数)、
sid
(字符串)、
subresource_uris
(对象)、
uri
(字符串)

Update a queue resource

更新队列资源

Updates a queue resource.
POST /texml/Accounts/{account_sid}/Queues/{queue_sid}
ruby
queue = client.texml.accounts.queues.update("queue_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(queue)
Returns:
account_sid
(string),
average_wait_time
(integer),
current_size
(integer),
date_created
(string),
date_updated
(string),
max_size
(integer),
sid
(string),
subresource_uris
(object),
uri
(string)
更新指定的队列资源。
POST /texml/Accounts/{account_sid}/Queues/{queue_sid}
ruby
queue = client.texml.accounts.queues.update("queue_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(queue)
返回参数:
account_sid
(字符串)、
average_wait_time
(整数)、
current_size
(整数)、
date_created
(字符串)、
date_updated
(字符串)、
max_size
(整数)、
sid
(字符串)、
subresource_uris
(对象)、
uri
(字符串)

Delete a queue resource

删除队列资源

Delete a queue resource.
DELETE /texml/Accounts/{account_sid}/Queues/{queue_sid}
ruby
result = client.texml.accounts.queues.delete("queue_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(result)
删除指定的队列资源。
DELETE /texml/Accounts/{account_sid}/Queues/{queue_sid}
ruby
result = client.texml.accounts.queues.delete("queue_sid", account_sid: "550e8400-e29b-41d4-a716-446655440000")

puts(result)

Fetch multiple recording resources

获取账号录音资源列表

Returns multiple recording resources for an account.
GET /texml/Accounts/{account_sid}/Recordings.json
ruby
response = client.texml.accounts.retrieve_recordings_json("account_sid")

puts(response)
Returns:
end
(integer),
first_page_uri
(uri),
next_page_uri
(string),
page
(integer),
page_size
(integer),
previous_page_uri
(uri),
recordings
(array[object]),
start
(integer),
uri
(string)
返回账号下的多个录音资源。
GET /texml/Accounts/{account_sid}/Recordings.json
ruby
response = client.texml.accounts.retrieve_recordings_json("account_sid")

puts(response)
返回参数:
end
(整数)、
first_page_uri
(uri)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
previous_page_uri
(uri)、
recordings
(对象数组)、
start
(整数)、
uri
(字符串)

Fetch recording resource

获取单条录音资源

Returns recording resource identified by recording id.
GET /texml/Accounts/{account_sid}/Recordings/{recording_sid}.json
ruby
texml_get_call_recording_response_body = client.texml.accounts.recordings.json.retrieve_recording_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(texml_get_call_recording_response_body)
Returns:
account_sid
(string),
call_sid
(string),
channels
(enum: 1, 2),
conference_sid
(uuid),
date_created
(date-time),
date_updated
(date-time),
duration
(string | null),
error_code
(string | null),
media_url
(uri),
sid
(string),
source
(enum: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking),
start_time
(date-time),
status
(enum: in-progress, completed, paused, stopped),
subresources_uris
(object),
uri
(string)
返回指定ID对应的录音资源。
GET /texml/Accounts/{account_sid}/Recordings/{recording_sid}.json
ruby
texml_get_call_recording_response_body = client.texml.accounts.recordings.json.retrieve_recording_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(texml_get_call_recording_response_body)
返回参数:
account_sid
(字符串)、
call_sid
(字符串)、
channels
(枚举值:1、2)、
conference_sid
(uuid)、
date_created
(日期时间)、
date_updated
(日期时间)、
duration
(字符串 | 空)、
error_code
(字符串 | 空)、
media_url
(uri)、
sid
(字符串)、
source
(枚举值:StartCallRecordingAPI、StartConferenceRecordingAPI、OutboundAPI、DialVerb、Conference、RecordVerb、Trunking)、
start_time
(日期时间)、
status
(枚举值:in-progress、completed、paused、stopped)、
subresources_uris
(对象)、
uri
(字符串)

Delete recording resource

删除录音资源

Deletes recording resource identified by recording id.
DELETE /texml/Accounts/{account_sid}/Recordings/{recording_sid}.json
ruby
result = client.texml.accounts.recordings.json.delete_recording_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(result)
删除指定ID对应的录音资源。
DELETE /texml/Accounts/{account_sid}/Recordings/{recording_sid}.json
ruby
result = client.texml.accounts.recordings.json.delete_recording_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(result)

List recording transcriptions

获取录音转写列表

Returns multiple recording transcription resources for an account.
GET /texml/Accounts/{account_sid}/Transcriptions.json
ruby
response = client.texml.accounts.retrieve_transcriptions_json("account_sid")

puts(response)
Returns:
end
(integer),
first_page_uri
(uri),
next_page_uri
(string),
page
(integer),
page_size
(integer),
previous_page_uri
(uri),
start
(integer),
transcriptions
(array[object]),
uri
(string)
返回账号下的多个录音转写资源。
GET /texml/Accounts/{account_sid}/Transcriptions.json
ruby
response = client.texml.accounts.retrieve_transcriptions_json("account_sid")

puts(response)
返回参数:
end
(整数)、
first_page_uri
(uri)、
next_page_uri
(字符串)、
page
(整数)、
page_size
(整数)、
previous_page_uri
(uri)、
start
(整数)、
transcriptions
(对象数组)、
uri
(字符串)

Fetch a recording transcription resource

获取单条录音转写资源

Returns the recording transcription resource identified by its ID.
GET /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.json
ruby
response = client.texml.accounts.transcriptions.json.retrieve_recording_transcription_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
Returns:
account_sid
(string),
api_version
(string),
call_sid
(string),
date_created
(date-time),
date_updated
(date-time),
duration
(string | null),
recording_sid
(string),
sid
(string),
status
(enum: in-progress, completed),
transcription_text
(string),
uri
(string)
返回指定ID对应的录音转写资源。
GET /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.json
ruby
response = client.texml.accounts.transcriptions.json.retrieve_recording_transcription_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(response)
返回参数:
account_sid
(字符串)、
api_version
(字符串)、
call_sid
(字符串)、
date_created
(日期时间)、
date_updated
(日期时间)、
duration
(字符串 | 空)、
recording_sid
(字符串)、
sid
(字符串)、
status
(枚举值:in-progress、completed)、
transcription_text
(字符串)、
uri
(字符串)

Delete a recording transcription

删除录音转写资源

Permanently deletes a recording transcription.
DELETE /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.json
ruby
result = client.texml.accounts.transcriptions.json.delete_recording_transcription_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(result)
永久删除指定的录音转写资源。
DELETE /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.json
ruby
result = client.texml.accounts.transcriptions.json.delete_recording_transcription_sid_json(
  "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
  account_sid: "550e8400-e29b-41d4-a716-446655440000"
)

puts(result)

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/secrets
— Required:
name
,
value
ruby
response = client.texml.secrets(name: "My Secret Name", value: "My Secret Value")

puts(response)
Returns:
name
(string),
value
(enum: REDACTED)
创建TeXML密钥,后续在TeXML中使用Mustache模板时可将其作为动态参数使用。你可以在TeXML中使用密钥的名称,Telnyx处理TeXML时会将名称替换为实际的密钥值,密钥不会出现在任何日志中。
POST /texml/secrets
— 必填参数:
name
value
ruby
response = client.texml.secrets(name: "My Secret Name", value: "My Secret Value")

puts(response)
返回参数:
name
(字符串)、
value
(枚举值:REDACTED)

List all TeXML Applications

获取所有TeXML应用列表

Returns a list of your TeXML Applications.
GET /texml_applications
ruby
page = client.texml_applications.list

puts(page)
Returns:
active
(boolean),
anchorsite_override
(enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany),
call_cost_in_webhooks
(boolean),
created_at
(string),
dtmf_type
(enum: RFC 2833, Inband, SIP INFO),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
friendly_name
(string),
id
(string),
inbound
(object),
outbound
(object),
record_type
(string),
status_callback
(uri),
status_callback_method
(enum: get, post),
tags
(array[string]),
updated_at
(string),
voice_fallback_url
(uri),
voice_method
(enum: get, post),
voice_url
(uri)
返回你的TeXML应用列表。
GET /texml_applications
ruby
page = client.texml_applications.list

puts(page)
返回参数:
active
(布尔值)、
anchorsite_override
(枚举值:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany)、
call_cost_in_webhooks
(布尔值)、
created_at
(字符串)、
dtmf_type
(枚举值:RFC 2833、Inband、SIP INFO)、
first_command_timeout
(布尔值)、
first_command_timeout_secs
(整数)、
friendly_name
(字符串)、
id
(字符串)、
inbound
(对象)、
outbound
(对象)、
record_type
(字符串)、
status_callback
(uri)、
status_callback_method
(枚举值:get、post)、
tags
(字符串数组)、
updated_at
(字符串)、
voice_fallback_url
(uri)、
voice_method
(枚举值:get、post)、
voice_url
(uri)

Creates a TeXML Application

创建TeXML应用

Creates a TeXML Application.
POST /texml_applications
— Required:
friendly_name
,
voice_url
Optional:
active
(boolean),
anchorsite_override
(enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany),
call_cost_in_webhooks
(boolean),
dtmf_type
(enum: RFC 2833, Inband, SIP INFO),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
inbound
(object),
outbound
(object),
status_callback
(uri),
status_callback_method
(enum: get, post),
tags
(array[string]),
voice_fallback_url
(uri),
voice_method
(enum: get, post)
ruby
texml_application = client.texml_applications.create(friendly_name: "call-router", voice_url: "https://example.com")

puts(texml_application)
Returns:
active
(boolean),
anchorsite_override
(enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany),
call_cost_in_webhooks
(boolean),
created_at
(string),
dtmf_type
(enum: RFC 2833, Inband, SIP INFO),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
friendly_name
(string),
id
(string),
inbound
(object),
outbound
(object),
record_type
(string),
status_callback
(uri),
status_callback_method
(enum: get, post),
tags
(array[string]),
updated_at
(string),
voice_fallback_url
(uri),
voice_method
(enum: get, post),
voice_url
(uri)
创建新的TeXML应用。
POST /texml_applications
— 必填参数:
friendly_name
voice_url
可选参数:
active
(布尔值)、
anchorsite_override
(枚举值:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany)、
call_cost_in_webhooks
(布尔值)、
dtmf_type
(枚举值:RFC 2833、Inband、SIP INFO)、
first_command_timeout
(布尔值)、
first_command_timeout_secs
(整数)、
inbound
(对象)、
outbound
(对象)、
status_callback
(uri)、
status_callback_method
(枚举值:get、post)、
tags
(字符串数组)、
voice_fallback_url
(uri)、
voice_method
(枚举值:get、post)
ruby
texml_application = client.texml_applications.create(friendly_name: "call-router", voice_url: "https://example.com")

puts(texml_application)
返回参数:
active
(布尔值)、
anchorsite_override
(枚举值:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany)、
call_cost_in_webhooks
(布尔值)、
created_at
(字符串)、
dtmf_type
(枚举值:RFC 2833、Inband、SIP INFO)、
first_command_timeout
(布尔值)、
first_command_timeout_secs
(整数)、
friendly_name
(字符串)、
id
(字符串)、
inbound
(对象)、
outbound
(对象)、
record_type
(字符串)、
status_callback
(uri)、
status_callback_method
(枚举值:get、post)、
tags
(字符串数组)、
updated_at
(字符串)、
voice_fallback_url
(uri)、
voice_method
(枚举值:get、post)、
voice_url
(uri)

Retrieve a TeXML Application

获取TeXML应用详情

Retrieves the details of an existing TeXML Application.
GET /texml_applications/{id}
ruby
texml_application = client.texml_applications.retrieve("1293384261075731499")

puts(texml_application)
Returns:
active
(boolean),
anchorsite_override
(enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany),
call_cost_in_webhooks
(boolean),
created_at
(string),
dtmf_type
(enum: RFC 2833, Inband, SIP INFO),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
friendly_name
(string),
id
(string),
inbound
(object),
outbound
(object),
record_type
(string),
status_callback
(uri),
status_callback_method
(enum: get, post),
tags
(array[string]),
updated_at
(string),
voice_fallback_url
(uri),
voice_method
(enum: get, post),
voice_url
(uri)
返回现有TeXML应用的详细信息。
GET /texml_applications/{id}
ruby
texml_application = client.texml_applications.retrieve("1293384261075731499")

puts(texml_application)
返回参数:
active
(布尔值)、
anchorsite_override
(枚举值:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany)、
call_cost_in_webhooks
(布尔值)、
created_at
(字符串)、
dtmf_type
(枚举值:RFC 2833、Inband、SIP INFO)、
first_command_timeout
(布尔值)、
first_command_timeout_secs
(整数)、
friendly_name
(字符串)、
id
(字符串)、
inbound
(对象)、
outbound
(对象)、
record_type
(字符串)、
status_callback
(uri)、
status_callback_method
(枚举值:get、post)、
tags
(字符串数组)、
updated_at
(字符串)、
voice_fallback_url
(uri)、
voice_method
(枚举值:get、post)、
voice_url
(uri)

Update a TeXML Application

更新TeXML应用

Updates settings of an existing TeXML Application.
PATCH /texml_applications/{id}
— Required:
friendly_name
,
voice_url
Optional:
active
(boolean),
anchorsite_override
(enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany),
call_cost_in_webhooks
(boolean),
dtmf_type
(enum: RFC 2833, Inband, SIP INFO),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
inbound
(object),
outbound
(object),
status_callback
(uri),
status_callback_method
(enum: get, post),
tags
(array[string]),
voice_fallback_url
(uri),
voice_method
(enum: get, post)
ruby
texml_application = client.texml_applications.update(
  "1293384261075731499",
  friendly_name: "call-router",
  voice_url: "https://example.com"
)

puts(texml_application)
Returns:
active
(boolean),
anchorsite_override
(enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany),
call_cost_in_webhooks
(boolean),
created_at
(string),
dtmf_type
(enum: RFC 2833, Inband, SIP INFO),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
friendly_name
(string),
id
(string),
inbound
(object),
outbound
(object),
record_type
(string),
status_callback
(uri),
status_callback_method
(enum: get, post),
tags
(array[string]),
updated_at
(string),
voice_fallback_url
(uri),
voice_method
(enum: get, post),
voice_url
(uri)
更新现有TeXML应用的配置。
PATCH /texml_applications/{id}
— 必填参数:
friendly_name
voice_url
可选参数:
active
(布尔值)、
anchorsite_override
(枚举值:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany)、
call_cost_in_webhooks
(布尔值)、
dtmf_type
(枚举值:RFC 2833、Inband、SIP INFO)、
first_command_timeout
(布尔值)、
first_command_timeout_secs
(整数)、
inbound
(对象)、
outbound
(对象)、
status_callback
(uri)、
status_callback_method
(枚举值:get、post)、
tags
(字符串数组)、
voice_fallback_url
(uri)、
voice_method
(枚举值:get、post)
ruby
texml_application = client.texml_applications.update(
  "1293384261075731499",
  friendly_name: "call-router",
  voice_url: "https://example.com"
)

puts(texml_application)
返回参数:
active
(布尔值)、
anchorsite_override
(枚举值:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany)、
call_cost_in_webhooks
(布尔值)、
created_at
(字符串)、
dtmf_type
(枚举值:RFC 2833、Inband、SIP INFO)、
first_command_timeout
(布尔值)、
first_command_timeout_secs
(整数)、
friendly_name
(字符串)、
id
(字符串)、
inbound
(对象)、
outbound
(对象)、
record_type
(字符串)、
status_callback
(uri)、
status_callback_method
(枚举值:get、post)、
tags
(字符串数组)、
updated_at
(字符串)、
voice_fallback_url
(uri)、
voice_method
(枚举值:get、post)、
voice_url
(uri)

Deletes a TeXML Application

删除TeXML应用

Deletes a TeXML Application.
DELETE /texml_applications/{id}
ruby
texml_application = client.texml_applications.delete("1293384261075731499")

puts(texml_application)
Returns:
active
(boolean),
anchorsite_override
(enum: Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany),
call_cost_in_webhooks
(boolean),
created_at
(string),
dtmf_type
(enum: RFC 2833, Inband, SIP INFO),
first_command_timeout
(boolean),
first_command_timeout_secs
(integer),
friendly_name
(string),
id
(string),
inbound
(object),
outbound
(object),
record_type
(string),
status_callback
(uri),
status_callback_method
(enum: get, post),
tags
(array[string]),
updated_at
(string),
voice_fallback_url
(uri),
voice_method
(enum: get, post),
voice_url
(uri)
删除指定的TeXML应用。
DELETE /texml_applications/{id}
ruby
texml_application = client.texml_applications.delete("1293384261075731499")

puts(texml_application)
返回参数:
active
(布尔值)、
anchorsite_override
(枚举值:Latency、Chicago, IL、Ashburn, VA、San Jose, CA、Sydney, Australia、Amsterdam, Netherlands、London, UK、Toronto, Canada、Vancouver, Canada、Frankfurt, Germany)、
call_cost_in_webhooks
(布尔值)、
created_at
(字符串)、
dtmf_type
(枚举值:RFC 2833、Inband、SIP INFO)、
first_command_timeout
(布尔值)、
first_command_timeout_secs
(整数)、
friendly_name
(字符串)、
id
(字符串)、
inbound
(对象)、
outbound
(对象)、
record_type
(字符串)、
status_callback
(uri)、
status_callback_method
(枚举值:get、post)、
tags
(字符串数组)、
updated_at
(字符串)、
voice_fallback_url
(uri)、
voice_method
(枚举值:get、post)、
voice_url
(uri)