Query Role Information on Pages

Last Updated on : 2023-07-06 09:12:57download

Query the role information on pages according to the specified criteria.

API address

GET: /v1.0/iot-02/roles

Request parameter

Parameter nameTypeINRequiredDescription
requestRolePageQueryRequestquerytrueThe request of querying roles.

Description of request

Parameter nameTypeINRequiredDescription
role_codesString falseThe list of role IDs, separated with commas (,).
role_nameString falseThe name of a specified role.
gmt_modified_ascBoolean falseIndicates whether to display the items in ascending order of the modification time.Valid values:
  • true: yes.
  • false: no. Default value.
page_noInteger falseThe page number. Default value: 1.
page_sizeInteger falseThe number of items returned on each page. Default value: 20.

Return parameter

Parameter nameTypeDescription
resultPageResponseThe returned list of roles.

Description of result

Parameter nameTypeDescription
totalIntegerThe total number.
listListThe list of results.
has_moreBooleanSpecifies whether there is a next page.

Description of list

Parameter nameTypeDescription
role_codeStringThe identifier of a specified role.
role_nameStringThe name of a specified role.
remarkStringThe remarks.

Request example

GET: /v1.0/iot-02/roles?role_codes=aaa,bbb&role_name=roleName&page_no=1&page_size=20&gmt_modified_asc=true

Return example

{
    "result": {
        "list": [
            {
                "role_code": "roleCodegcnI",
                "remark": "",
                "role_name": "role1"
            },
            {
                "role_code": "roleCode323j",
                "remark": "",
                "role_name": "role2"
            },
            {
                "role_code": "roleCodeSxSF",
                "remark": "",
                "role_name": "role3"
            },
            {
                "role_code": "roleCodeSbqO",
                "remark": "",
                "role_name": "role4"
            }
        ],
        "has_more": true
    }
}

Error code

For more information, see error code.