General Device Service API
Get General Device Client Information
Request URL
POST /api/v1.0/invoke/open-ability/method/general-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| device_id | String | Body | Yes | Device ID |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object<result> | Body | Return result |
result description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| client_id | String | Body | Client ID |
| username | String | Body | Username |
| password | String | Body | Password |
| domain | String | Body | Domain |
| port | String | Body | Port |
| online | Boolean | Body | Whether the device is online or not? true: online false: offline |
| topic | Object<topic> | Body | Topic |
| command | Object<command> | Body | Command |
topic description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| up_topic | String | Body | Up topic |
| down_topic | String | Body | Down topic |
command description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| up_command | String | Body | Up command |
| down_command | String | Body | Down command |
Request Example
POST /api/v1.0/invoke/open-ability/method/general-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_general_device_client_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "d31adc223cc4b3bedb6bd4742dedcfa52"
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {
"client_id": "c8b5a73f8dd84abaa94dcs288be49b0cx",
"username": "ud8b5a73f8dd84abaa94dcs288be49b0c",
"password": "pud8b5a73f8dd84abaa94dcs288be49b0",
"domain": "my.akubela.com",
"port": "8883",
"online": true,
"topic": {
"up_topic": "$sys/up/v1/edge/c8b5a73f8dd84abaa94dcs288be49b0cx",
"down_topic": "$sys/down/v1/edge/c8b5a73f8dd84abaa94dcs288be49b0cx"
},
"command": {
"up_command": "v1.0_u_general_up_message",
"down_command": "v1.0_d_general_down_message"
}
}
}
Failure Return Example
Create General Device Client Information
Request URL
POST /api/v1.0/invoke/open-ability/method/general-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object | Body | Yes | Command parameter |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object<result> | Body | Return result |
result description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| device_id | String | Body | Device ID |
| client_id | String | Body | Client ID |
| username | String | Body | Username |
| password | String | Body | Password |
| domain | String | Body | Domain |
| port | String | Body | Port |
| topic | Object<topic> | Body | Topic |
| command | Object<command> | Body | Command |
topic description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| up_topic | String | Body | Up topic |
| down_topic | String | Body | Down topic |
command description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| up_command | String | Body | Up command |
| down_command | String | Body | Down command |
Request Example
POST /api/v1.0/invoke/open-ability/method/general-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "create_general_device_client_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "d31adc223cc4b3bedb6bd4742dedcfa52"
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {
"device_id": "d31adc223cc4b3bedb6bd4742dedcfa5d",
"client_id": "c8b5a73f8dd84abaa94dcs288be49b0w1",
"username": "ud8b5a73f8dd84abaa94dcs288be49b0a",
"password": "pud8b5a73f8dd84abaa94dcs288be49bc",
"domain": "my.akubela.com",
"port": "8883",
"topic": {
"up_topic": "$sys/up/v1/edge/c8b5a73f8dd84abaa94dcs288be49b0w1",
"down_topic": "$sys/down/v1/edge/c8b5a73f8dd84abaa94dcs288be49b0w1"
},
"command": {
"up_command": "v1.0_u_general_up_message",
"down_command": "v1.0_d_general_down_message"
}
}
}
Failure Return Example
Create General Device Information
Request URL
POST /api/v1.0/invoke/open-ability/method/general-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object | Body | Yes | Command parameter |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object<result> | Body | Return result |
result description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| device_id | String | Body | Device ID |
Request Example
POST /api/v1.0/invoke/open-ability/method/general-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "create_general_device_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {
"device_id": "d31adc223cc4b3bedb6bd4742dedcfa5d"
}
}
Failure Return Example
Delete General Device Information
Request URL
POST /api/v1.0/invoke/open-ability/method/general-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| device_id | String | Body | Yes | Device ID |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object | Body | Return result |
Request Example
POST /api/v1.0/invoke/open-ability/method/general-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "delete_general_device_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "d1b5a73f8dd84abaa94dcs248be49b0d1"
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
Failure Return Example
Batch Delete General Device Information
Request URL
POST /api/v1.0/invoke/open-ability/method/general-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| devices | []Object<device> | Body | Yes | Device information |
device description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| device_id | String | Body | Yes | Device ID |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object | Body | Return result |
Request Example
POST /api/v1.0/invoke/open-ability/method/general-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "batch_delete_general_device_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"devices": [
{
"device_id": "d1b5a73f8dd84abaa94dcs248be49b0d1"
}
]
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
Failure Return Example
Trigger General Device Down Message
Request URL
POST /api/v1.0/invoke/open-ability/method/general-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| device_id | String | Body | Yes | Device ID |
| data | Object | Body | Yes | Data |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object | Body | Return result |
Request Example
POST /api/v1.0/invoke/open-ability/method/general-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "trigger_general_device_down_message",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"device_id": "d1b5a73f8dd84abaa94dcs248be49b2d6",
"data": {}
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}