通知服務API
配置通知地址
接口地址
POST /api/v1.0/invoke/open-ability/method/general-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| notice_url | String | Body | 是 | 通知地址 |
| custom | []Object<custom> | Body | 否 | 自定義信息 |
custom說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| notice_type | String | Body | 否 | 通知類型 family:家庭監聽通知 account:賬號監聽通知 device:設備監聽通知 space:空間監聽通知 scene:場景監聽通知 communication:溝通監聽通知 maintenance:報修監聽通知 booking:預約監聽通知 general_device:通用設備監聽通知 |
| notice_url | String | Body | 否 | 通知地址 |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/general-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "configure_notice_url",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"notice_url": "https://demo.akubela.com"
}
}
成功返回示例
狀態碼:200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回