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
undefined
text
undefined

curl is pre-installed on macOS, Linux, and Windows 10+

curl is pre-installed on macOS, Linux, and Windows 10+

undefined
undefined

Setup

配置

bash
export TELNYX_API_KEY="YOUR_API_KEY_HERE"
All examples below use
$TELNYX_API_KEY
for authentication.
bash
export TELNYX_API_KEY="YOUR_API_KEY_HERE"
以下所有示例均使用
$TELNYX_API_KEY
进行身份验证。

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:
bash
undefined
所有API调用都可能出现失败情况,原因包括网络错误、速率限制(429)、校验错误(422)或身份验证错误(401)。在生产代码中请务必做好错误处理:
bash
undefined

Check 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"}')
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"}')
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
    page[number]
    and
    page[size]
    query parameters to navigate pages. Check
    meta.total_pages
    in the response.
  • 分页: 列表类接口返回分页结果,可使用
    page[number]
    page[size]
    查询参数翻页,可通过响应中的
    meta.total_pages
    查看总页数。

List all Access IP Addresses

列出所有访问IP地址

GET /access_ip_address
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/access_ip_address"
Returns:
created_at
(date-time),
description
(string),
id
(string),
ip_address
(string),
source
(string),
status
(enum: pending, added),
updated_at
(date-time),
user_id
(string)
GET /access_ip_address
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/access_ip_address"
返回值:
created_at
(日期时间)、
description
(字符串)、
id
(字符串)、
ip_address
(字符串)、
source
(字符串)、
status
(枚举值:pending, added)、
updated_at
(日期时间)、
user_id
(字符串)

Create new Access IP Address

创建新的访问IP地址

POST /access_ip_address
— Required:
ip_address
Optional:
description
(string)
bash
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:
created_at
(date-time),
description
(string),
id
(string),
ip_address
(string),
source
(string),
status
(enum: pending, added),
updated_at
(date-time),
user_id
(string)
POST /access_ip_address
— 必填参数:
ip_address
可选参数:
description
(字符串)
bash
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"
返回值:
created_at
(日期时间)、
description
(字符串)、
id
(字符串)、
ip_address
(字符串)、
source
(字符串)、
status
(枚举值:pending, added)、
updated_at
(日期时间)、
user_id
(字符串)

Retrieve 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:
created_at
(date-time),
description
(string),
id
(string),
ip_address
(string),
source
(string),
status
(enum: pending, added),
updated_at
(date-time),
user_id
(string)
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}"
返回值:
created_at
(日期时间)、
description
(字符串)、
id
(字符串)、
ip_address
(字符串)、
source
(字符串)、
status
(枚举值:pending, added)、
updated_at
(日期时间)、
user_id
(字符串)

Delete 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:
created_at
(date-time),
description
(string),
id
(string),
ip_address
(string),
source
(string),
status
(enum: pending, added),
updated_at
(date-time),
user_id
(string)
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}"
返回值:
created_at
(日期时间)、
description
(字符串)、
id
(字符串)、
ip_address
(字符串)、
source
(字符串)、
status
(枚举值:pending, added)、
updated_at
(日期时间)、
user_id
(字符串)

List all addresses

列出所有地址

Returns a list of your addresses.
GET /addresses
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/addresses?sort=street_address"
Returns:
address_book
(boolean),
administrative_area
(string),
borough
(string),
business_name
(string),
country_code
(string),
created_at
(string),
customer_reference
(string),
extended_address
(string),
first_name
(string),
id
(string),
last_name
(string),
locality
(string),
neighborhood
(string),
phone_number
(string),
postal_code
(string),
record_type
(string),
street_address
(string),
updated_at
(string),
validate_address
(boolean)
返回你的所有地址列表。
GET /addresses
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/addresses?sort=street_address"
返回值:
address_book
(布尔值)、
administrative_area
(字符串)、
borough
(字符串)、
business_name
(字符串)、
country_code
(字符串)、
created_at
(字符串)、
customer_reference
(字符串)、
extended_address
(字符串)、
first_name
(字符串)、
id
(字符串)、
last_name
(字符串)、
locality
(字符串)、
neighborhood
(字符串)、
phone_number
(字符串)、
postal_code
(字符串)、
record_type
(字符串)、
street_address
(字符串)、
updated_at
(字符串)、
validate_address
(布尔值)

Creates an address

创建地址

Creates an address.
POST /addresses
— Required:
first_name
,
last_name
,
business_name
,
street_address
,
locality
,
country_code
Optional:
address_book
(boolean),
administrative_area
(string),
borough
(string),
customer_reference
(string),
extended_address
(string),
neighborhood
(string),
phone_number
(string),
postal_code
(string),
validate_address
(boolean)
bash
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:
address_book
(boolean),
administrative_area
(string),
borough
(string),
business_name
(string),
country_code
(string),
created_at
(string),
customer_reference
(string),
extended_address
(string),
first_name
(string),
id
(string),
last_name
(string),
locality
(string),
neighborhood
(string),
phone_number
(string),
postal_code
(string),
record_type
(string),
street_address
(string),
updated_at
(string),
validate_address
(boolean)
创建一个新地址。
POST /addresses
— 必填参数:
first_name
last_name
business_name
street_address
locality
country_code
可选参数:
address_book
(布尔值)、
administrative_area
(字符串)、
borough
(字符串)、
customer_reference
(字符串)、
extended_address
(字符串)、
neighborhood
(字符串)、
phone_number
(字符串)、
postal_code
(字符串)、
validate_address
(布尔值)
bash
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_book
(布尔值)、
administrative_area
(字符串)、
borough
(字符串)、
business_name
(字符串)、
country_code
(字符串)、
created_at
(字符串)、
customer_reference
(字符串)、
extended_address
(字符串)、
first_name
(字符串)、
id
(字符串)、
last_name
(字符串)、
locality
(字符串)、
neighborhood
(字符串)、
phone_number
(字符串)、
postal_code
(字符串)、
record_type
(字符串)、
street_address
(字符串)、
updated_at
(字符串)、
validate_address
(布尔值)

Validate an address

校验地址

Validates an address for emergency services.
POST /addresses/actions/validate
— Required:
country_code
,
street_address
,
postal_code
Optional:
administrative_area
(string),
extended_address
(string),
locality
(string)
bash
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:
errors
(array[object]),
record_type
(string),
result
(enum: valid, invalid),
suggested
(object)
校验地址是否符合紧急服务使用要求。
POST /addresses/actions/validate
— 必填参数:
country_code
street_address
postal_code
可选参数:
administrative_area
(字符串)、
extended_address
(字符串)、
locality
(字符串)
bash
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"
返回值:
errors
(对象数组)、
record_type
(字符串)、
result
(枚举值:valid, invalid)、
suggested
(对象)

Retrieve 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:
address_book
(boolean),
administrative_area
(string),
borough
(string),
business_name
(string),
country_code
(string),
created_at
(string),
customer_reference
(string),
extended_address
(string),
first_name
(string),
id
(string),
last_name
(string),
locality
(string),
neighborhood
(string),
phone_number
(string),
postal_code
(string),
record_type
(string),
street_address
(string),
updated_at
(string),
validate_address
(boolean)
获取现有地址的详情。
GET /addresses/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/addresses/550e8400-e29b-41d4-a716-446655440000"
返回值:
address_book
(布尔值)、
administrative_area
(字符串)、
borough
(字符串)、
business_name
(字符串)、
country_code
(字符串)、
created_at
(字符串)、
customer_reference
(字符串)、
extended_address
(字符串)、
first_name
(字符串)、
id
(字符串)、
last_name
(字符串)、
locality
(字符串)、
neighborhood
(字符串)、
phone_number
(字符串)、
postal_code
(字符串)、
record_type
(字符串)、
street_address
(字符串)、
updated_at
(字符串)、
validate_address
(布尔值)

Deletes 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:
address_book
(boolean),
administrative_area
(string),
borough
(string),
business_name
(string),
country_code
(string),
created_at
(string),
customer_reference
(string),
extended_address
(string),
first_name
(string),
id
(string),
last_name
(string),
locality
(string),
neighborhood
(string),
phone_number
(string),
postal_code
(string),
record_type
(string),
street_address
(string),
updated_at
(string),
validate_address
(boolean)
删除现有地址。
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_book
(布尔值)、
administrative_area
(字符串)、
borough
(字符串)、
business_name
(字符串)、
country_code
(字符串)、
created_at
(字符串)、
customer_reference
(字符串)、
extended_address
(字符串)、
first_name
(字符串)、
id
(字符串)、
last_name
(字符串)、
locality
(字符串)、
neighborhood
(字符串)、
phone_number
(字符串)、
postal_code
(字符串)、
record_type
(字符串)、
street_address
(字符串)、
updated_at
(字符串)、
validate_address
(布尔值)

Accepts 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_suggestions
Optional:
id
(string)
bash
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:
accepted
(boolean),
id
(uuid),
record_type
(enum: address_suggestion)
接受该地址建议作为Operator Connect的新紧急地址,并完成关联号码向Microsoft的上传流程。
POST /addresses/{id}/actions/accept_suggestions
可选参数:
id
(字符串)
bash
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"
返回值:
accepted
(布尔值)、
id
(uuid)、
record_type
(枚举值:address_suggestion)

List all SSO authentication providers

列出所有SSO身份验证提供商

Returns a list of your SSO authentication providers.
GET /authentication_providers
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/authentication_providers?sort=name"
Returns:
activated_at
(date-time),
active
(boolean),
created_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(string),
settings
(object),
short_name
(string),
updated_at
(date-time)
返回你的所有SSO身份验证提供商列表。
GET /authentication_providers
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/authentication_providers?sort=name"
返回值:
activated_at
(日期时间)、
active
(布尔值)、
created_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(字符串)、
settings
(对象)、
short_name
(字符串)、
updated_at
(日期时间)

Creates an authentication provider

创建身份验证提供商

Creates an authentication provider.
POST /authentication_providers
— Required:
name
,
short_name
,
settings
Optional:
active
(boolean),
settings_url
(uri)
bash
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:
activated_at
(date-time),
active
(boolean),
created_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(string),
settings
(object),
short_name
(string),
updated_at
(date-time)
创建一个新的身份验证提供商。
POST /authentication_providers
— 必填参数:
name
short_name
settings
可选参数:
active
(布尔值)、
settings_url
(uri)
bash
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"
返回值:
activated_at
(日期时间)、
active
(布尔值)、
created_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(字符串)、
settings
(对象)、
short_name
(字符串)、
updated_at
(日期时间)

Retrieve 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:
activated_at
(date-time),
active
(boolean),
created_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(string),
settings
(object),
short_name
(string),
updated_at
(date-time)
获取现有身份验证提供商的详情。
GET /authentication_providers/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/authentication_providers/550e8400-e29b-41d4-a716-446655440000"
返回值:
activated_at
(日期时间)、
active
(布尔值)、
created_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(字符串)、
settings
(对象)、
short_name
(字符串)、
updated_at
(日期时间)

Update an authentication provider

更新身份验证提供商

Updates settings of an existing authentication provider.
PATCH /authentication_providers/{id}
Optional:
active
(boolean),
name
(string),
settings
(object),
settings_url
(uri),
short_name
(string)
bash
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:
activated_at
(date-time),
active
(boolean),
created_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(string),
settings
(object),
short_name
(string),
updated_at
(date-time)
更新现有身份验证提供商的配置。
PATCH /authentication_providers/{id}
可选参数:
active
(布尔值)、
name
(字符串)、
settings
(对象)、
settings_url
(uri)、
short_name
(字符串)
bash
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"
返回值:
activated_at
(日期时间)、
active
(布尔值)、
created_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(字符串)、
settings
(对象)、
short_name
(字符串)、
updated_at
(日期时间)

Deletes 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:
activated_at
(date-time),
active
(boolean),
created_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(string),
settings
(object),
short_name
(string),
updated_at
(date-time)
删除现有身份验证提供商。
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"
返回值:
activated_at
(日期时间)、
active
(布尔值)、
created_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(字符串)、
settings
(对象)、
short_name
(字符串)、
updated_at
(日期时间)

List all billing groups

列出所有计费组

GET /billing_groups
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/billing_groups"
Returns:
created_at
(date-time),
deleted_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(enum: billing_group),
updated_at
(date-time)
GET /billing_groups
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/billing_groups"
返回值:
created_at
(日期时间)、
deleted_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(枚举值:billing_group)、
updated_at
(日期时间)

Create a billing group

创建计费组

POST /billing_groups
Optional:
name
(string)
bash
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:
created_at
(date-time),
deleted_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(enum: billing_group),
updated_at
(date-time)
POST /billing_groups
可选参数:
name
(字符串)
bash
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"
返回值:
created_at
(日期时间)、
deleted_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(枚举值:billing_group)、
updated_at
(日期时间)

Get 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:
created_at
(date-time),
deleted_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(enum: billing_group),
updated_at
(date-time)
GET /billing_groups/{id}
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/billing_groups/f5586561-8ff0-4291-a0ac-84fe544797bd"
返回值:
created_at
(日期时间)、
deleted_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(枚举值:billing_group)、
updated_at
(日期时间)

Update a billing group

更新计费组

PATCH /billing_groups/{id}
Optional:
name
(string)
bash
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:
created_at
(date-time),
deleted_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(enum: billing_group),
updated_at
(date-time)
PATCH /billing_groups/{id}
可选参数:
name
(字符串)
bash
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"
返回值:
created_at
(日期时间)、
deleted_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(枚举值:billing_group)、
updated_at
(日期时间)

Delete 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:
created_at
(date-time),
deleted_at
(date-time),
id
(uuid),
name
(string),
organization_id
(uuid),
record_type
(enum: billing_group),
updated_at
(date-time)
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"
返回值:
created_at
(日期时间)、
deleted_at
(日期时间)、
id
(uuid)、
name
(字符串)、
organization_id
(uuid)、
record_type
(枚举值:billing_group)、
updated_at
(日期时间)

List integration secrets

列出集成密钥

Retrieve a list of all integration secrets configured by the user.
GET /integration_secrets
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/integration_secrets"
Returns:
created_at
(date-time),
id
(string),
identifier
(string),
record_type
(string),
updated_at
(date-time)
获取用户配置的所有集成密钥列表。
GET /integration_secrets
bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/integration_secrets"
返回值:
created_at
(日期时间)、
id
(字符串)、
identifier
(字符串)、
record_type
(字符串)、
updated_at
(日期时间)

Create a secret

创建密钥

Create a new secret with an associated identifier that can be used to securely integrate with other services.
POST /integration_secrets
— Required:
identifier
,
type
Optional:
password
(string),
token
(string),
username
(string)
bash
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:
created_at
(date-time),
id
(string),
identifier
(string),
record_type
(string),
updated_at
(date-time)
创建新的密钥并关联标识,可用于与其他服务的安全集成。
POST /integration_secrets
— 必填参数:
identifier
type
可选参数:
password
(字符串)、
token
(字符串)、
username
(字符串)
bash
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_at
(日期时间)、
id
(字符串)、
identifier
(字符串)、
record_type
(字符串)、
updated_at
(日期时间)

Delete 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}/token
bash
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}/token
bash
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"