POST
/
api
/
v1
/
platform
/
tenants
/
{tenant_id}
/
callbacks
/
endpoints
/
{endpoint_id}
/
subscriptions
创建回调订阅
curl --request POST \
  --url https://api.example.com/api/v1/platform/tenants/{tenant_id}/callbacks/endpoints/{endpoint_id}/subscriptions \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Id: <x-api-id>' \
  --header 'X-Api-Nonce: <x-api-nonce>' \
  --header 'X-Api-Signature: <api-key>' \
  --header 'X-Api-Timestamp: <x-api-timestamp>' \
  --data '
{
  "event_type": "command.completed",
  "status": "ACTIVE"
}
'
{
  "subscription_id": "callback_subscription_001",
  "tenant_id": "tenant_001",
  "endpoint_id": "callback_endpoint_001",
  "event_type": "command.completed",
  "status": "ACTIVE",
  "request_id": "req-001"
}

授权

X-Api-Signature
string
header
必填

UTMOS HMAC request signature with X-Api-Id, X-Api-Timestamp and X-Api-Nonce.

请求头

X-Api-Id
string
必填

平台管理员或租户管理员 credential

X-Api-Timestamp
string
必填

Unix seconds

X-Api-Nonce
string
必填

防重放 nonce

X-Api-Signature
string
必填

HMAC signature

X-Request-Id
string

调用方关联 ID;缺省由平台生成

路径参数

tenant_id
string
必填

Tenant identifier

endpoint_id
string
必填

回调地址标识

请求体

application/json
event_type
enum<string>
必填

可订阅的命令事件类型。命令执行结果状态由 command.completed payload 字段表达,不拆分为 command.succeeded 或 command.failed 等独立事件。

可用选项:
command.accepted,
command.completed
status
enum<string>
可用选项:
ACTIVE,
DISABLED,
DELETED

响应

Created

subscription_id
string
tenant_id
string
endpoint_id
string
event_type
enum<string>

可订阅的命令事件类型。命令执行结果状态由 command.completed payload 字段表达,不拆分为 command.succeeded 或 command.failed 等独立事件。

可用选项:
command.accepted,
command.completed
status
enum<string>
可用选项:
ACTIVE,
DISABLED,
DELETED
request_id
string