创建回调模板
最近更新时间:2026-03-19 18:16:28
天翼云智能视图服务API
1.创建回调模板
接口功能介绍
本接口用于创建回调模板。
接口约束
无
URI
POST /callbackTemplate
路径参数
无
Query参数
无
请求参数
请求头header参数
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|---|
| Authorization | 是 | String | 认证信息。 | CT-HMAC-SHA256 Credential=FQ01GA2RR9IJFM1PWIPR/2023-07-18/vss, SignedHeaders=content-type;host;timestamp, Signature=c6e72dffcfb2d25d276e119781e1deb6656d966702191b2bd862d1691e39394f | |
| Content-Type | 是 | String | 互联网媒体类型。 | application/json;charset=utf-8 | |
| Host | 是 | String | 主机。 | vssapi.ctyun.cn | |
| Version | 是 | String | 版本。 | 2021-11-25 | |
| Timestamp | 是 | String | 时间戳。 | 1689643309 |
请求体body参数
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|---|
| TemplateName | 是 | String | 模板名称,4-64位,可包含大小写字母、数字、中文、中划线、下划线、小括号、空格。 | callback-template | |
| Description | 否 | String | 模板描述,长度小于等于256个字符。 | description | |
| CallbackKey | 是 | String | 回调Key。 | abc123 | |
| DeviceStatusNotifyUrl | 否 | String | 设备状态回调URL。DeviceStatusNotifyUrl,StreamStatusNotifyUrl,RecordNotifyUrl,SnapshotNotifyUrl,AiEventNotifyUrl至少选择一种。 | http://example.ctyun.cn/example | |
| StreamStatusNotifyUrl | 否 | String | 流状态回调URL。DeviceStatusNotifyUrl,StreamStatusNotifyUrl,RecordNotifyUrl,SnapshotNotifyUrl,AiEventNotifyUrl至少选择一种。 | http://example.ctyun.cn/example | |
| RecordNotifyUrl | 否 | String | 录制回调URL。DeviceStatusNotifyUrl,StreamStatusNotifyUrl,RecordNotifyUrl,SnapshotNotifyUrl,AiEventNotifyUrl至少选择一种。 | http://example.ctyun.cn/example | |
| AiEventNotifyUrl | 否 | String | AI回调URL。DeviceStatusNotifyUrl,StreamStatusNotifyUrl,RecordNotifyUrl,SnapshotNotifyUrl,AiEventNotifyUrl至少选择一种。 | http://example.ctyun.cn/example |
响应参数
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| statusCode | Integer | 响应状态码。 | 200 | |
| error | String | 错误码,执行成功时,不返回该字段。 | VSS_0001 | |
| message | String | 响应信息。 | 请求成功 | |
| requestId | String | 请求ID。 | 362d4e78556b47129182d0881fade86b | |
| returnObj | Object | 响应数据,执行失败时,不返回该字段。 | returnObj |
表 returnObj
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| TemplateId | String | 模板ID。 | 739943519892963328 | |
| CreatedTime | String | 模板创建时间。 | 1691992586 | |
| UpdatedTime | String | 模板更新时间。 | 1691992586 | |
| RequestId | String | 请求ID。 | 362d4e78556b47129182d0881fade86b |
请求示例
请求url
POST '/callbackTemplate'
请求头header
{
"Authorization": "CT-HMAC-SHA256 Credential=FQ01GA2RR9IJFM1PWIPR/2023-08-14/vss, SignedHeaders=content-type;host;timestamp, Signature=c1c3d08e8e78a0c53ad782cca568480292b368967b20cbb0c086fde810dc7f4d",
"Content-Type": "application/json;charset=utf-8",
"Host": "vssapi.ctyun.cn",
"Version": "2021-11-25",
"Timestamp": "1691992429"
}
请求体body
{
"TemplateName": "设备状态回调模板",
"CallbackKey": "123",
"DeviceStatusNotifyUrl": "http://example.ctyun.cn/example"
}
响应示例
{
"statusCode": 200,
"message": "请求成功",
"requestId": "ac1d6209ed16486b80f700b92c6dc162",
"returnObj": {
"TemplateId": "739943519892963328",
"CreatedTime": "1691992586",
"UpdatedTime": "1691992586",
"RequestId": "ac1d6209ed16486b80f700b92c6dc162"
}
}
状态码
请参考状态码说明。
错误码
请参考错误码说明。
本页目录: