
# 查询应用侧角色列表 - ListAppRoles
#### 功能介绍
查询应用侧角色列表。
#### URI
GET /api/v2/tenant/applications/{application_id}/role-list
表1路径参数 
| 参数             | 是否必选 | 参数类型   | 描述    |
|:---|:---|:---|:---|
| application_id | 是    | String | 应用id。 |
表2Query参数 
| 参数     | 是否必选 | 参数类型    | 描述     |
|:---|:---|:---|:---|
| offset | 否    | Integer | 第几页。   |
| limit  | 是    | Integer | 每页多少条。 |
#### 请求参数
表3请求Header参数 
| 参数            | 是否必选 | 参数类型   | 描述                                                       |
|:---|:---|:---|:---|
| Content-Type  | 是    | String | 该字段内容填为"application/json;charset=utf8"。                  |
| Authorization | 是    | String | 认证凭据，值：Bearer {access_token}，access_token通过"获取访问凭据"接口获取。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数     | 参数类型                                                                      | 描述     |
|:---|:---|:---|
| total  | Integer                                                                   | 总数     |
| offset | Integer                                                                   | 第几页    |
| limit  | Integer                                                                   | 每页多少条  |
| roles  | Array of [RoleInfoResult] objects | 角色信息集合 |
   
 表5RoleInfoResult 
| 参数        | 参数类型   | 描述     |
|:---|:---|:---|
| id        | String | 角色id   |
| code      | String | 角色code |
| name      | String | 角色名称   |
| createdAt | String | 创建时间   |
| updatedAt | String | 修改时间   |
   
**状态码：400**
表6响应Body参数 
| 参数         | 参数类型   | 描述    |
|:---|:---|:---|
| error_code | String | 错误编号。 |
| error_msg  | String | 错误详情。 |
   
#### 请求示例
根据应用id分页查询应用侧角色列表，返回查询结果的前10条，如不满10条，则返回实际数量的结果。
```
GET https://{domain_name}/api/v2/tenant/applications/{application_id}/role-list?offset=0&limit=10
Authorization: Bearer 334963fc-1e4a-473b-9096-52a929140...
```
#### 响应示例
**状态码：200**
请求成功。
```
{
  "total" : 3,
  "offset" : 0,
  "limit" : 10,
  "roles" : [ {
    "id" : "20220415170305200-EF22-C2404E358",
    "code" : "role1",
    "name" : "role1",
    "createdAt" : "2022-04-15 17:03:05.200",
    "updatedAt" : null
  }, {
    "id" : "20220415170305223-7193-A01122B37",
    "code" : "role2",
    "name" : "role2",
    "createdAt" : "2022-04-15 17:03:05.223",
    "updatedAt" : null
  }, {
    "id" : "20220420144449385-C66D-E8C1D1D79",
    "code" : "admin",
    "name" : "管理员",
    "createdAt" : "2022-04-20 14:44:49.385",
    "updatedAt" : null
  } ]
}
```
#### 状态码
| 状态码 | 描述    |
|:---|:---|
| 200 | 请求成功。 |
| 400 | 请求失败。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-oneaccess/ErrorCode.html)。
