Skip to content

OpenAPI Integration Guide

App OpenAPIs are used for app integration with the Developer Center, enabling device data monitoring and remote control through mobile applications.

Operation Step

Prerequisites

  1. Before using OpenAPI services, you need to click "Create an App" under "App Development" > "AppSDK Development" menu.
  2. On the "Application List" -> "Associate Product" page, authorize the accessible product data of App application. Only authorized product devices can be discovered and bound.
  3. On the "Details" page, obtain the user domain and user domain password, which will be required later to exchange for access Tokens.

App Integration

  1. Obtain the SMS verification code for App user registration.

API Address:

API Addresshttps://iot-api.acceleronix.io/v2/sms/enduserapi/v2/sendPhoneSmsCode
Request MethodPOST

Request Parameter:

ParameterTypeRequiredLocationDescription
code_typeint32YQuerySMS type. Available scenarios:
1-Password reset
2-Login
3-Registration
4-Deregistration
5-Add push contact
internationalCodeStringYQueryInternational code, e.g. 86 for Mainland China
phoneStringYQueryMobile phone number
randomStringYQueryRandom string with a fixed length of 16 characters
tsint64YQueryCurrent timestamp in milliseconds. The timestamp must not deviate from server time by more than 10 minutes.
userDomainStringYQueryUser domain
signatureStringYQuerysignature Generation Rule:
SHA256(phone + codeType + random + ts + userDomainSecret)
The data after SHA-256 encoding should be formatted using HEX_ENCODE (hexadecimal encoding).
Example
phone: 13800138000
codeType: 3
random: 76a6L647F02CAoN9
ts: 1744773894369
userDomainSecret: 57Fk69oYgbs2aWWN362NtZwYB2RqKNqQ7yZESnF5VM33
Signature Format:
SHA256(13800138000376a6L647F02CAoN9174477389436957Fk69oYgbs2aWWN362NtZwYB2RqKNqQ7yZESnF5VM33)
Calculated Signature:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Response Parameter:

ParameterDescriptionTypeschema
codeError code. 200 indicates success and others indicate error codes.object
dataToken returned after the successful executionstring
extMsgExtended informationstring
msgResponse messagestring

Response Status Code:

Status CodeDescription
200OK

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
}
  1. Register User Account via Mobile Phone Number

API Address:

API Addresshttps://iot-api.acceleronix.io/v2/enduser/enduserapi/v2/phonePwdRegister
Request MethodPOST

Request Parameter:

ParameterTypeRequiredLocationDescription
internationalCodeStringNBodyInternational code (defaults to domestic)
phoneStringYBodyMobile phone number
randomStringNBodyRandom string used for password encryption/decryption.
pwdStringYBodyPassword
Encryption/Decryption Rules
AES128(pwd,MD5(random),initialization vector).
AES Encryption Specifications:
Mode: CBC
Padding: PKCS5Padding
Block Size: 128-bit
Content: pwd
AES key: MD5(random). It generates a 16-byte uppercase string (extract characters 8-24 from the 32-character MD5 hash)
Initialization Vector(IV): Split the generated AES key (MD5(random) into two 8-byte segments, reverse their order, and combine to form a new 16-byte IV
Output: BASE64
Charset: utf-8
Example:
pwd: china1234
random: j1acpdj2bmtqZXVb
AES key: 89A049614445CCA8
AES iv: 4445CCA889A04961
Encrypted: lkZMvj0KDSJXlp66jBieHA==
Decrypted: china1234
smsCodeStringYBodySMS verification code (provided via SMS service API)
userDomainStringYBodyUser domain
agreementListListYBodyProtocol
agreementList[0].protocolTypeIntegerYBodyProtocol type (1. Privacy Policy. 2. Service Agreement)
agreementList[0].privacyVersionStringYBodyProtocol version

Response Parameter:

ParameterDescriptionTypeschema
codeError code. 200 indicates success and others indicate error codes.object
dataToken returned after the successful executionObject
data.uidUser IDString
extMsgExtended informationstring
msgResponse messagestring

Response Status Code:

Status CodeDescription
200OK

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 failed",
  "data": null,
  "extMsg": null
}
  1. Log in to the Account to Obtain User Token After Successful Registration

API Address:

API Addresshttps://iot-api.acceleronix.io/v2/enduser/enduserapi/phonePwdLogin
Request MethodPOST

Request Parameter:

ParameterTypeRequiredLocationDescription
internationalCodeStringNQueryInternational code (defaults to domestic)
phoneStringYQueryMobile phone number
randomStringNQueryRandom string used for password encryption/decryption
pwdStringYQueryPassword
Encryption/Decryption Rule:
AES128(pwd,MD5(random),IV).
AES Encryption Specifications:
Mode: CBC
Padding: PKCS5Padding
Block size: 128-bit
Content: pwd
AES key: MD5(random). It generates a 16-byte uppercase string (extract characters 8-24 from the 32-character MD5 hash).
Initialization Vector: Split the generated AES key (MD5(random) into two 8-byte segments, reverse their order, and combine to form a new 16-byte IV.
Output: BASE64
Charset: utf-8
Example:
pwd: china1234
random: j1acpdj2bmtqZXVb
AES key: 89A049614445CCA8
AES iv: 4445CCA889A04961
Encrypted: lkZMvj0KDSJXlp66jBieHA==
Decrypted: china1234
userDomainStringYQueryUser domain
signatureStringYQuerySignature Generation Rule: SHA256(internationalCode+phone+pwd+random+userDomainSecret)

Response Parameter:

ParameterDescriptionTypeschema
codeError code. 200 indicates success and others indicate error codes.object
dataToken returned after the successful executionObject
data.accessTokenAccess tokenObject
data.accessToken.expirationTimeExpiration timestamp (in seconds). Token becomes invalid after the expiration.Long
data.accessToken.tokentokenString
data.refreshTokenRefresh tokenObject
data.refreshToken.expirationTimeExpiration timestamp (in seconds). Token becomes invalid after the expiration.Long
data.refreshToken.tokentokenString
extMsgExtended informationstring
msgResponse messagestring

Response Status Code:

Status CodeDescription
200OK

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
}
  1. Query Bound Device List Using Token

API Address:

API Addresshttps://iot-api.acceleronix.io/v2/enduser/enduserapi/phonePwdLogin
Request MethodPOST

Request Parameter:

ParameterTypeRequiredLocationDescription
pkListStringNQueryProductKey list (multiple keys should be comma-separated)
dkStringNQueryDeviceKey
deviceNameStringNQueryDevice name
pageIntegerNQueryCurrent page number (default: 1)
pageSizeIntegerNQueryPage size (default: 10)

Response Parameter:

ParameterDescriptionTypeschema
codeError code. 200 indicates success and others indicate error codes.object
dataDevice listObject
extMsgExtended informationstring
msgResponse messagestring

Response Status Code:

Status CodeDescription
200OK

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": "Off",
        "protocol": "MQTT",
        "productName": "RGB light",
        "logoImage": "https://cdn-protocol.iotomp.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-wheeled vehicles",
        "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"
}

The process for calling OpenAPIs in the App is completed. For more OpenAPIs, please refer to OpenAPI List.