Authorize Assets to a User

Last Updated on : 2023-06-15 04:49:25

Authorize multiple assets to a specified user by user ID and asset ID. You can choose whether to authorize the asset sub-nodes.

API address

POST: /v1.0/iot-03/users/{uid}/actions/batch-assets-authorized

Request parameter

Parameter nameTypeINRequiredDescription
uidStringuritrueThe ID of the authorized user.

Description of body

Parameter nameTypeINRequiredDescription
asset_idsStringbodytrueThe set of asset IDs.
authorized_childrenBooleanbodyfalseSpecifies whether to authorize sub-nodes. Default value: false.

Return parameter

Parameter nameTypeDescription
resultBooleantrue

Request example

POST: /v1.0/iot-03/users/bay1616667080117Pxxx/actions/batch-assets-authorized
{
  "uid": "bay1616667080117Pxxx",
  "asset_ids": "1399624700161691xxx,1399624700161692xxx",
  "authorizedChildren": true
}

Return example

{
    "result": true,
    "t": 1616501326790,
    "success": true
}

Error code

For more information, see error code.