Authorize User with Assets

Last Updated on : 2023-07-19 09:52:45download

Based on the user ID and asset ID, authorize the specified user access to multiple assets. You can choose whether the user is authorized access to 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 the user access to sub-nodes. Default value: false.

Return parameter

Parameter nameTypeDescription
resultBooleanThe returned result.

Request example

POST: /v1.0/iot-03/users/bay1616667080117P***/actions/batch-assets-authorized

Return example

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

Error code

For more information, see error code.