Skip to main content
Version: V4.0

General Device Service API


Get General Device Client Information

Request URL

POST /api/v1.0/invoke/open-ability/method/general-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
device_idStringBodyYesDevice ID

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
client_idStringBodyClient ID
usernameStringBodyUsername
passwordStringBodyPassword
domainStringBodyDomain
portStringBodyPort
onlineBooleanBodyWhether the device is online or not?
true: online
false: offline
topicObject<topic>BodyTopic
commandObject<command>BodyCommand

topic description

Parameter NameTypeLocationDescription
up_topicStringBodyUp topic
down_topicStringBodyDown topic

command description

Parameter NameTypeLocationDescription
up_commandStringBodyUp command
down_commandStringBodyDown 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

See Failure Return Example



Create General Device Client Information

Request URL

POST /api/v1.0/invoke/open-ability/method/general-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObjectBodyYesCommand parameter

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
device_idStringBodyDevice ID
client_idStringBodyClient ID
usernameStringBodyUsername
passwordStringBodyPassword
domainStringBodyDomain
portStringBodyPort
topicObject<topic>BodyTopic
commandObject<command>BodyCommand

topic description

Parameter NameTypeLocationDescription
up_topicStringBodyUp topic
down_topicStringBodyDown topic

command description

Parameter NameTypeLocationDescription
up_commandStringBodyUp command
down_commandStringBodyDown 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

See Failure Return Example



Create General Device Information

Request URL

POST /api/v1.0/invoke/open-ability/method/general-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObjectBodyYesCommand parameter

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
device_idStringBodyDevice 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

See Failure Return Example



Delete General Device Information

Request URL

POST /api/v1.0/invoke/open-ability/method/general-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
device_idStringBodyYesDevice ID

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObjectBodyReturn 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

See Failure Return Example



Batch Delete General Device Information

Request URL

POST /api/v1.0/invoke/open-ability/method/general-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
devices[]Object<device>BodyYesDevice information

device description

Parameter NameTypeLocationRequiredDescription
device_idStringBodyYesDevice ID

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObjectBodyReturn 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

See Failure Return Example



Trigger General Device Down Message

Request URL

POST /api/v1.0/invoke/open-ability/method/general-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
device_idStringBodyYesDevice ID
dataObjectBodyYesData

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObjectBodyReturn 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": {}
}

Failure Return Example

See Failure Return Example