API Manual
SHARE.BACK

SHARE.MQTT_APIS

SHARE.OVERVIEW

MQTT_API.S_OVW_MQTT_1 SHARE.HERE MQTT_API.S_OVW_MQTT_2

MQTT_API.S_OVW_MQTT_3

MQTT_API.S_OVW_MQTT_4

MQTT_API.S_OVW_MQTT_5

MQTT_API.S_OVW_MQTT_6

RESPONSE_RESULT.T_THING_MESSAGE_FORMAT

RESPONSE_RESULT.S_THING_MESSAGE_FORMAT

RESPONSE_RESULT.T_KEY_VALUE_JSON_FORMAT
1.	{
2.	  "KeyIsString":"VALUE1",
3.	  "KeyIsNumber":12,
4.	  "KeyIsBoolean":true,
5.	  "KeyIsDouble":34.5,
6.	  "KeyIsLocationString":"13.7834533,100.5459483",
7.	  "KeyIsNumberArray":"[1,2,3]",
8.	  "KeyIsImage":"data:image/png;base64,iVBOR...",
9.	  "KeyIsVideo":"data:video/mp4;base64,AAAAH...",
10.	  "KeyIsAudio":"data:audio/mpeg;base64,AAAAFG...",
11.	  "KeyIsFile":"data:text/plain;base64,SGVsbG8..."
12.	}
MQTT_API.T_MQTT_CONNECT

MQTT_API.S_MQTT_CONNECT

HOST: device-entmagellan.ais.co.th
PORT: 1883 (MQTT), 8883 (MQTTS)
MQTT_API.T_MQTT_BROKER_CONNECT_REQ
MQTT_API.T_CLIENT_ID
MQTT_API.T_THE_BROKER_USE_CLIENT
MQTT_API.T_USER_NAME
MQTT_API.T_USER_NAME_FOR_CLIENT
MQTT_API.T_PASSWORD
MQTT_API.T_PASSWORD_FOR_CLIENT

MQTT_API.T_TO_ENABLE_SSL

mosquitto_pub -d -h $HOST -p 8883 -u $THING_IDENTIFIER -P $THING_SECRET -t "$TOPIC" -m ' ' --cafile ..\certs\caFile.cer --cert ..\certs\certFile.cer --key ..\certs\key.pem --insecure

MQTT_API.T_HOW_TO_QUALITY_OF_SERVICE

mosquitto_pub -d -h $HOST -p 8883 -u $THING_IDENTIFIER -P $THING_SECRET -t "$TOPIC" -m ' ' -q $1

MQTT_API.T_HOW_TO_KEEP_ALIVE

mosquitto_pub -d -h $HOST -p 8883 -u …
MQTT_API.T_RESPONSE_STATUS_CODE

MQTT_API.S_MQTT_PROVIDER_RESPONSE

RESPONSE_RESULT.S_STR_FORMAT_ARGS

RESPONSE_RESULT.T_API_NAME RESPONSE_RESULT.S_API_NAME

RESPONSE_RESULT.T_PROP_VALUE RESPONSE_RESULT.S_PROP_VALUE

RESPONSE_RESULT.T_NADE_NAME RESPONSE_RESULT.S_NODE_NAME

RESPONSE_RESULT.T_MQTT_STATUS
RESPONSE_RESULT.T_RES_RESULT
RESPONSE_RESULT.T_CODERESPONSE_RESULT.T_HTTP_STATUSRESPONSE_RESULT.T_CODE_PASS  SHARE.DES
200OK20000 RESPONSE_RESULT.S_THE_REQ_OPER_WAS_SUCCESS
201Created20100 RESPONSE_RESULT.S_SUCCESSFULLY_CREATED {$APIName} .
202Accepted20200 RESPONSE_RESULT.S_THE_REQ_OPER_PROGRESS
400Bad Request40000 RESPONSE_RESULT.S_THE_CLIENT_REQ_MISSING_FORMAT
40010 RESPONSE_RESULT.S_THE_CLIENT_REQ_BAD_REQ
40020 RESPONSE_RESULT.S_CANNOT_APPLE_PATH
40031 RESPONSE_RESULT.S_THE_THING_DENTIFIER_NOT_BE_DUPLICATED
40032 RESPONSE_RESULT.S_THE_THING_SECRET_NOT_BE_DUPLICATED
40033 RESPONSE_RESULT.S_THE_THING_NAME_NOT_BE_DUPLICATED
40034 RESPONSE_RESULT.S_THE_CONFIG_IS_REQ
40035 RESPONSE_RESULT.S_THE_SENSOR_IS_REQ
40036 RESPONSE_RESULT.S_THING_DENTIFIER_IS_REQ
40037 RESPONSE_RESULT.S_THING_DENTIFIER_IS_REQ
40038 RESPONSE_RESULT.S_THING_NAME_IS_REQ
40039 RESPONSE_RESULT.S_THING_DENTIFIER_BETWEEN_13_30 '{$TotalLength}' RESPONSE_RESULT.S_CHARACTERS
40040 RESPONSE_RESULT.S_THING_DENTIFIER_BETWEEN_8_20 '{$TotalLength}' RESPONSE_RESULT.S_CHARACTERS
40041 RESPONSE_RESULT.S_THING_NAME_MUST_BE_100 '{$TotalLength}' RESPONSE_RESULT.S_CHARACTERS
40042 RESPONSE_RESULT.S_UNIX_TIMESTAMP_IS_REQ
40043 RESPONSE_RESULT.S_THE_DATATYPE_IS_INVALID
401Unauthorized40103 RESPONSE_RESULT.S_THE_TOKEN_IS_UNTRUST
40104 RESPONSE_RESULT.S_THE_TOKEN_HAS_BEEN_TEMP_SUSPENDED
40105 RESPONSE_RESULT.S_THE_TOKEN_HAS_ALREADY_EXPIRED
403Forbidden40300 RESPONSE_RESULT.S_THE_CLIENT_REQ_MISSING_PARAMETER
40301 RESPONSE_RESULT.S_THE_CLIENT_REQ_ALREADY_EXIT
40302 RESPONSE_RESULT.S_THE_CLIENT_IS_REQ_ALD_USE
40303 RESPONSE_RESULT.S_THE_UNIX_TIMESTAMP_IS_NOT_REQ
40305 RESPONSE_RESULT.S_THE_OPER_HAS_ALREADY_EXPIRED
40306 RESPONSE_RESULT.S_THE {$APIName} RESPONSE_RESULT.S_STILL_IN_PROCESS
40307 RESPONSE_RESULT.S_THE {$PropertyValue} RESPONSE_RESULT.S_DONT_HAVE_PERMISSION_FOR_API
40308 RESPONSE_RESULT.S_THE_NUMBER_OPER_EXCEEDED_LIMIT
40309 RESPONSE_RESULT.S_THE_REQ_UNKNOW_ERROR
404Not Found40400 RESPONSE_RESULT.S_THE_REQ_OPER_NOT_FOUND
40401 RESPONSE_RESULT.S_THE_REQ_OPER_TERMINATED
409Conflict40900 RESPONSE_RESULT.S_THE {$PropertyValue} RESPONSE_RESULT.S_IS_CONFLICTES
413Request Entity Too Large41300 RESPONSE_RESULT.S_THE_REQ_OPER_IS_LIMITED
405Method Not Allowed40500 RESPONSE_RESULT.S_METHOD_NOT_ALLOWED
500Internal Server Error50000 RESPONSE_RESULT.S_INTERNAL_SERVER_ERROR
SHARE.AUTH

RESPONSE_RESULT.S_SUB_AUTH_1.1device-entmagellan.ais.co.thRESPONSE_RESULT.S_SUB_AUTH_1.2 $THING_TOKEN . RESPONSE_RESULT.S_SUB_AUTH_2 $THING_TOKEN RESPONSE_RESULT.S_SUB_AUTH_3 RESPONSE_RESULT.S_THING_TOKEN RESPONSE_RESULT.S_SUB_AUTH_4

RESPONSE_RESULT.S_SUB_AUTH_5 $THING_IDENTIFIER SHARE.AND $THING_SECRET. RESPONSE_RESULT.S_SUB_AUTH_6$THING_TOKEN. RESPONSE_RESULT.S_SUB_AUTH_7

SHARE.FORMAT_JSON

PUBLISH:

#Publish to server for request authentication thing in json or text/plain format.

TOPIC: api/v2/thing/$THING_IDENTIFIER/$THING_SECRET/auth/req

SUBSCRIBE:

#Subscribes to get the response of authentication thing in json format.

TOPIC: api/v2/thing/$THING_IDENTIFIER/$THING_SECRET/auth/resp


Format Plain Text

SUBSCRIBE:

#Subscribes to get the response of authentication thing in plain text format.

TOPIC: api/v2/thing/$THING_IDENTIFIER/$THING_SECRET/auth/resp/pta

***The publish request of plain text is same the json format.

RESPONSE_RESULT.T_EXAMPLE_CLI
Content-Format: application/json
Content-Format: text/plain
RESPONSE_RESULT.T_REPORT_THING_REAL_TIME

RESPONSE_RESULT.S_REPORT_THING_REAL_TIME_1 $THING_TOKEN RESPONSE_RESULT.S_REPORT_THING_REAL_TIME_2

RESPONSE_RESULT.S_REPORT_THING_REAL_TIME_3

SHARE.FORMAT_JSON

PUBLISH:

#Publish to server for report message with multi sensor in json format only.

TOPIC: api/v2/thing/$THING_TOKEN/report/persist

PAYLOAD: {"$SENSOR_NAME":"$SENSOR_VALUE"}

***This command not support plain text format.

PUBLISH:

#Publish to server for report message with a sensor in json or text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/report/persist/pta/?sensor=$SENSOR_NAME

PAYLOAD:$SENSOR_VALUE

SUBSCRIBE:

#Subscribes to get the response of report status in json format.

TOPIC: api/v2/thing/$THING_TOKEN/report/resp


Format Plain Text

SUBSCRIBE:

#Subscribes to get the response of report status in plain text format.

TOPIC: api/v2/thing/$THING_TOKEN/report/resp/pta/+

RESPONSE_RESULT.T_EXAMPLE_CLI
Content-Format: application/json
Content-Format: text/plain
RESPONSE_RESULT.T_REPORT_THING_REAL_TIME

RESPONSE_RESULT.S_REPORT_THING_WITH_TIME_STAMP_1$UNIXTS RESPONSE_RESULT.S_REPORT_THING_WITH_TIME_STAMP_2$SENSOR RESPONSE_RESULT.S_REPORT_THING_WITH_TIME_STAMP_3 $THING_TOKEN RESPONSE_RESULT.S_REPORT_THING_WITH_TIME_STAMP_4***This command does not support plain.

RESPONSE_RESULT.S_REPORT_THING_WITH_TIME_STAMP_5 RESPONSE_RESULT.S_UNIXTS RESPONSE_RESULT.S_REPORT_THING_WITH_TIME_STAMP_6 RESPONSE_RESULT.S_SENSOR RESPONSE_RESULT.S_REPORT_THING_WITH_TIME_STAMP_7

SHARE.FORMAT_JSON

PUBLISH:

#Publish to server for report message with timestamp in json or text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/report/timestamp/persist

PAYLOAD: [{"UNIXTS":$UNIXTS ,"Sensor":{"$SENSOR_NAME":"$SENSOR_VALUE"}}]

SUBSCRIBE:

#Subscribes to get the response of report status.

TOPIC: api/v2/thing/$THING_TOKEN/report/timestamp/resp

RESPONSE_RESULT.T_EXAMPLE_CLI
Content-Format: application/json
RESPONSE_RESULT.T_HEARTBEAT

RESPONSE_RESULT.S_HEARTBEAT_1 $THING_TOKEN RESPONSE_RESULT.S_HEARTBEAT_2

SHARE.FORMAT_JSON

PUBLISH:

#Publish to server for heartbeat in json or text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/heartbeat

***The publish request of plain text is same the json format.

SUBSCRIBE:

#Subscribes to get the response of heartbeat status in json format.

TOPIC: api/v2/thing/$THING_TOKEN/heartbeat/resp


Format Plain Text

SUBSCRIBE:

#Subscribes to get the response of heartbeat status in text/plain format..

TOPIC: api/v2/thing/$THING_TOKEN/heartbeat/resp/pta

RESPONSE_RESULT.T_EXAMPLE_CLI
Content-Format: application/json
Content-Format: text/plain
RESPONSE_RESULT.T_SERVER_CONFIG

RESPONSE_RESULT.S_SERVER_CONFIG_1$THING_TOKENRESPONSE_RESULT.S_SERVER_CONFIG_2 $CONFIG_KEY RESPONSE_RESULT.S_SERVER_CONFIG_3

RESPONSE_RESULT.S_SERVER_CONFIG_4

SHARE.FORMAT_JSON

PUBLISH:

#Publish to server for get all configurations in json only.

TOPIC: api/v2/thing/$THING_TOKEN/config/req

***The publish request support json format only.

#Publish to server for get a configuration in json or text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/config/req/?config=$CONFIG_KEY

SUBSCRIBE:

#Subscribes to get the response of server configurations in json format.

TOPIC: api/v2/thing/$THING_TOKEN/config/resp


Format Plain Text

SUBSCRIBE:

#Subscribes to getting the multi configuration of thing in text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/config/resp/pta/+

#Subscribes to getting the a configuration of thing in text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/config/resp/pta/?config=$CONFIG_KEY

RESPONSE_RESULT.T_EXAMPLE_CLI
Content-Format: application/json
Content-Format: text/plain
RESPONSE_RESULT.T_CLIENT_CONFIG

RESPONSE_RESULT.S_CLIENT_CONFIG_1 $THING_TOKEN RESPONSE_RESULT.S_CLIENT_CONFIG_2device, to the Server by sending a GET command to the following URL.

SHARE.FORMAT_JSON

PUBLISH:

#Publish to server for device configuration in json or text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/config/persist

PAYLOAD: {"$CONFIG_KEY":"$CONFIG_VALUE"}

RESPONSE_RESULT.T_EXAMPLE_CLI
Content-Format: application/json
RESPONSE_RESULT.T_DELTA

RESPONSE_RESULT.S_DELTA_1 $THING_TOKENRESPONSE_RESULT.S_DELTA_2 $SENSOR_KEYRESPONSE_RESULT.S_DELTA_3

SHARE.FORMAT_JSON

PUBLISH:

#Publish to server for get all sensor of thing shadow in json only.

TOPIC: api/v2/thing/$THING_TOKEN/delta/req

***The publish request support json format only.

#Publish to server for get a sensor of thing shadow in json or text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/delta/req/?sensor=$SENSOR_KEY

SUBSCRIBE:

#Subscribes to get the response of thing shadow in json format.

TOPIC: api/v2/thing/$THING_TOKEN/delta/resp


Format Plain Text

SUBSCRIBE:

#Subscribes to getting the multi sensor of thing shadow in text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/delta/resp/pta/+

***The publish request of plain text is same the json format.

#Subscribes to getting the a sensor of thing shadow in text/plain format.

TOPIC: api/v2/thing/$THING_TOKEN/delta/resp/pta/?sensor=$SENSOR_KEY

RESPONSE_RESULT.T_EXAMPLE_CLI
Content-Format: application/json
Content-Format: text/plain
SHARE.CONTENT_ON_THIS_PAGE