Pair Device by Scanning QR Code

Last Updated on : 2024-04-02 08:53:51download

For LTE Cat.1, Wi-Fi, and other devices that can be directly connected to the network, you can call this API to scan the QR code and pair a device.

API address

POST: /v2.0/cloud/thing/active/qrcode

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
qrcodeStringbodytrueThe short URL of the specified QR code.
space_idLongbodytrueThe ID of the specified space.
time_zone_idStringbodytrueThe ID of the specified time zone.

Return parameter

Parameter nameTypeDescription
tokenStringThe token.
deviceIdStringThe device ID.
successBooleanIndicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
tLongThe timestamp.
tidStringThe link ID.

Request example

POST: /v2.0/cloud/thing/active/qrcode
{
  "qrcode": "https://m.smart321.com/********",
  "space_id": "1500****",
  "time_zone_id": "Asia/Shanghai"
}

Return example

{
    "tid": "b8a2b49abbbc11eda71e169efc83a172",
    "result": {
        "deviceId": "vdevo163815529739***",
        "token": "94IB****"
    },
    "t": 1678065474602,
    "success": true
}

Error code

For more information, see error code.