Generate Pairing Token

Last Updated on : 2021-07-16 07:55:31download

Generate a pairing token.

API address

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

Request parameter

Description of body

Parameter name Type IN Required Description
pairing_type String true The type of pairing. Valid values: EZ, AP, and Bluetooth.
time_zone_id String true The time zone where pairing is performed.
asset_id String true The asset ID.
lon String false The longitude.
lat String false The latitude.
lang String false The language.
extension Object false Extension data.

Return parameter

Parameter name Type Description
result DeviceDistributionNetworkRes

Description of result

Parameter name Type Description
region String The current zone.
token String The pairing token.
expire_time Long The expiration time of the token.
secret String The secret key.
extension Object The 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.