telnyx-account-access-curl
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成,请勿编辑。 -->
Telnyx Account Access - curl
Telnyx 账户访问 - curl
Installation
安装
text
undefinedtext
undefinedcurl is pre-installed on macOS, Linux, and Windows 10+
curl is pre-installed on macOS, Linux, and Windows 10+
undefinedundefinedSetup
配置
bash
export TELNYX_API_KEY="YOUR_API_KEY_HERE"All examples below use for authentication.
$TELNYX_API_KEYbash
export TELNYX_API_KEY="YOUR_API_KEY_HERE"以下所有示例均使用进行身份验证。
$TELNYX_API_KEYError 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:
bash
undefined所有API调用都可能出现失败情况,原因包括网络错误、速率限制(429)、校验错误(422)或身份验证错误(401)。在生产代码中请务必做好错误处理:
bash
undefinedCheck HTTP status code in response
Check HTTP status code in response
response=$(curl -s -w "\n%{http_code}"
-X POST "https://api.telnyx.com/v2/messages"
-H "Authorization: Bearer $TELNYX_API_KEY"
-H "Content-Type: application/json"
-d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}')
-X POST "https://api.telnyx.com/v2/messages"
-H "Authorization: Bearer $TELNYX_API_KEY"
-H "Content-Type: application/json"
-d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}')
http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | sed '$d')
case $http_code in
2*) echo "Success: $body" ;;
422) echo "Validation error — check required fields and formats" ;;
429) echo "Rate limited — retry after delay"; sleep 1 ;;
401) echo "Authentication failed — check TELNYX_API_KEY" ;;
*) echo "Error $http_code: $body" ;;
esac
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).response=$(curl -s -w "\n%{http_code}"
-X POST "https://api.telnyx.com/v2/messages"
-H "Authorization: Bearer $TELNYX_API_KEY"
-H "Content-Type: application/json"
-d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}')
-X POST "https://api.telnyx.com/v2/messages"
-H "Authorization: Bearer $TELNYX_API_KEY"
-H "Content-Type: application/json"
-d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}')
http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | sed '$d')
case $http_code in
2*) echo "Success: $body" ;;
422) echo "Validation error — check required fields and formats" ;;
429) echo "Rate limited — retry after delay"; sleep 1 ;;
401) echo "Authentication failed — check TELNYX_API_KEY" ;;
*) echo "Error $http_code: $body" ;;
esac
常见错误码:`401` 无效API密钥,`403` 权限不足,`404` 资源未找到,`422` 校验错误(请检查字段格式),`429` 触发速率限制(请使用指数退避策略重试)。Important Notes
重要注意事项
- Pagination: List endpoints return paginated results. Use and
page[number]query parameters to navigate pages. Checkpage[size]in the response.meta.total_pages
- 分页: 列表类接口返回分页结果,可使用和
page[number]查询参数翻页,可通过响应中的page[size]查看总页数。meta.total_pages
List all Access IP Addresses
列出所有访问IP地址
GET /access_ip_addressbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/access_ip_address"Returns: (date-time), (string), (string), (string), (string), (enum: pending, added), (date-time), (string)
created_atdescriptionidip_addresssourcestatusupdated_atuser_idGET /access_ip_addressbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/access_ip_address"返回值:(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(枚举值:pending, added)、(日期时间)、(字符串)
created_atdescriptionidip_addresssourcestatusupdated_atuser_idCreate new Access IP Address
创建新的访问IP地址
POST /access_ip_addressip_addressOptional: (string)
descriptionbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ip_address": "203.0.113.10"
}' \
"https://api.telnyx.com/v2/access_ip_address"Returns: (date-time), (string), (string), (string), (string), (enum: pending, added), (date-time), (string)
created_atdescriptionidip_addresssourcestatusupdated_atuser_idPOST /access_ip_addressip_address可选参数:(字符串)
descriptionbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ip_address": "203.0.113.10"
}' \
"https://api.telnyx.com/v2/access_ip_address"返回值:(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(枚举值:pending, added)、(日期时间)、(字符串)
created_atdescriptionidip_addresssourcestatusupdated_atuser_idRetrieve an access IP address
查询单个访问IP地址
GET /access_ip_address/{access_ip_address_id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/access_ip_address/{access_ip_address_id}"Returns: (date-time), (string), (string), (string), (string), (enum: pending, added), (date-time), (string)
created_atdescriptionidip_addresssourcestatusupdated_atuser_idGET /access_ip_address/{access_ip_address_id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/access_ip_address/{access_ip_address_id}"返回值:(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(枚举值:pending, added)、(日期时间)、(字符串)
created_atdescriptionidip_addresssourcestatusupdated_atuser_idDelete access IP address
删除访问IP地址
DELETE /access_ip_address/{access_ip_address_id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/access_ip_address/{access_ip_address_id}"Returns: (date-time), (string), (string), (string), (string), (enum: pending, added), (date-time), (string)
created_atdescriptionidip_addresssourcestatusupdated_atuser_idDELETE /access_ip_address/{access_ip_address_id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/access_ip_address/{access_ip_address_id}"返回值:(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(枚举值:pending, added)、(日期时间)、(字符串)
created_atdescriptionidip_addresssourcestatusupdated_atuser_idList all addresses
列出所有地址
Returns a list of your addresses.
GET /addressesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/addresses?sort=street_address"Returns: (boolean), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (boolean)
address_bookadministrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atvalidate_address返回你的所有地址列表。
GET /addressesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/addresses?sort=street_address"返回值:(布尔值)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)
address_bookadministrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atvalidate_addressCreates an address
创建地址
Creates an address.
POST /addressesfirst_namelast_namebusiness_namestreet_addresslocalitycountry_codeOptional: (boolean), (string), (string), (string), (string), (string), (string), (string), (boolean)
address_bookadministrative_areaboroughcustomer_referenceextended_addressneighborhoodphone_numberpostal_codevalidate_addressbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Alfred",
"last_name": "Foster",
"business_name": "Toy-O'Kon",
"street_address": "600 Congress Avenue",
"locality": "Austin",
"country_code": "US"
}' \
"https://api.telnyx.com/v2/addresses"Returns: (boolean), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (boolean)
address_bookadministrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atvalidate_address创建一个新地址。
POST /addressesfirst_namelast_namebusiness_namestreet_addresslocalitycountry_code可选参数:(布尔值)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)
address_bookadministrative_areaboroughcustomer_referenceextended_addressneighborhoodphone_numberpostal_codevalidate_addressbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Alfred",
"last_name": "Foster",
"business_name": "Toy-O'Kon",
"street_address": "600 Congress Avenue",
"locality": "Austin",
"country_code": "US"
}' \
"https://api.telnyx.com/v2/addresses"返回值:(布尔值)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)
address_bookadministrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atvalidate_addressValidate an address
校验地址
Validates an address for emergency services.
POST /addresses/actions/validatecountry_codestreet_addresspostal_codeOptional: (string), (string), (string)
administrative_areaextended_addresslocalitybash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"street_address": "600 Congress Avenue",
"postal_code": "78701",
"country_code": "US"
}' \
"https://api.telnyx.com/v2/addresses/actions/validate"Returns: (array[object]), (string), (enum: valid, invalid), (object)
errorsrecord_typeresultsuggested校验地址是否符合紧急服务使用要求。
POST /addresses/actions/validatecountry_codestreet_addresspostal_code可选参数:(字符串)、(字符串)、(字符串)
administrative_areaextended_addresslocalitybash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"street_address": "600 Congress Avenue",
"postal_code": "78701",
"country_code": "US"
}' \
"https://api.telnyx.com/v2/addresses/actions/validate"返回值:(对象数组)、(字符串)、(枚举值:valid, invalid)、(对象)
errorsrecord_typeresultsuggestedRetrieve an address
查询单个地址
Retrieves the details of an existing address.
GET /addresses/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/addresses/550e8400-e29b-41d4-a716-446655440000"Returns: (boolean), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (boolean)
address_bookadministrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atvalidate_address获取现有地址的详情。
GET /addresses/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/addresses/550e8400-e29b-41d4-a716-446655440000"返回值:(布尔值)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)
address_bookadministrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atvalidate_addressDeletes an address
删除地址
Deletes an existing address.
DELETE /addresses/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/addresses/550e8400-e29b-41d4-a716-446655440000"Returns: (boolean), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (boolean)
address_bookadministrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atvalidate_address删除现有地址。
DELETE /addresses/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/addresses/550e8400-e29b-41d4-a716-446655440000"返回值:(布尔值)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)
address_bookadministrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atvalidate_addressAccepts this address suggestion as a new emergency address for Operator Connect and finishes the uploads of the numbers associated with it to Microsoft.
接受地址建议并将关联号码同步到Microsoft
POST /addresses/{id}/actions/accept_suggestionsOptional: (string)
idbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/addresses/550e8400-e29b-41d4-a716-446655440000/actions/accept_suggestions"Returns: (boolean), (uuid), (enum: address_suggestion)
acceptedidrecord_type接受该地址建议作为Operator Connect的新紧急地址,并完成关联号码向Microsoft的上传流程。
POST /addresses/{id}/actions/accept_suggestions可选参数:(字符串)
idbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/addresses/550e8400-e29b-41d4-a716-446655440000/actions/accept_suggestions"返回值:(布尔值)、(uuid)、(枚举值:address_suggestion)
acceptedidrecord_typeList all SSO authentication providers
列出所有SSO身份验证提供商
Returns a list of your SSO authentication providers.
GET /authentication_providersbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/authentication_providers?sort=name"Returns: (date-time), (boolean), (date-time), (uuid), (string), (uuid), (string), (object), (string), (date-time)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_at返回你的所有SSO身份验证提供商列表。
GET /authentication_providersbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/authentication_providers?sort=name"返回值:(日期时间)、(布尔值)、(日期时间)、(uuid)、(字符串)、(uuid)、(字符串)、(对象)、(字符串)、(日期时间)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_atCreates an authentication provider
创建身份验证提供商
Creates an authentication provider.
POST /authentication_providersnameshort_namesettingsOptional: (boolean), (uri)
activesettings_urlbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Okta",
"short_name": "myorg",
"settings": {}
}' \
"https://api.telnyx.com/v2/authentication_providers"Returns: (date-time), (boolean), (date-time), (uuid), (string), (uuid), (string), (object), (string), (date-time)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_at创建一个新的身份验证提供商。
POST /authentication_providersnameshort_namesettings可选参数:(布尔值)、(uri)
activesettings_urlbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Okta",
"short_name": "myorg",
"settings": {}
}' \
"https://api.telnyx.com/v2/authentication_providers"返回值:(日期时间)、(布尔值)、(日期时间)、(uuid)、(字符串)、(uuid)、(字符串)、(对象)、(字符串)、(日期时间)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_atRetrieve an authentication provider
查询单个身份验证提供商
Retrieves the details of an existing authentication provider.
GET /authentication_providers/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/authentication_providers/550e8400-e29b-41d4-a716-446655440000"Returns: (date-time), (boolean), (date-time), (uuid), (string), (uuid), (string), (object), (string), (date-time)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_at获取现有身份验证提供商的详情。
GET /authentication_providers/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/authentication_providers/550e8400-e29b-41d4-a716-446655440000"返回值:(日期时间)、(布尔值)、(日期时间)、(uuid)、(字符串)、(uuid)、(字符串)、(对象)、(字符串)、(日期时间)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_atUpdate an authentication provider
更新身份验证提供商
Updates settings of an existing authentication provider.
PATCH /authentication_providers/{id}Optional: (boolean), (string), (object), (uri), (string)
activenamesettingssettings_urlshort_namebash
curl \
-X PATCH \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Okta",
"short_name": "myorg",
"active": true,
"settings": {
"idp_entity_id": "https://myorg.myidp.com/saml/metadata",
"idp_sso_target_url": "https://myorg.myidp.com/trust/saml2/http-post/sso",
"idp_cert_fingerprint": "13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7",
"idp_cert_fingerprint_algorithm": "sha1"
}
}' \
"https://api.telnyx.com/v2/authentication_providers/550e8400-e29b-41d4-a716-446655440000"Returns: (date-time), (boolean), (date-time), (uuid), (string), (uuid), (string), (object), (string), (date-time)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_at更新现有身份验证提供商的配置。
PATCH /authentication_providers/{id}可选参数:(布尔值)、(字符串)、(对象)、(uri)、(字符串)
activenamesettingssettings_urlshort_namebash
curl \
-X PATCH \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Okta",
"short_name": "myorg",
"active": true,
"settings": {
"idp_entity_id": "https://myorg.myidp.com/saml/metadata",
"idp_sso_target_url": "https://myorg.myidp.com/trust/saml2/http-post/sso",
"idp_cert_fingerprint": "13:38:C7:BB:C9:FF:4A:70:38:3A:E3:D9:5C:CD:DB:2E:50:1E:80:A7",
"idp_cert_fingerprint_algorithm": "sha1"
}
}' \
"https://api.telnyx.com/v2/authentication_providers/550e8400-e29b-41d4-a716-446655440000"返回值:(日期时间)、(布尔值)、(日期时间)、(uuid)、(字符串)、(uuid)、(字符串)、(对象)、(字符串)、(日期时间)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_atDeletes an authentication provider
删除身份验证提供商
Deletes an existing authentication provider.
DELETE /authentication_providers/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/authentication_providers/550e8400-e29b-41d4-a716-446655440000"Returns: (date-time), (boolean), (date-time), (uuid), (string), (uuid), (string), (object), (string), (date-time)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_at删除现有身份验证提供商。
DELETE /authentication_providers/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/authentication_providers/550e8400-e29b-41d4-a716-446655440000"返回值:(日期时间)、(布尔值)、(日期时间)、(uuid)、(字符串)、(uuid)、(字符串)、(对象)、(字符串)、(日期时间)
activated_atactivecreated_atidnameorganization_idrecord_typesettingsshort_nameupdated_atList all billing groups
列出所有计费组
GET /billing_groupsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/billing_groups"Returns: (date-time), (date-time), (uuid), (string), (uuid), (enum: billing_group), (date-time)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atGET /billing_groupsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/billing_groups"返回值:(日期时间)、(日期时间)、(uuid)、(字符串)、(uuid)、(枚举值:billing_group)、(日期时间)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atCreate a billing group
创建计费组
POST /billing_groupsOptional: (string)
namebash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-resource"
}' \
"https://api.telnyx.com/v2/billing_groups"Returns: (date-time), (date-time), (uuid), (string), (uuid), (enum: billing_group), (date-time)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atPOST /billing_groups可选参数:(字符串)
namebash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-resource"
}' \
"https://api.telnyx.com/v2/billing_groups"返回值:(日期时间)、(日期时间)、(uuid)、(字符串)、(uuid)、(枚举值:billing_group)、(日期时间)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atGet a billing group
查询单个计费组
GET /billing_groups/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/billing_groups/f5586561-8ff0-4291-a0ac-84fe544797bd"Returns: (date-time), (date-time), (uuid), (string), (uuid), (enum: billing_group), (date-time)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atGET /billing_groups/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/billing_groups/f5586561-8ff0-4291-a0ac-84fe544797bd"返回值:(日期时间)、(日期时间)、(uuid)、(字符串)、(uuid)、(枚举值:billing_group)、(日期时间)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atUpdate a billing group
更新计费组
PATCH /billing_groups/{id}Optional: (string)
namebash
curl \
-X PATCH \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-resource"
}' \
"https://api.telnyx.com/v2/billing_groups/f5586561-8ff0-4291-a0ac-84fe544797bd"Returns: (date-time), (date-time), (uuid), (string), (uuid), (enum: billing_group), (date-time)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atPATCH /billing_groups/{id}可选参数:(字符串)
namebash
curl \
-X PATCH \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-resource"
}' \
"https://api.telnyx.com/v2/billing_groups/f5586561-8ff0-4291-a0ac-84fe544797bd"返回值:(日期时间)、(日期时间)、(uuid)、(字符串)、(uuid)、(枚举值:billing_group)、(日期时间)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atDelete a billing group
删除计费组
DELETE /billing_groups/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/billing_groups/f5586561-8ff0-4291-a0ac-84fe544797bd"Returns: (date-time), (date-time), (uuid), (string), (uuid), (enum: billing_group), (date-time)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atDELETE /billing_groups/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/billing_groups/f5586561-8ff0-4291-a0ac-84fe544797bd"返回值:(日期时间)、(日期时间)、(uuid)、(字符串)、(uuid)、(枚举值:billing_group)、(日期时间)
created_atdeleted_atidnameorganization_idrecord_typeupdated_atList integration secrets
列出集成密钥
Retrieve a list of all integration secrets configured by the user.
GET /integration_secretsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/integration_secrets"Returns: (date-time), (string), (string), (string), (date-time)
created_atididentifierrecord_typeupdated_at获取用户配置的所有集成密钥列表。
GET /integration_secretsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/integration_secrets"返回值:(日期时间)、(字符串)、(字符串)、(字符串)、(日期时间)
created_atididentifierrecord_typeupdated_atCreate a secret
创建密钥
Create a new secret with an associated identifier that can be used to securely integrate with other services.
POST /integration_secretsidentifiertypeOptional: (string), (string), (string)
passwordtokenusernamebash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"identifier": "user@example.com",
"type": "bearer"
}' \
"https://api.telnyx.com/v2/integration_secrets"Returns: (date-time), (string), (string), (string), (date-time)
created_atididentifierrecord_typeupdated_at创建新的密钥并关联标识,可用于与其他服务的安全集成。
POST /integration_secretsidentifiertype可选参数:(字符串)、(字符串)、(字符串)
passwordtokenusernamebash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"identifier": "user@example.com",
"type": "bearer"
}' \
"https://api.telnyx.com/v2/integration_secrets"返回值:(日期时间)、(字符串)、(字符串)、(字符串)、(日期时间)
created_atididentifierrecord_typeupdated_atDelete an integration secret
删除集成密钥
Delete an integration secret given its ID.
DELETE /integration_secrets/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/integration_secrets/550e8400-e29b-41d4-a716-446655440000"根据ID删除指定的集成密钥。
DELETE /integration_secrets/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/integration_secrets/550e8400-e29b-41d4-a716-446655440000"Create an Access Token.
创建访问令牌
Create an Access Token (JWT) for the credential.
POST /telephony_credentials/{id}/tokenbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/telephony_credentials/550e8400-e29b-41d4-a716-446655440000/token"为凭证创建访问令牌(JWT)。
POST /telephony_credentials/{id}/tokenbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/telephony_credentials/550e8400-e29b-41d4-a716-446655440000/token"