Query the Authorized Assets

Last Updated on : 2023-06-20 15:19:43download

Query the authorized assets by user ID (UID).

API address

GET: /v1.0/iot-03/users/{uid}/assets

Request parameter

Parameter nameTypeINRequiredDescription
uidStringuritrueThe user ID (UID).
page_noIntegerurifalseThe page number. Default value: 1 that means the first page.
page_sizeIntegerurifalseThe number of rows per page. Default value: 10.

Return parameter

Parameter nameTypeDescription
resultBasePageRes

Description of result

Parameter nameTypeDescription
has_moreBooleanWhether there is a next page of results.
totalLongThe total entries of data that meets the criteria.
listListThe list of data.

Description of list

Parameter nameTypeDescription
asset_idStringThe ID of a specified asset.
parent_asset_idStringThe ID of the parent asset. The top-level ID is set to -1.
asset_nameStringThe name of the asset.
levelIntegerThe tree level.

Request example

GET: /v1.0/iot-03/users/bay16257459716***/assets?pageNo=1&pageSize=100

Return example

{
    "result": {
        "list": [
            {
                "level": 0,
                "asset_id": "14307747***",
                "asset_name": "Iuiz***",
                "parent_asset_id": "-1"
            },
            {
                "level": 0,
                "asset_id": "14307744***",
                "asset_name": "JKJK***",
                "parent_asset_id": "-1"
            }
        ],
        "total": 2,
        "has_more": false
    },
    "t": 1629968103761,
    "success": true
}

Error code

For more information, see error code.