跳转到主要内容
PATCH
curl
Didit 的电话 API 可在一次请求中为多个国家/地区修改渠道、路由和目标。sms、voice、whatsapp 和 silent 开关对整个国家/地区的投递生效。 Didit 会在初始发送以及每个回退步骤中检查每个 closed_channels 条目。当 signals.device_platform 与列出的平台(web、ios 或 android)匹配时,该条目会阻止对应渠道。ipados 和 tvos 都与 ios 匹配。 省略 platforms 或传入 [],会对所有发送阻止该渠道。列出全部三个平台同样会对所有发送阻止该渠道,包括省略了 signals.device_platform 的发送。列出一个或两个平台时,仅当发送与其中之一匹配才会生效。发送空的 closed_channels 列表,即可移除该国家/地区的渠道关闭设置。 响应仅返回 updated,即请求中的国家/地区条目数量,包括与已保存内容相同的条目。电话设置 返回的是应用级的全局默认值,而非按国家/地区划分的渠道或路由。未知的国家代码会返回 400 invalid_country。closed_channels 中不受支持的渠道或平台会返回 400 invalid_setting。 受限 API 密钥需要对 applications 具有写入权限。没有此权限范围的密钥将收到 403。

授权

x-api-key
string
header
必填

Your application's API key, from Developers -> API keys in the Business Console. The primary key has full access. A named key can be scoped: none, read or write per resource, limited to some workflows or to approved sessions, to a list of IP addresses, and to an expiry date. 401 means the key is wrong, revoked or expired; 403 means no key was sent, the key has no access to this resource or action, or the request came from an address outside its IP list; 404 on a session route means the session is outside the key's workflows or statuses. A key without media access receives image, video and PDF URLs as null, and a key without sessions write receives session links and tokens as null. See https://docs.didit.me/console/api-keys.

请求头

Idempotency-Key
string

Optional retry-safety key you choose for one operation, up to 255 characters (a UUID works). A request repeated with the same key, endpoint, query and body is answered with the first response, same status and same body, and runs and bills nothing a second time. The same key with another endpoint, query or body returns 409 idempotency_key_reused, and while the first request is still running, 409 idempotency_key_in_progress with Retry-After. A failed request (any 4xx or 5xx) is not stored, so you can send it again with the same key. Keys belong to your application, whether you call with an API key or an access token. See Retries and idempotency.

Required string length: 1 - 255

请求体

application/json

Countries and routes to switch in bulk.

countries
object[]
必填

The countries to change.

Minimum array length: 1

响应

The country settings were saved. updated counts the country entries in the request.

How many country entries the request carried.

updated
integer
必填

How many country entries the request carried, whether or not an entry changed a saved value.

示例:

1

最后修改于 2026年11月24日