telnyx-numbers-compliance-curl
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
Telnyx Numbers Compliance - 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
重要说明
- Phone numbers must be in E.164 format (e.g., ). Include the
+13125550001prefix and country code. No spaces, dashes, or parentheses.+ - Pagination: List endpoints return paginated results. Use and
page[number]query parameters to navigate pages. Checkpage[size]in the response.meta.total_pages
- 电话号码必须采用E.164格式(例如)。需包含
+13125550001前缀和国家代码,不得包含空格、短横线或括号。+ - 分页: 列表类接口返回分页结果。可使用和
page[number]查询参数翻页,可在响应中查看page[size]获取总页数。meta.total_pages
Retrieve Bundles
查询套餐列表
Get all allowed bundles.
GET /bundle_pricing/billing_bundlesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/billing_bundles"Returns: (string), (date), (string), (uuid), (boolean), (float), (string), (string), (array[string])
cost_codecreated_atcurrencyidis_publicmrc_pricenameslugspecs获取所有可用套餐。
GET /bundle_pricing/billing_bundlesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/billing_bundles"返回参数:(字符串)、(日期)、(字符串)、(UUID)、(布尔值)、(浮点数)、(字符串)、(字符串)、(字符串数组)
cost_codecreated_atcurrencyidis_publicmrc_pricenameslugspecsGet Bundle By Id
根据ID查询套餐
Get a single bundle by ID.
GET /bundle_pricing/billing_bundles/{bundle_id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/billing_bundles/8661948c-a386-4385-837f-af00f40f111a"Returns: (boolean), (array[object]), (string), (date), (uuid), (boolean), (string), (string)
activebundle_limitscost_codecreated_atidis_publicnameslug根据ID查询单个套餐详情。
GET /bundle_pricing/billing_bundles/{bundle_id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/billing_bundles/8661948c-a386-4385-837f-af00f40f111a"返回参数:(布尔值)、(对象数组)、(字符串)、(日期)、(UUID)、(布尔值)、(字符串)、(字符串)
activebundle_limitscost_codecreated_atidis_publicnameslugGet User Bundles
查询用户套餐列表
Get a paginated list of user bundles.
GET /bundle_pricing/user_bundlesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/user_bundles"Returns: (boolean), (object), (date), (uuid), (array[object]), (date), (uuid)
activebilling_bundlecreated_atidresourcesupdated_atuser_id获取分页的用户套餐列表。
GET /bundle_pricing/user_bundlesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/user_bundles"返回参数:(布尔值)、(对象)、(日期)、(UUID)、(对象数组)、(日期)、(UUID)
activebilling_bundlecreated_atidresourcesupdated_atuser_idCreate User Bundles
批量创建用户套餐
Creates multiple user bundles for the user.
POST /bundle_pricing/user_bundles/bulkOptional: (uuid), (array[object])
idempotency_keyitemsbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/bundle_pricing/user_bundles/bulk"Returns: (boolean), (object), (date), (uuid), (array[object]), (date), (uuid)
activebilling_bundlecreated_atidresourcesupdated_atuser_id为用户批量创建多个用户套餐。
POST /bundle_pricing/user_bundles/bulk可选参数:(UUID)、(对象数组)
idempotency_keyitemsbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/bundle_pricing/user_bundles/bulk"返回参数:(布尔值)、(对象)、(日期)、(UUID)、(对象数组)、(日期)、(UUID)
activebilling_bundlecreated_atidresourcesupdated_atuser_idGet Unused User Bundles
查询未使用的用户套餐
Returns all user bundles that aren't in use.
GET /bundle_pricing/user_bundles/unusedbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/user_bundles/unused"Returns: (object), (array[string])
billing_bundleuser_bundle_ids返回所有未投入使用的用户套餐。
GET /bundle_pricing/user_bundles/unusedbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/user_bundles/unused"返回参数:(对象)、(字符串数组)
billing_bundleuser_bundle_idsGet User Bundle by Id
根据ID查询用户套餐
Retrieves a user bundle by its ID.
GET /bundle_pricing/user_bundles/{user_bundle_id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/user_bundles/ca1d2263-d1f1-43ac-ba53-248e7a4bb26a"Returns: (boolean), (object), (date), (uuid), (array[object]), (date), (uuid)
activebilling_bundlecreated_atidresourcesupdated_atuser_id根据ID获取指定用户套餐详情。
GET /bundle_pricing/user_bundles/{user_bundle_id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/user_bundles/ca1d2263-d1f1-43ac-ba53-248e7a4bb26a"返回参数:(布尔值)、(对象)、(日期)、(UUID)、(对象数组)、(日期)、(UUID)
activebilling_bundlecreated_atidresourcesupdated_atuser_idDeactivate User Bundle
停用用户套餐
Deactivates a user bundle by its ID.
DELETE /bundle_pricing/user_bundles/{user_bundle_id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/bundle_pricing/user_bundles/ca1d2263-d1f1-43ac-ba53-248e7a4bb26a"Returns: (boolean), (object), (date), (uuid), (array[object]), (date), (uuid)
activebilling_bundlecreated_atidresourcesupdated_atuser_id根据ID停用指定用户套餐。
DELETE /bundle_pricing/user_bundles/{user_bundle_id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/bundle_pricing/user_bundles/ca1d2263-d1f1-43ac-ba53-248e7a4bb26a"返回参数:(布尔值)、(对象)、(日期)、(UUID)、(对象数组)、(日期)、(UUID)
activebilling_bundlecreated_atidresourcesupdated_atuser_idGet User Bundle Resources
查询用户套餐资源
Retrieves the resources of a user bundle by its ID.
GET /bundle_pricing/user_bundles/{user_bundle_id}/resourcesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/user_bundles/ca1d2263-d1f1-43ac-ba53-248e7a4bb26a/resources"Returns: (date), (uuid), (string), (string), (date)
created_atidresourceresource_typeupdated_at根据ID获取指定用户套餐的关联资源。
GET /bundle_pricing/user_bundles/{user_bundle_id}/resourcesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/bundle_pricing/user_bundles/ca1d2263-d1f1-43ac-ba53-248e7a4bb26a/resources"返回参数:(日期)、(UUID)、(字符串)、(字符串)、(日期)
created_atidresourceresource_typeupdated_atList all document links
查询所有文档关联
List all documents links ordered by created_at descending.
GET /document_linksbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/document_links"Returns: (string), (uuid), (uuid), (string), (string), (string), (string)
created_atdocument_ididlinked_record_typelinked_resource_idrecord_typeupdated_at按创建时间倒序排列返回所有文档关联记录。
GET /document_linksbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/document_links"返回参数:(字符串)、(UUID)、(UUID)、(字符串)、(字符串)、(字符串)、(字符串)
created_atdocument_ididlinked_record_typelinked_resource_idrecord_typeupdated_atList all documents
查询所有文档
List all documents ordered by created_at descending.
GET /documentsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/documents?filter={'filename': {'contains': 'invoice'}, 'customer_reference': {'in': ['REF001', 'REF002']}, 'created_at': {'gt': '2021-01-01T00:00:00Z'}}&sort=['filename']"Returns: (enum: scanned, infected, pending_scan, not_scanned), (string), (string), (string), (string), (uuid), (string), (string), (object), (enum: pending, verified, denied), (string)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_at按创建时间倒序排列返回所有文档。
GET /documentsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/documents?filter={'filename': {'contains': 'invoice'}, 'customer_reference': {'in': ['REF001', 'REF002']}, 'created_at': {'gt': '2021-01-01T00:00:00Z'}}&sort=['filename']"返回参数:(枚举值:scanned、infected、pending_scan、not_scanned)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(对象)、(枚举值:pending、verified、denied)、(字符串)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_atUpload a document
上传文档
Upload a document. Uploaded files must be linked to a service within 30 minutes or they will be automatically deleted.
POST /documentsOptional: (string), (byte), (string), (string)
customer_referencefilefilenameurlbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-F "file=@/path/to/file" \
-F "customer_reference=MY REF 001" \
"https://api.telnyx.com/v2/documents"Returns: (enum: scanned, infected, pending_scan, not_scanned), (string), (string), (string), (string), (uuid), (string), (string), (object), (enum: pending, verified, denied), (string)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_at上传文档。上传的文件必须在30分钟内关联到对应服务,否则会被自动删除。
POST /documents可选参数:(字符串)、(字节)、(字符串)、(字符串)
customer_referencefilefilenameurlbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-F "file=@/path/to/file" \
-F "customer_reference=MY REF 001" \
"https://api.telnyx.com/v2/documents"返回参数:(枚举值:scanned、infected、pending_scan、not_scanned)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(对象)、(枚举值:pending、verified、denied)、(字符串)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_atRetrieve a document
查询文档详情
Retrieve a document.
GET /documents/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/documents/6a09cdc3-8948-47f0-aa62-74ac943d6c58"Returns: (enum: scanned, infected, pending_scan, not_scanned), (string), (string), (string), (string), (uuid), (string), (string), (object), (enum: pending, verified, denied), (string)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_at获取指定文档详情。
GET /documents/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/documents/6a09cdc3-8948-47f0-aa62-74ac943d6c58"返回参数:(枚举值:scanned、infected、pending_scan、not_scanned)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(对象)、(枚举值:pending、verified、denied)、(字符串)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_atUpdate a document
更新文档
Update a document.
PATCH /documents/{id}Optional: (enum: scanned, infected, pending_scan, not_scanned), (string), (string), (string), (string), (uuid), (string), (string), (object), (enum: pending, verified, denied), (string)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_atbash
curl \
-X PATCH \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/documents/6a09cdc3-8948-47f0-aa62-74ac943d6c58"Returns: (enum: scanned, infected, pending_scan, not_scanned), (string), (string), (string), (string), (uuid), (string), (string), (object), (enum: pending, verified, denied), (string)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_at更新指定文档信息。
PATCH /documents/{id}可选参数:(枚举值:scanned、infected、pending_scan、not_scanned)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(对象)、(枚举值:pending、verified、denied)、(字符串)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_atbash
curl \
-X PATCH \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/documents/6a09cdc3-8948-47f0-aa62-74ac943d6c58"返回参数:(枚举值:scanned、infected、pending_scan、not_scanned)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(对象)、(枚举值:pending、verified、denied)、(字符串)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_atDelete a document
删除文档
Delete a document. A document can only be deleted if it's not linked to a service. If it is linked to a service, it must be unlinked prior to deleting.
DELETE /documents/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/documents/6a09cdc3-8948-47f0-aa62-74ac943d6c58"Returns: (enum: scanned, infected, pending_scan, not_scanned), (string), (string), (string), (string), (uuid), (string), (string), (object), (enum: pending, verified, denied), (string)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_at删除指定文档。只有未关联到任何服务的文档才能被删除,如果已关联服务,需要先解除关联再删除。
DELETE /documents/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/documents/6a09cdc3-8948-47f0-aa62-74ac943d6c58"返回参数:(枚举值:scanned、infected、pending_scan、not_scanned)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(对象)、(枚举值:pending、verified、denied)、(字符串)
av_scan_statuscontent_typecreated_atcustomer_referencefilenameidrecord_typesha256sizestatusupdated_atDownload a document
下载文档
Download a document.
GET /documents/{id}/downloadbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/documents/6a09cdc3-8948-47f0-aa62-74ac943d6c58/download"下载指定文档。
GET /documents/{id}/downloadbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/documents/6a09cdc3-8948-47f0-aa62-74ac943d6c58/download"Generate a temporary download link for a document
生成文档临时下载链接
Generates a temporary pre-signed URL that can be used to download the document directly from the storage backend without authentication.
GET /documents/{id}/download_linkbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/documents/550e8400-e29b-41d4-a716-446655440000/download_link"Returns: (uri)
url生成临时预签名URL,无需身份验证即可直接从存储后端下载文档。
GET /documents/{id}/download_linkbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/documents/550e8400-e29b-41d4-a716-446655440000/download_link"返回参数:(URI)
urlUpdate requirement group for a phone number order
更新号码订单的要求组
POST /number_order_phone_numbers/{id}/requirement_grouprequirement_group_idbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"requirement_group_id": "550e8400-e29b-41d4-a716-446655440000"
}' \
"https://api.telnyx.com/v2/number_order_phone_numbers/550e8400-e29b-41d4-a716-446655440000/requirement_group"Returns: (uuid), (string), (date-time), (uuid), (boolean), (string), (uuid), (string), (string), (string), (array[object]), (boolean), (string), (string), (uuid)
bundle_idcountry_codedeadlineidis_block_numberlocalityorder_request_idphone_numberphone_number_typerecord_typeregulatory_requirementsrequirements_metrequirements_statusstatussub_number_order_idPOST /number_order_phone_numbers/{id}/requirement_grouprequirement_group_idbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"requirement_group_id": "550e8400-e29b-41d4-a716-446655440000"
}' \
"https://api.telnyx.com/v2/number_order_phone_numbers/550e8400-e29b-41d4-a716-446655440000/requirement_group"返回参数:(UUID)、(字符串)、(日期时间)、(UUID)、(布尔值)、(字符串)、(UUID)、(字符串)、(字符串)、(字符串)、(对象数组)、(布尔值)、(字符串)、(字符串)、(UUID)
bundle_idcountry_codedeadlineidis_block_numberlocalityorder_request_idphone_numberphone_number_typerecord_typeregulatory_requirementsrequirements_metrequirements_statusstatussub_number_order_idRetrieve regulatory requirements for a list of phone numbers
查询号码列表的监管要求
GET /phone_numbers_regulatory_requirementsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/phone_numbers_regulatory_requirements"Returns: (string), (string), (string), (array[object]), (array[object])
phone_numberphone_number_typerecord_typeregion_informationregulatory_requirementsGET /phone_numbers_regulatory_requirementsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/phone_numbers_regulatory_requirements"返回参数:(字符串)、(字符串)、(字符串)、(对象数组)、(对象数组)
phone_numberphone_number_typerecord_typeregion_informationregulatory_requirementsRetrieve regulatory requirements
查询监管要求
GET /regulatory_requirementsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/regulatory_requirements"Returns: (string), (string), (string), (array[object])
actioncountry_codephone_number_typeregulatory_requirementsGET /regulatory_requirementsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/regulatory_requirements"返回参数:(字符串)、(字符串)、(字符串)、(对象数组)
actioncountry_codephone_number_typeregulatory_requirementsList requirement groups
查询要求组列表
GET /requirement_groupsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirement_groups"GET /requirement_groupsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirement_groups"Create a new requirement group
创建新要求组
POST /requirement_groupscountry_codephone_number_typeactionOptional: (string), (array[object])
customer_referenceregulatory_requirementsbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"country_code": "US",
"phone_number_type": "local",
"action": "ordering"
}' \
"https://api.telnyx.com/v2/requirement_groups"Returns: (string), (string), (date-time), (string), (string), (string), (string), (array[object]), (enum: approved, unapproved, pending-approval, declined, expired), (date-time)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atPOST /requirement_groupscountry_codephone_number_typeaction可选参数:(字符串)、(对象数组)
customer_referenceregulatory_requirementsbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"country_code": "US",
"phone_number_type": "local",
"action": "ordering"
}' \
"https://api.telnyx.com/v2/requirement_groups"返回参数:(字符串)、(字符串)、(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(对象数组)、(枚举值:approved、unapproved、pending-approval、declined、expired)、(日期时间)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atGet a single requirement group by ID
根据ID查询要求组
GET /requirement_groups/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirement_groups/550e8400-e29b-41d4-a716-446655440000"Returns: (string), (string), (date-time), (string), (string), (string), (string), (array[object]), (enum: approved, unapproved, pending-approval, declined, expired), (date-time)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atGET /requirement_groups/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirement_groups/550e8400-e29b-41d4-a716-446655440000"返回参数:(字符串)、(字符串)、(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(对象数组)、(枚举值:approved、unapproved、pending-approval、declined、expired)、(日期时间)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atUpdate requirement values in requirement group
更新要求组中的要求值
PATCH /requirement_groups/{id}Optional: (string), (array[object])
customer_referenceregulatory_requirementsbash
curl \
-X PATCH \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/requirement_groups/550e8400-e29b-41d4-a716-446655440000"Returns: (string), (string), (date-time), (string), (string), (string), (string), (array[object]), (enum: approved, unapproved, pending-approval, declined, expired), (date-time)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atPATCH /requirement_groups/{id}可选参数:(字符串)、(对象数组)
customer_referenceregulatory_requirementsbash
curl \
-X PATCH \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/requirement_groups/550e8400-e29b-41d4-a716-446655440000"返回参数:(字符串)、(字符串)、(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(对象数组)、(枚举值:approved、unapproved、pending-approval、declined、expired)、(日期时间)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atDelete a requirement group by ID
根据ID删除要求组
DELETE /requirement_groups/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/requirement_groups/550e8400-e29b-41d4-a716-446655440000"Returns: (string), (string), (date-time), (string), (string), (string), (string), (array[object]), (enum: approved, unapproved, pending-approval, declined, expired), (date-time)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atDELETE /requirement_groups/{id}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/requirement_groups/550e8400-e29b-41d4-a716-446655440000"返回参数:(字符串)、(字符串)、(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(对象数组)、(枚举值:approved、unapproved、pending-approval、declined、expired)、(日期时间)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atSubmit a Requirement Group for Approval
提交要求组审核
POST /requirement_groups/{id}/submit_for_approvalbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/requirement_groups/550e8400-e29b-41d4-a716-446655440000/submit_for_approval"Returns: (string), (string), (date-time), (string), (string), (string), (string), (array[object]), (enum: approved, unapproved, pending-approval, declined, expired), (date-time)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atPOST /requirement_groups/{id}/submit_for_approvalbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
"https://api.telnyx.com/v2/requirement_groups/550e8400-e29b-41d4-a716-446655440000/submit_for_approval"返回参数:(字符串)、(字符串)、(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(对象数组)、(枚举值:approved、unapproved、pending-approval、declined、expired)、(日期时间)
actioncountry_codecreated_atcustomer_referenceidphone_number_typerecord_typeregulatory_requirementsstatusupdated_atList all requirement types
查询所有要求类型
List all requirement types ordered by created_at descending
GET /requirement_typesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirement_types?sort=['name']"Returns: (object), (string), (string), (string), (uuid), (string), (string), (enum: document, address, textual), (string)
acceptance_criteriacreated_atdescriptionexampleidnamerecord_typetypeupdated_at按创建时间倒序排列返回所有要求类型
GET /requirement_typesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirement_types?sort=['name']"返回参数:(对象)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(枚举值:document、address、textual)、(字符串)
acceptance_criteriacreated_atdescriptionexampleidnamerecord_typetypeupdated_atRetrieve a requirement types
查询要求类型详情
Retrieve a requirement type by id
GET /requirement_types/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirement_types/a38c217a-8019-48f8-bff6-0fdd9939075b"Returns: (object), (string), (string), (string), (uuid), (string), (string), (enum: document, address, textual), (string)
acceptance_criteriacreated_atdescriptionexampleidnamerecord_typetypeupdated_at根据ID查询指定要求类型
GET /requirement_types/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirement_types/a38c217a-8019-48f8-bff6-0fdd9939075b"返回参数:(对象)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(枚举值:document、address、textual)、(字符串)
acceptance_criteriacreated_atdescriptionexampleidnamerecord_typetypeupdated_atList all requirements
查询所有要求
List all requirements with filtering, sorting, and pagination
GET /requirementsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirements?sort=['country_code']"Returns: (enum: both, branded_calling, ordering, porting), (string), (string), (uuid), (string), (enum: local, national, toll_free), (string), (array[object]), (string)
actioncountry_codecreated_atidlocalityphone_number_typerecord_typerequirements_typesupdated_at支持筛选、排序和分页,返回所有要求列表
GET /requirementsbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirements?sort=['country_code']"返回参数:(枚举值:both、branded_calling、ordering、porting)、(字符串)、(字符串)、(UUID)、(字符串)、(枚举值:local、national、toll_free)、(字符串)、(对象数组)、(字符串)
actioncountry_codecreated_atidlocalityphone_number_typerecord_typerequirements_typesupdated_atRetrieve a document requirement
查询文档要求详情
Retrieve a document requirement record
GET /requirements/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirements/a9dad8d5-fdbd-49d7-aa23-39bb08a5ebaa"Returns: (enum: both, branded_calling, ordering, porting), (string), (string), (uuid), (string), (enum: local, national, toll_free), (string), (array[object]), (string)
actioncountry_codecreated_atidlocalityphone_number_typerecord_typerequirements_typesupdated_at获取指定文档要求记录
GET /requirements/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/requirements/a9dad8d5-fdbd-49d7-aa23-39bb08a5ebaa"返回参数:(枚举值:both、branded_calling、ordering、porting)、(字符串)、(字符串)、(UUID)、(字符串)、(枚举值:local、national、toll_free)、(字符串)、(对象数组)、(字符串)
actioncountry_codecreated_atidlocalityphone_number_typerecord_typerequirements_typesupdated_atUpdate requirement group for a sub number order
更新子号码订单的要求组
POST /sub_number_orders/{id}/requirement_grouprequirement_group_idbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"requirement_group_id": "a4b201f9-8646-4e54-a7d2-b2e403eeaf8c"
}' \
"https://api.telnyx.com/v2/sub_number_orders/550e8400-e29b-41d4-a716-446655440000/requirement_group"Returns: (string), (date-time), (string), (uuid), (boolean), (uuid), (string), (array[object]), (integer), (string), (array[object]), (boolean), (string), (date-time)
country_codecreated_atcustomer_referenceidis_block_sub_number_orderorder_request_idphone_number_typephone_numbersphone_numbers_countrecord_typeregulatory_requirementsrequirements_metstatusupdated_atPOST /sub_number_orders/{id}/requirement_grouprequirement_group_idbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"requirement_group_id": "a4b201f9-8646-4e54-a7d2-b2e403eeaf8c"
}' \
"https://api.telnyx.com/v2/sub_number_orders/550e8400-e29b-41d4-a716-446655440000/requirement_group"返回参数:(字符串)、(日期时间)、(字符串)、(UUID)、(布尔值)、(UUID)、(字符串)、(对象数组)、(整数)、(字符串)、(对象数组)、(布尔值)、(字符串)、(日期时间)
country_codecreated_atcustomer_referenceidis_block_sub_number_orderorder_request_idphone_number_typephone_numbersphone_numbers_countrecord_typeregulatory_requirementsrequirements_metstatusupdated_atList all user addresses
查询所有用户地址
Returns a list of your user addresses.
GET /user_addressesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/user_addresses?sort=street_address"Returns: (string), (string), (string), (string), (string), (string), (string), (string), (uuid), (string), (string), (string), (string), (string), (string), (string), (string)
administrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_at返回你的所有用户地址列表。
GET /user_addressesbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/user_addresses?sort=street_address"返回参数:(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)
administrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atCreates a user address
创建用户地址
Creates a user address.
POST /user_addressesfirst_namelast_namebusiness_namestreet_addresslocalitycountry_codeOptional: (string), (string), (string), (string), (string), (string), (string), (boolean)
administrative_areaboroughcustomer_referenceextended_addressneighborhoodphone_numberpostal_codeskip_address_verificationbash
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/user_addresses"Returns: (string), (string), (string), (string), (string), (string), (string), (string), (uuid), (string), (string), (string), (string), (string), (string), (string), (string)
administrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_at创建新的用户地址。
POST /user_addressesfirst_namelast_namebusiness_namestreet_addresslocalitycountry_code可选参数:(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)
administrative_areaboroughcustomer_referenceextended_addressneighborhoodphone_numberpostal_codeskip_address_verificationbash
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/user_addresses"返回参数:(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)
administrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atRetrieve a user address
查询用户地址详情
Retrieves the details of an existing user address.
GET /user_addresses/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/user_addresses/550e8400-e29b-41d4-a716-446655440000"Returns: (string), (string), (string), (string), (string), (string), (string), (string), (uuid), (string), (string), (string), (string), (string), (string), (string), (string)
administrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_at获取现有用户地址的详细信息。
GET /user_addresses/{id}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/user_addresses/550e8400-e29b-41d4-a716-446655440000"返回参数:(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(UUID)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)
administrative_areaboroughbusiness_namecountry_codecreated_atcustomer_referenceextended_addressfirst_nameidlast_namelocalityneighborhoodphone_numberpostal_coderecord_typestreet_addressupdated_atList all Verified Numbers
查询所有已验证号码
Gets a paginated list of Verified Numbers.
GET /verified_numbersbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/verified_numbers"Returns: (string), (enum: verified_number), (string)
phone_numberrecord_typeverified_at获取分页的已验证号码列表。
GET /verified_numbersbash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/verified_numbers"返回参数:(字符串)、(枚举值:verified_number)、(字符串)
phone_numberrecord_typeverified_atRequest phone number verification
发起号码验证请求
Initiates phone number verification procedure. Supports DTMF extension dialing for voice calls to numbers behind IVR systems.
POST /verified_numbersphone_numberverification_methodOptional: (string)
extensionbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+15551234567",
"verification_method": "sms"
}' \
"https://api.telnyx.com/v2/verified_numbers"Returns: (string), (string)
phone_numberverification_method启动电话号码验证流程。支持DTMF分机拨号,可呼叫IVR系统后的号码。
POST /verified_numbersphone_numberverification_method可选参数:(字符串)
extensionbash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+15551234567",
"verification_method": "sms"
}' \
"https://api.telnyx.com/v2/verified_numbers"返回参数:(字符串)、(字符串)
phone_numberverification_methodRetrieve a verified number
查询已验证号码详情
GET /verified_numbers/{phone_number}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/verified_numbers/+15551234567"Returns: (string), (enum: verified_number), (string)
phone_numberrecord_typeverified_atGET /verified_numbers/{phone_number}bash
curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/verified_numbers/+15551234567"返回参数:(字符串)、(枚举值:verified_number)、(字符串)
phone_numberrecord_typeverified_atDelete a verified number
删除已验证号码
DELETE /verified_numbers/{phone_number}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/verified_numbers/+15551234567"Returns: (string), (enum: verified_number), (string)
phone_numberrecord_typeverified_atDELETE /verified_numbers/{phone_number}bash
curl \
-X DELETE \
-H "Authorization: Bearer $TELNYX_API_KEY" \
"https://api.telnyx.com/v2/verified_numbers/+15551234567"返回参数:(字符串)、(枚举值:verified_number)、(字符串)
phone_numberrecord_typeverified_atSubmit verification code
提交验证码
POST /verified_numbers/{phone_number}/actions/verifyverification_codebash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"verification_code": "123456"
}' \
"https://api.telnyx.com/v2/verified_numbers/+15551234567/actions/verify"Returns: (string), (enum: verified_number), (string)
phone_numberrecord_typeverified_atPOST /verified_numbers/{phone_number}/actions/verifyverification_codebash
curl \
-X POST \
-H "Authorization: Bearer $TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"verification_code": "123456"
}' \
"https://api.telnyx.com/v2/verified_numbers/+15551234567/actions/verify"返回参数:(字符串)、(枚举值:verified_number)、(字符串)
phone_numberrecord_typeverified_at