telnyx-texml-go
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 从Telnyx OpenAPI规范自动生成,请勿编辑。 -->
Telnyx Texml - Go
Telnyx Texml - Go
Installation
安装
bash
go get github.com/team-telnyx/telnyx-gobash
go get github.com/team-telnyx/telnyx-goSetup
环境配置
go
import (
"context"
"fmt"
"os"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
client := telnyx.NewClient(
option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)All examples below assume is already initialized as shown above.
clientgo
import (
"context"
"fmt"
"os"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
client := telnyx.NewClient(
option.WithAPIKey(os.Getenv("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:
go
import "errors"
result, err := client.Messages.Send(ctx, params)
if err != nil {
var apiErr *telnyx.Error
if errors.As(err, &apiErr) {
switch apiErr.StatusCode {
case 422:
fmt.Println("Validation error — check required fields and formats")
case 429:
// Rate limited — wait and retry with exponential backoff
fmt.Println("Rate limited, retrying...")
default:
fmt.Printf("API error %d: %s\n", apiErr.StatusCode, apiErr.Error())
}
} else {
fmt.Println("Network error — check connectivity and retry")
}
}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)。在生产环境代码中请务必做好错误处理:
go
import "errors"
result, err := client.Messages.Send(ctx, params)
if err != nil {
var apiErr *telnyx.Error
if errors.As(err, &apiErr) {
switch apiErr.StatusCode {
case 422:
fmt.Println("Validation error — check required fields and formats")
case 429:
// Rate limited — wait and retry with exponential backoff
fmt.Println("Rate limited, retrying...")
default:
fmt.Printf("API error %d: %s\n", apiErr.StatusCode, apiErr.Error())
}
} else {
fmt.Println("Network error — check connectivity and retry")
}
}常见错误码: API密钥无效, 权限不足, 资源不存在, 验证错误(请检查字段格式), 触发限流(请使用指数退避策略重试)。
401403404422429Important Notes
重要说明
- Pagination: Use for automatic iteration:
ListAutoPaging().iter := client.Resource.ListAutoPaging(ctx, params); for iter.Next() { item := iter.Current() }
- 分页: 使用实现自动遍历:
ListAutoPaging()。iter := client.Resource.ListAutoPaging(ctx, params); for iter.Next() { item := iter.Current() }
Fetch multiple call resources
获取多个通话资源
Returns multiple call resources for an account. This endpoint is eventually consistent.
GET /texml/Accounts/{account_sid}/Callsgo
response, err := client.Texml.Accounts.Calls.GetCalls(
context.Background(),
"account_sid",
telnyx.TexmlAccountCallGetCallsParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Calls)Returns: (array[object]), (integer), (string), (string), (integer), (integer), (integer), (string)
callsendfirst_page_urinext_page_uripagepage_sizestarturi返回当前账号下的多个通话资源,该接口为最终一致性。
GET /texml/Accounts/{account_sid}/Callsgo
response, err := client.Texml.Accounts.Calls.GetCalls(
context.Background(),
"account_sid",
telnyx.TexmlAccountCallGetCallsParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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)
AsyncAmdAsyncAmdStatusCallbackAsyncAmdStatusCallbackMethodCallerIdCancelPlaybackOnDetectMessageEndCancelPlaybackOnMachineDetectionCustomHeadersDetectionModeFallbackUrlMachineDetectionMachineDetectionSilenceTimeoutMachineDetectionSpeechEndThresholdMachineDetectionSpeechThresholdMachineDetectionTimeoutPreferredCodecsRecordRecordingChannelsRecordingStatusCallbackRecordingStatusCallbackEventRecordingStatusCallbackMethodRecordingTimeoutRecordingTrackSendRecordingUrlSipAuthPasswordSipAuthUsernameSipRegionStatusCallbackStatusCallbackEventStatusCallbackMethodSuperviseCallSidSupervisingRoleTexmlTimeLimitTimeoutTrimUrlUrlMethodgo
response, err := client.Texml.Accounts.Calls.Calls(
context.Background(),
"account_sid",
telnyx.TexmlAccountCallCallsParams{
ApplicationSid: "example-app-sid",
From: "+13120001234",
To: "+13121230000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.From)Returns: (string), (string), (string)
fromstatusto发起一个TeXML外呼,Telnyx会从Mission Control Portal中为该连接配置的XML请求地址获取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)
AsyncAmdAsyncAmdStatusCallbackAsyncAmdStatusCallbackMethodCallerIdCancelPlaybackOnDetectMessageEndCancelPlaybackOnMachineDetectionCustomHeadersDetectionModeFallbackUrlMachineDetectionMachineDetectionSilenceTimeoutMachineDetectionSpeechEndThresholdMachineDetectionSpeechThresholdMachineDetectionTimeoutPreferredCodecsRecordRecordingChannelsRecordingStatusCallbackRecordingStatusCallbackEventRecordingStatusCallbackMethodRecordingTimeoutRecordingTrackSendRecordingUrlSipAuthPasswordSipAuthUsernameSipRegionStatusCallbackStatusCallbackEventStatusCallbackMethodSuperviseCallSidSupervisingRoleTexmlTimeLimitTimeoutTrimUrlUrlMethodgo
response, err := client.Texml.Accounts.Calls.Calls(
context.Background(),
"account_sid",
telnyx.TexmlAccountCallCallsParams{
ApplicationSid: "example-app-sid",
From: "+13120001234",
To: "+13121230000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}go
call, err := client.Texml.Accounts.Calls.Get(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallGetParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", call.AccountSid)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}go
call, err := client.Texml.Accounts.Calls.Get(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallGetParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", call.AccountSid)返回参数: (字符串), (枚举值: 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}go
call, err := client.Texml.Accounts.Calls.Update(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallUpdateParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
UpdateCall: telnyx.UpdateCallParam{},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", call.AccountSid)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}go
call, err := client.Texml.Accounts.Calls.Update(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallUpdateParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
UpdateCall: telnyx.UpdateCallParam{},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", call.AccountSid)返回参数: (字符串), (枚举值: 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.jsongo
response, err := client.Texml.Accounts.Calls.RecordingsJson.GetRecordingsJson(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallRecordingsJsonGetRecordingsJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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.jsongo
response, err := client.Texml.Accounts.Calls.RecordingsJson.GetRecordingsJson(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallRecordingsJsonGetRecordingsJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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.jsongo
response, err := client.Texml.Accounts.Calls.RecordingsJson.RecordingsJson(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallRecordingsJsonRecordingsJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)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.jsongo
response, err := client.Texml.Accounts.Calls.RecordingsJson.RecordingsJson(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallRecordingsJsonRecordingsJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)返回参数: (字符串), (字符串), (枚举值: 1, 2), (uuid), (日期时间), (日期时间), (字符串 | 空), (字符串 | 空), (字符串 | 空), (字符串 | 空), (字符串), (枚举值: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking), (日期时间), (枚举值: 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}.jsongo
response, err := client.Texml.Accounts.Calls.Recordings.RecordingSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountCallRecordingRecordingSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
CallSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)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}.jsongo
response, err := client.Texml.Accounts.Calls.Recordings.RecordingSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountCallRecordingRecordingSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
CallSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)返回参数: (字符串), (字符串), (枚举值: 1, 2), (uuid), (日期时间), (日期时间), (字符串 | 空), (字符串 | 空), (字符串 | 空), (字符串 | 空), (字符串), (枚举值: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking), (日期时间), (枚举值: 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.jsongo
response, err := client.Texml.Accounts.Calls.SiprecJson(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallSiprecJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)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.jsongo
response, err := client.Texml.Accounts.Calls.SiprecJson(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallSiprecJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)返回参数: (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (枚举值: 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}.jsongo
response, err := client.Texml.Accounts.Calls.Siprec.SiprecSidJson(
context.Background(),
"siprec_sid",
telnyx.TexmlAccountCallSiprecSiprecSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
CallSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)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}.jsongo
response, err := client.Texml.Accounts.Calls.Siprec.SiprecSidJson(
context.Background(),
"siprec_sid",
telnyx.TexmlAccountCallSiprecSiprecSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
CallSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)返回参数: (字符串), (字符串), (字符串), (字符串), (字符串), (枚举值: 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.jsongo
response, err := client.Texml.Accounts.Calls.StreamsJson(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallStreamsJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)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.jsongo
response, err := client.Texml.Accounts.Calls.StreamsJson(
context.Background(),
"call_sid",
telnyx.TexmlAccountCallStreamsJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)返回参数: (字符串), (字符串), (日期时间), (字符串), (字符串), (枚举值: 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}.jsongo
response, err := client.Texml.Accounts.Calls.Streams.StreamingSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountCallStreamStreamingSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
CallSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)Returns: (string), (string), (date-time), (string), (enum: stopped), (string)
account_sidcall_siddate_updatedsidstatusuri更新指定通话的媒体流资源。
POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams/{streaming_sid}.jsongo
response, err := client.Texml.Accounts.Calls.Streams.StreamingSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountCallStreamStreamingSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
CallSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)返回参数: (字符串), (字符串), (日期时间), (字符串), (枚举值: stopped), (字符串)
account_sidcall_siddate_updatedsidstatusuriList conference resources
获取会议资源列表
Lists conference resources.
GET /texml/Accounts/{account_sid}/Conferencesgo
response, err := client.Texml.Accounts.Conferences.GetConferences(
context.Background(),
"account_sid",
telnyx.TexmlAccountConferenceGetConferencesParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Conferences)Returns: (array[object]), (integer), (string), (string), (integer), (integer), (integer), (string)
conferencesendfirst_page_urinext_page_uripagepage_sizestarturi获取所有会议资源列表。
GET /texml/Accounts/{account_sid}/Conferencesgo
response, err := client.Texml.Accounts.Conferences.GetConferences(
context.Background(),
"account_sid",
telnyx.TexmlAccountConferenceGetConferencesParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Conferences)返回参数: (对象数组), (整数), (字符串), (字符串), (整数), (整数), (整数), (字符串)
conferencesendfirst_page_urinext_page_uripagepage_sizestarturiFetch a conference resource
获取单个会议资源
Returns a conference resource.
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}go
conference, err := client.Texml.Accounts.Conferences.Get(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceGetParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", conference.AccountSid)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}go
conference, err := client.Texml.Accounts.Conferences.Get(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceGetParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", conference.AccountSid)返回参数: (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (枚举值: 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}go
conference, err := client.Texml.Accounts.Conferences.Update(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceUpdateParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", conference.AccountSid)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}go
conference, err := client.Texml.Accounts.Conferences.Update(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceUpdateParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", conference.AccountSid)返回参数: (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (枚举值: 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}/Participantsgo
response, err := client.Texml.Accounts.Conferences.Participants.GetParticipants(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceParticipantGetParticipantsParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}/Participantsgo
response, err := client.Texml.Accounts.Conferences.Participants.GetParticipants(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceParticipantGetParticipantsParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}/Participantsgo
response, err := client.Texml.Accounts.Conferences.Participants.Participants(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceParticipantParticipantsParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)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}/Participantsgo
response, err := client.Texml.Accounts.Conferences.Participants.Participants(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceParticipantParticipantsParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)返回参数: (字符串), (字符串), (布尔值), (字符串), (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}go
participant, err := client.Texml.Accounts.Conferences.Participants.Get(
context.Background(),
"call_sid_or_participant_label",
telnyx.TexmlAccountConferenceParticipantGetParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
ConferenceSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", participant.AccountSid)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}go
participant, err := client.Texml.Accounts.Conferences.Participants.Get(
context.Background(),
"call_sid_or_participant_label",
telnyx.TexmlAccountConferenceParticipantGetParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
ConferenceSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", participant.AccountSid)返回参数: (字符串), (字符串), (字符串), (字符串), (布尔值), (字符串), (字符串), (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}go
participant, err := client.Texml.Accounts.Conferences.Participants.Update(
context.Background(),
"call_sid_or_participant_label",
telnyx.TexmlAccountConferenceParticipantUpdateParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
ConferenceSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", participant.AccountSid)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}go
participant, err := client.Texml.Accounts.Conferences.Participants.Update(
context.Background(),
"call_sid_or_participant_label",
telnyx.TexmlAccountConferenceParticipantUpdateParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
ConferenceSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", participant.AccountSid)返回参数: (字符串), (字符串), (字符串), (字符串), (布尔值), (字符串), (字符串), (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}go
err := client.Texml.Accounts.Conferences.Participants.Delete(
context.Background(),
"call_sid_or_participant_label",
telnyx.TexmlAccountConferenceParticipantDeleteParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
ConferenceSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}将指定参会者从会议中移除
DELETE /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}go
err := client.Texml.Accounts.Conferences.Participants.Delete(
context.Background(),
"call_sid_or_participant_label",
telnyx.TexmlAccountConferenceParticipantDeleteParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
ConferenceSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}List conference recordings
获取会议录音列表
Lists conference recordings
GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordingsgo
response, err := client.Texml.Accounts.Conferences.GetRecordings(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceGetRecordingsParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}/Recordingsgo
response, err := client.Texml.Accounts.Conferences.GetRecordings(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceGetRecordingsParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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.jsongo
response, err := client.Texml.Accounts.Conferences.GetRecordingsJson(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceGetRecordingsJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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.jsongo
response, err := client.Texml.Accounts.Conferences.GetRecordingsJson(
context.Background(),
"conference_sid",
telnyx.TexmlAccountConferenceGetRecordingsJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.End)返回参数: (整数), (uri), (字符串), (整数), (整数), (uri), (对象数组), (整数), (字符串)
endfirst_page_urinext_page_uripagepage_sizeprevious_page_urirecordingsstarturiList queue resources
获取队列资源列表
Lists queue resources.
GET /texml/Accounts/{account_sid}/Queuesgo
page, err := client.Texml.Accounts.Queues.List(
context.Background(),
"account_sid",
telnyx.TexmlAccountQueueListParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (integer), (string), (string), (integer), (integer), (array[object]), (integer), (string)
endfirst_page_urinext_page_uripagepage_sizequeuesstarturi获取所有队列资源列表。
GET /texml/Accounts/{account_sid}/Queuesgo
page, err := client.Texml.Accounts.Queues.List(
context.Background(),
"account_sid",
telnyx.TexmlAccountQueueListParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数: (整数), (字符串), (字符串), (整数), (整数), (对象数组), (整数), (字符串)
endfirst_page_urinext_page_uripagepage_sizequeuesstarturiCreate a new queue
创建队列
Creates a new queue resource.
POST /texml/Accounts/{account_sid}/Queuesgo
queue, err := client.Texml.Accounts.Queues.New(
context.Background(),
"account_sid",
telnyx.TexmlAccountQueueNewParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", queue.AccountSid)Returns: (string), (integer), (integer), (string), (string), (integer), (string), (object), (string)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuri创建一个新的队列资源。
POST /texml/Accounts/{account_sid}/Queuesgo
queue, err := client.Texml.Accounts.Queues.New(
context.Background(),
"account_sid",
telnyx.TexmlAccountQueueNewParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", queue.AccountSid)返回参数: (字符串), (整数), (整数), (字符串), (字符串), (整数), (字符串), (对象), (字符串)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuriFetch a queue resource
获取队列详情
Returns a queue resource.
GET /texml/Accounts/{account_sid}/Queues/{queue_sid}go
queue, err := client.Texml.Accounts.Queues.Get(
context.Background(),
"queue_sid",
telnyx.TexmlAccountQueueGetParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", queue.AccountSid)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}go
queue, err := client.Texml.Accounts.Queues.Get(
context.Background(),
"queue_sid",
telnyx.TexmlAccountQueueGetParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", queue.AccountSid)返回参数: (字符串), (整数), (整数), (字符串), (字符串), (整数), (字符串), (对象), (字符串)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuriUpdate a queue resource
更新队列信息
Updates a queue resource.
POST /texml/Accounts/{account_sid}/Queues/{queue_sid}go
queue, err := client.Texml.Accounts.Queues.Update(
context.Background(),
"queue_sid",
telnyx.TexmlAccountQueueUpdateParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", queue.AccountSid)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}go
queue, err := client.Texml.Accounts.Queues.Update(
context.Background(),
"queue_sid",
telnyx.TexmlAccountQueueUpdateParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", queue.AccountSid)返回参数: (字符串), (整数), (整数), (字符串), (字符串), (整数), (字符串), (对象), (字符串)
account_sidaverage_wait_timecurrent_sizedate_createddate_updatedmax_sizesidsubresource_urisuriDelete a queue resource
删除队列
Delete a queue resource.
DELETE /texml/Accounts/{account_sid}/Queues/{queue_sid}go
err := client.Texml.Accounts.Queues.Delete(
context.Background(),
"queue_sid",
telnyx.TexmlAccountQueueDeleteParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}删除指定的队列资源。
DELETE /texml/Accounts/{account_sid}/Queues/{queue_sid}go
err := client.Texml.Accounts.Queues.Delete(
context.Background(),
"queue_sid",
telnyx.TexmlAccountQueueDeleteParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}Fetch multiple recording resources
获取账号下所有录音资源
Returns multiple recording resources for an account.
GET /texml/Accounts/{account_sid}/Recordings.jsongo
response, err := client.Texml.Accounts.GetRecordingsJson(
context.Background(),
"account_sid",
telnyx.TexmlAccountGetRecordingsJsonParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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.jsongo
response, err := client.Texml.Accounts.GetRecordingsJson(
context.Background(),
"account_sid",
telnyx.TexmlAccountGetRecordingsJsonParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}.jsongo
texmlGetCallRecordingResponseBody, err := client.Texml.Accounts.Recordings.Json.GetRecordingSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountRecordingJsonGetRecordingSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", texmlGetCallRecordingResponseBody.AccountSid)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}.jsongo
texmlGetCallRecordingResponseBody, err := client.Texml.Accounts.Recordings.Json.GetRecordingSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountRecordingJsonGetRecordingSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", texmlGetCallRecordingResponseBody.AccountSid)返回参数: (字符串), (字符串), (枚举值: 1, 2), (uuid), (日期时间), (日期时间), (字符串 | 空), (字符串 | 空), (uri), (字符串), (枚举值: StartCallRecordingAPI, StartConferenceRecordingAPI, OutboundAPI, DialVerb, Conference, RecordVerb, Trunking), (日期时间), (枚举值: 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}.jsongo
err := client.Texml.Accounts.Recordings.Json.DeleteRecordingSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountRecordingJsonDeleteRecordingSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}根据录音ID删除对应录音资源。
DELETE /texml/Accounts/{account_sid}/Recordings/{recording_sid}.jsongo
err := client.Texml.Accounts.Recordings.Json.DeleteRecordingSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountRecordingJsonDeleteRecordingSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}List recording transcriptions
获取录音转写列表
Returns multiple recording transcription resources for an account.
GET /texml/Accounts/{account_sid}/Transcriptions.jsongo
response, err := client.Texml.Accounts.GetTranscriptionsJson(
context.Background(),
"account_sid",
telnyx.TexmlAccountGetTranscriptionsJsonParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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.jsongo
response, err := client.Texml.Accounts.GetTranscriptionsJson(
context.Background(),
"account_sid",
telnyx.TexmlAccountGetTranscriptionsJsonParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}.jsongo
response, err := client.Texml.Accounts.Transcriptions.Json.GetRecordingTranscriptionSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountTranscriptionJsonGetRecordingTranscriptionSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)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}.jsongo
response, err := client.Texml.Accounts.Transcriptions.Json.GetRecordingTranscriptionSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountTranscriptionJsonGetRecordingTranscriptionSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.AccountSid)返回参数: (字符串), (字符串), (字符串), (日期时间), (日期时间), (字符串 | 空), (字符串), (字符串), (枚举值: 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}.jsongo
err := client.Texml.Accounts.Transcriptions.Json.DeleteRecordingTranscriptionSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountTranscriptionJsonDeleteRecordingTranscriptionSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}永久删除指定的录音转写资源。
DELETE /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.jsongo
err := client.Texml.Accounts.Transcriptions.Json.DeleteRecordingTranscriptionSidJson(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TexmlAccountTranscriptionJsonDeleteRecordingTranscriptionSidJsonParams{
AccountSid: "550e8400-e29b-41d4-a716-446655440000",
},
)
if err != nil {
log.Fatal(err)
}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/secretsnamevaluego
response, err := client.Texml.Secrets(context.Background(), telnyx.TexmlSecretsParams{
Name: "My Secret Name",
Value: "My Secret Value",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Data)Returns: (string), (enum: REDACTED)
namevalue创建TeXML密钥,后续在TeXML中使用Mustache模板时可将其作为动态参数使用。你可以在TeXML中使用密钥名称,Telnyx侧处理TeXML时会自动将名称替换为实际的密钥值,密钥不会在任何日志中显示。
POST /texml/secretsnamevaluego
response, err := client.Texml.Secrets(context.Background(), telnyx.TexmlSecretsParams{
Name: "My Secret Name",
Value: "My Secret Value",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Data)返回参数: (字符串), (枚举值: REDACTED)
namevalueList all TeXML Applications
获取所有TeXML应用列表
Returns a list of your TeXML Applications.
GET /texml_applicationsgo
page, err := client.TexmlApplications.List(context.Background(), telnyx.TexmlApplicationListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)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_applicationsgo
page, err := client.TexmlApplications.List(context.Background(), telnyx.TexmlApplicationListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数: (布尔值), (枚举值: 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_methodgo
texmlApplication, err := client.TexmlApplications.New(context.Background(), telnyx.TexmlApplicationNewParams{
FriendlyName: "call-router",
VoiceURL: "https://example.com",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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_methodgo
texmlApplication, err := client.TexmlApplications.New(context.Background(), telnyx.TexmlApplicationNewParams{
FriendlyName: "call-router",
VoiceURL: "https://example.com",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}go
texmlApplication, err := client.TexmlApplications.Get(context.Background(), "1293384261075731499")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}go
texmlApplication, err := client.TexmlApplications.Get(context.Background(), "1293384261075731499")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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_methodgo
texmlApplication, err := client.TexmlApplications.Update(
context.Background(),
"1293384261075731499",
telnyx.TexmlApplicationUpdateParams{
FriendlyName: "call-router",
VoiceURL: "https://example.com",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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_methodgo
texmlApplication, err := client.TexmlApplications.Update(
context.Background(),
"1293384261075731499",
telnyx.TexmlApplicationUpdateParams{
FriendlyName: "call-router",
VoiceURL: "https://example.com",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}go
texmlApplication, err := client.TexmlApplications.Delete(context.Background(), "1293384261075731499")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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}go
texmlApplication, err := client.TexmlApplications.Delete(context.Background(), "1293384261075731499")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", 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