Appearance
OpenAPI Integration Guide
App-related OpenAPI is mainly used for integrating platform functionality into App applications, enabling device data viewing and remote control through the App.
Operation Steps
Prerequisites
Before using the OpenAPI service, you need to first create an App application in the App Development -> App SDK menu.
Authorize the product data that this App application can access in the App Application List -> Associated Products page. Only after authorization can you discover and bind authorized product devices.
Obtain the user domain and user domain password on the App details page, which will be needed to exchange for access tokens.
App Integration
- Get SMS verification code, used for registering App users.
API address:
API Address | https://iot-api.acceleronix.io/v2/sms/enduserapi/v2/sendPhoneSmsCode |
---|---|
Request Method | POST |
Request parameters:
Parameter | Parameter Type | Required | Parameter Location | Parameter Description |
---|---|---|---|---|
code_type | int32 | Yes | Query | SMS type, can input the following scenarios: 1-Password reset, 2-Login, 3-Registration, 4-Account cancellation, 5-Add push person |
internationalCode | String | Yes | Query | International code, for example enter 86 for mainland China |
phone | String | Yes | Query | Phone number |
random | String | Yes | Query | Random number, a fixed length of 16 random characters |
ts | int64 | Yes | Query | Current timestamp in milliseconds, cannot exceed 10 minutes from server time |
userDomain | String | Yes | Query | User domain |
signature | String | Yes | Query | Signature generation rule: SHA256(phone + codeType + random + ts + userDomainSecret) The data after SHA256 encoding uses HEX_ENCODE format. Example phone: 13800138000 codeType: 3 random: 76a6L647F02CAoN9 ts: 1744773894369 userDomainSecret: 57Fk69oYgbs2aWWN362NtZwYB2RqKNqQ7yZESnF5VM33 Signature format: SHA256(13800138000376a6L647F02CAoN9174477389436957Fk69oYgbs2aWWN362NtZwYB2RqKNqQ7yZESnF5VM33) Calculated signature: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
Response parameters:
Parameter | Parameter Description | Type | schema |
---|---|---|---|
code | Error code, 200 means success, others are error codes | object | |
data | Return token value when successful | string | |
extMsg | Extended information | string | |
msg | Response message | string |
Response status codes:
Status Code | Description |
---|---|
200 | OK |
Request example:
Plain
curl -X 'POST' \
'https://iot-api.acceleronix.io/v2/sms/enduserapi/v2/sendPhoneSmsCode?codeType=3&internationalCode=86&phone=17132136550&random=76a6L647F02CAoN9&signature=2deb6518ca0ee701e28a6359a91270c59dbe69456a3336dc5f625bfa32e64df6&ts=1744773894369&userDomain=C.DM.10271.5' \
-H 'accept: */*' \
-d ''
The userDomainSecret used in the example is 57Fk69oYgbs2aWWN362NtZwYB2RqKNqQ7yZESnF5VM22
Response example:
Plain
Success:
{
"code": 200,
"msg": "",
"data": null,
"extMsg": null
}
Failure:
{
"code": 5420,
"msg": "Signature verification failed",
"data": null,
"extMsg": null
}
- Register a user via phone number
API address:
API Address | https://iot-api.acceleronix.io/v2/enduser/enduserapi/v2/phonePwdRegister |
---|---|
Request Method | POST |
Request parameters:
Parameter | Parameter Type | Required | Parameter Location | Parameter Description |
---|---|---|---|---|
internationalCode | String | No | Body | International code, default is for domestic |
phone | String | Yes | Body | Phone number |
random | String | No | Body | Random number used to encrypt and decrypt the password |
pwd | String | Yes | Body | Password Password encryption/decryption rule: AES128(pwd,MD5(random),initialization vector). AES encryption conventions: Encryption mode: CBC Padding: PKCS5Padding Data block bits: 128 bits Content: pwd AES key: MD5(random), MD5(random) generates a 16B uppercase string (taking the 8-24 part of the 32 length MD5 string) Initialization vector: Split the generated AES password (MD5(random)) into two groups of 8B byte data, reverse the order and combine them to generate new 16B byte data as the offset Output: BASE64 Character set: utf-8 Example: pwd: china1234 random: j1acpdj2bmtqZXVb AES key: 89A049614445CCA8 AES iv: 4445CCA889A04961 After encryption: lkZMvj0KDSJXlp66jBieHA== After decryption: china1234 |
smsCode | String | Yes | Body | SMS verification code (provided by the SMS service's send SMS verification code interface) |
userDomain | String | Yes | Body | User domain |
agreementList | List | Yes | Body | Agreements |
agreementList[0].protocolType | Integer | Yes | Body | Protocol type (1 Privacy Policy, 2 Service Agreement) |
agreementList[0].privacyVersion | String | Yes | Body | Protocol version |
Response parameters:
Parameter | Parameter Description | Type | schema |
---|---|---|---|
code | Error code, 200 means success, others are error codes | object | |
data | Return token value when successful | Object | |
data.uid | User ID | String | |
extMsg | Extended information | string | |
msg | Response message | string |
Response status codes:
Status Code | Description |
---|---|
200 | OK |
Request example:
Plain
curl -X 'POST' \
'https://iot-api.acceleronix.io/v2/enduser/enduserapi/v2/phonePwdRegister' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{"agreementList":[{"privacyVersion":"1.0.0","protocolType":1},{"privacyVersion":"1.0.0","protocolType":2}],"internationalCode":"86","phone":"17132136550","pwd":"KbbO5AsWloh9gulLei6NhQ==","random":"abcdef","smsCode":"606754","userDomain":"C.DM.10271.5"}'
Response example:
Plain
Success:
{
"code":200,
"msg":"",
"data":{
"uid":"C1"
},
"extMsg":null
}
Failure:
{
"code": 5037,
"msg": "SMS verification code verification failed",
"data": null,
"extMsg": null
}
- Log in to the account after successful registration to get the user token
API address:
API Address | https://iot-api.acceleronix.io/v2/enduser/enduserapi/phonePwdLogin |
---|---|
Request Method | POST |
Request parameters:
Parameter | Parameter Type | Required | Parameter Location | Parameter Description |
---|---|---|---|---|
internationalCode | String | No | Query | International code, default is for domestic |
phone | String | Yes | Query | Phone number |
random | String | No | Query | Random number used to encrypt and decrypt the password |
pwd | String | Yes | Query | Password Password encryption/decryption rule: AES128(pwd,MD5(random),initialization vector). AES encryption conventions: Encryption mode: CBC Padding: PKCS5Padding Data block bits: 128 bits Content: pwd AES key: MD5(random), MD5(random) generates a 16B uppercase string (taking the 8-24 part of the 32 length MD5 string) Initialization vector: Split the generated AES password (MD5(random)) into two groups of 8B byte data, reverse the order and combine them to generate new 16B byte data as the offset Output: BASE64 Character set: utf-8 Example: pwd: china1234 random: j1acpdj2bmtqZXVb AES key: 89A049614445CCA8 AES iv: 4445CCA889A04961 After encryption: lkZMvj0KDSJXlp66jBieHA== After decryption: china1234 |
userDomain | String | Yes | Query | User domain |
signature | String | Yes | Query | Signature generation rule: SHA256(internationalCode+phone+pwd+random+userDomainSecret) |
Response parameters:
Parameter | Parameter Description | Type | schema |
---|---|---|---|
code | Error code, 200 means success, others are error codes | object | |
data | Return token value when successful | Object | |
data.accessToken | Access token | Object | |
data.accessToken.expirationTime | Expiration timestamp in seconds. After this time, token is invalid | Long | |
data.accessToken.token | Token | String | |
data.refreshToken | Refresh token | Object | |
data.refreshToken.expirationTime | Expiration timestamp in seconds. After this time, token is invalid | Long | |
data.refreshToken.token | Token | String | |
extMsg | Extended information | string | |
msg | Response message | string |
Response status codes:
Status Code | Description |
---|---|
200 | OK |
Request example:
Plain
curl -X 'POST' \
'https://iot-api.acceleronix.io/v2/enduser/enduserapi/phonePwdLogin?internationalCode=86&phone=17132136550&pwd=KbbO5AsWloh9gulLei6NhQ%3D%3D&random=abcdef&signature=1fd91ebf096be51dae1c6055bc930bd8e24b1f477d2a47ae87eedb0f73057bf0&userDomain=C.DM.10271.5' \
-H 'accept: */*' \
-d ''
The userDomainSecret used in the example is 57Fk69oYgbs2aWWN362NtZwYB2RqKNqQ7yZESnF5VM22
Response example:
Plain
Success:
{
"code": 200,
"msg": "",
"data": {
"accessToken": {
"token": "Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJlbmR1c2VyIiwiYXVkIjoiQXVkaWVuY2UiLCJleHAiOjE3NDQ3ODc3ODYsImp0aSI6ImR2SXRGcjRJdW9IaVhKSmNCdjFTNkEiLCJpYXQiOjE3NDQ3ODA1ODYsIm5iZiI6MTc0NDc4MDQ2Niwic3ViIjoic3ViamVjdCIsInVpZCI6IkMxMzEzNjIiLCJ0eXBlIjoiQWNjZXNzVG9rZW4ifQ.Zwt52dXiZZhL0jRC9LzOGUFlBAbb2tVyM9a8fTXOEmV2TREvHf7HjYxTh26JznhRtJJm1XHOlvvPbjhwI9y2jXyDkFMcWjn9X91z-36Fd2WSH4YLjDahGTq6zNBSIoLAmwJjY7AYEDhw8ytGIyUOhCnRzTNUV8lHs6g72f5hVTZXEx97GSR6VxWRLOtEtyvOD6mcD4YEWWbtFNXl8vrQQYxq58Q4sWmM4nRTECYDMeda6SCIMPjUjZpFLmGYwZk184jz5pGw6ufFkA4Cj7QYMdcVmz7MQ5PaWx49w2Ze3TwTZPbwwpPhxffQPWS0Vvm7PxSHM07nSlLO9TZlDoepvA",
"expirationTime": 1744787786
},
"refreshToken": {
"token": "Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJlbmR1c2VyIiwiYXVkIjoiQXVkaWVuY2UiLCJleHAiOjE3NDczNzI1ODYsImp0aSI6Ijc0UEJIdEt5UmRidVdwVlFsNENGVEEiLCJpYXQiOjE3NDQ3ODA1ODYsIm5iZiI6MTc0NDc4MDQ2Niwic3ViIjoic3ViamVjdCIsInVpZCI6IkMxMzEzNjIiLCJ0eXBlIjoiUmVmcmVzaFRva2VuIn0.aB3FMr4IeDInhq-fVMjy032kad2WZhoqTLwwiXycTZpv9a3aed5TRZouYUjVKmE8I2ueB3gkPWLrVVjJzq0hzitSQz3NYk0aNtYJDGzdt7MC2BxEPMz8hEOr8Qz8bxHbnl3DFR1oYuwBcc7ZxG_yvqb4iG-zqwE3VyCeZo0Q_6YvS-ZszgQe0GPU5s9R1ktMXf7Dc23EOrgVr6nyU595GNK75qXG7Gurl0gMyoLGwJ0KPppj-jfPi0G4zn49zuoBWX--6Q3D4mMWRldH5OBFw19VNvulVzdcInfDjKi0E9SkfsBBxPLmSstbgjQ2gncfw2t6MnEP57_KKS9vdZQ21w",
"expirationTime": 1747372586
}
},
"extMsg": null
}
Failure:
{
"code": 5420,
"msg": "Signature verification failed",
"data": null,
"extMsg": null
}
- Use the token to call and query the list of devices already bound to the current account
API address:
API Address | https://iot-api.acceleronix.io/v2/enduser/enduserapi/phonePwdLogin |
---|---|
Request Method | POST |
Request parameters:
Parameter | Parameter Type | Required | Parameter Location | Parameter Description |
---|---|---|---|---|
pkList | String | No | Query | Product Key list, multiple separated by English commas |
dk | String | No | Query | Device Key |
deviceName | String | No | Query | Device name |
page | Integer | No | Query | Current page, default is page 1 |
pageSize | Integer | No | Query | Page size, default is 10 items |
Response parameters:
Parameter | Parameter Description | Type | schema |
---|---|---|---|
code | Error code, 200 means success, others are error codes | object | |
data | Device list | Object | |
extMsg | Extended information | string | |
msg | Response message | string |
Response status codes:
Status Code | Description |
---|---|
200 | OK |
Request example:
Plain
curl -X 'GET' \
'https://iot-api.acceleronix.io/v2/binding/enduserapi/userDeviceList' \
-H 'accept: */*' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJlbmR1c2VyIiwiYXVkIjoiQXVkaWVuY2UiLCJleHAiOjE3NDQ3ODgxNTEsImp0aSI6ImtJQ0xZSWpBOXRsN1VpRXY4WFplN1EiLCJpYXQiOjE3NDQ3ODA5NTEsIm5iZiI6MTc0NDc4MDgzMSwic3ViIjoic3ViamVjdCIsInVpZCI6IkMxMzEzNjIiLCJ0eXBlIjoiQWNjZXNzVG9rZW4ifQ.YpYuwsehgDtJdV10iEVozlPvzWOdPKvPPRG81alCDdgsJBvOhMA4HvniOIY6R417KxspaZB7ScUdfMGv7fDrsWYFuLjV3am8gmnB1Uy328Lz7I5f3O3EShsfKdcTkAZ6OrReFgVKRzFV1zYF5HHy5Og-SfOJjSyALl-aHTnJtSJ9T8DB6hhgjYDQff7_-fsQ7Yyvu25vfeEKLYKdg-70uxmVVjEcSgWmpdHjDnLGuQliMsJz4T4I641vTc8HWZZ3lUjEAT2yyrRvbUbzOtrU8eLad3j48iTEPOlBpaD6dWO3m3BMpeCEEEN2YtnKPx84xoepMwecMJtZ9CaD9m-wvQ'
Response example:
Plain
Success:
{
"code": 200,
"msg": "",
"data": {
"total": 1,
"list": [
{
"productKey": "p11pLZ",
"deviceKey": "D001",
"deviceTag": "047AD71AAA1F7670F599BACE484EDE7A",
"deviceName": "RGB Light-1744780780714",
"deviceStatus": "Offline",
"protocol": "MQTT",
"productName": "RGB Light",
"logoImage": "https://aiot-cdn.quectel.com/paas2/cdn/29c9cbead1ab4344829205aa2b9612911732871292272.jpeg",
"signalStrength": "88",
"uid": "C131362",
"userName": "QuE1DglfKXB",
"phone": "17132136550",
"locateType": null,
"deviceType": 1,
"ownerUid": null,
"shareCode": null,
"authKey": "FUjktXJpwJ8d3OLZoHTYtA==",
"authCode": null,
"bindingCode": null,
"btPwd": null,
"btLastUseTime": null,
"verified": 1,
"status": 1,
"networkType": "2",
"accessType": "0",
"sn": "D001",
"bindMode": 3,
"onlineStatus": 0,
"bindStatus": 1,
"deviceCreateTime": "2023-04-23 17:08:00",
"deviceCreateTimeTs": 1682240880000,
"activeTime": "2023-05-05 10:16:05",
"activeTimeTs": 1683252965000,
"deviceBindTime": "2025-04-16 13:19:41",
"deviceBindTimeTs": 1744780781133,
"lastConnTime": "2025-02-18 11:44:18",
"lastConnTimeTs": 1739850258248,
"lastOfflineTime": "2025-02-18 11:49:27",
"lastOfflineTimeTs": 1739850567256,
"invaildTime": null,
"invaildTimeTs": null,
"fid": null,
"frid": null,
"bindingType": 1,
"capabilitiesBitmask": 1,
"sharingExpireAt": null,
"sharingExpireTimeTs": null,
"upgradeStatus": null,
"userConfirmStatus": null,
"isNative": 1,
"isMatter": 0,
"firstItemCode": "smart_city",
"firstItemName": "RGB Light",
"secondItemCode": "SmartTwoWheels",
"secondItemName": "Two-Wheeler",
"lowPowerProduct": false,
"lowPowerCache": null,
"lowPowerStatus": false,
"aiCapabilityStatus": false,
"lowPowerAlive": 0,
"planId": null,
"gdid": null,
"groupState": 0,
"groupDeviceDeviceNum": null,
"matterInfo": null
}
],
"pageNum": 1,
"pageSize": 10,
"size": 1,
"startRow": 1,
"endRow": 1,
"pages": 1,
"prePage": 0,
"nextPage": 0,
"isFirstPage": true,
"isLastPage": true,
"hasPreviousPage": false,
"hasNextPage": false,
"navigatePages": 8,
"navigatepageNums": [
1
],
"navigateFirstPage": 1,
"navigateLastPage": 1
},
"extMsg": null
}
Failure:
{
"code": 5032,
"msg": "Token verification failed"
}
This completes the process of calling OpenAPI interfaces in the App application. For more OpenAPIs, please check the API List.