Generate Pairing Token

Last Updated on : 2023-06-20 15:20:47download

Generate a pairing token.

API address

POST: /v1.0/iot-03/device-registration/token

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
pairing_typeString trueThe type of pairing. Valid values: EZ, AP, and Bluetooth.
time_zone_idString trueThe time zone where pairing is performed.
asset_idString trueThe asset ID.
lonString falseThe longitude.
latString falseThe latitude.
langString falseThe language.
extensionObject falseExtension data.

Return parameter

Parameter nameTypeDescription
resultDeviceDistributionNetworkRes

Description of result

Parameter nameTypeDescription
regionStringThe current zone.
tokenStringThe pairing token.
expire_timeLongThe expiration time of the token.
secretStringThe secret key.
extensionObjectThe device ID.

Request example

POST: /v1.0/iot-03/device-registration/token
{
  "asset_id": "1233213123123",
  "time_zone_id": "Asia/Shanghai",
  "pairing_type": "Bluetooth",
  "extension": {
    "uuid": "5682bceac872cfe7"
  }
}

Return example

{
    "result": {
        "extension": {
            "encrypt_key": "101xxxxxxx189f",
            "random": "fa2fxxxxxxxxcb38c"
        },
        "expire_time": 300,
        "secret": "pr_0",
        "token": "H73H****",
        "region": "AY"
    },
    "t": 1591257455025,
    "success": true
}

Error code

For more information, see error code.