
# 查询通知拦截记录 - ListNotificationRecords
#### 功能介绍
查询通知拦截记录
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/Workspace/doc?api=ListNotificationRecords)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-workspace/workspace_09_0128.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                                     | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | workspace:users:listNotificationRecords | Read | -           | -   | -  | -      |
     
  
 
#### URI
GET /v2/{project_id}/users/notification-records
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述    |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID。 |
   
表2Query参数 
| 参数                | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| query_type        | 是    | String  | 通过该类型查询桌面或桌面池相关的通知拦截记录 - DESKTOP: 查找当前projectId下与桌面相关的通知拦截记录   - DESKTOP_POOL: 查找当前projectId下与桌面池相关的通知拦截记录    |
| desktop_name      | 否    | String  | 桌面名                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| desktop_pool_name | 否    | String  | 桌面池名称，桌面池名称必须保证唯一。桌面名称只允许输入中文、大写字母、小写字母、数字、中划线，长度范围为1\~255。                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| user_name         | 否    | String  | 用户名                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| type              | 否    | String  | 过滤出与SMN通知类型一致的通知拦截记录 - EMAIL: 通过邮件查找通知拦截记录   - SMS: 通过短信查找通知拦截记录                                              |
| offset            | 否    | Integer | 用于分页查询，查询的起始记录序号，从0开始。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| limit             | 否    | Integer | 用于分页查询，取值范围0-1000，默认值1000。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| sort_field        | 否    | String  | 排序字段名称，需要结合sort_type字段一起使用。 - operate_time 发送时间                                                                                                                                                                                                                  |
| sort_type         | 否    | String  | 排序类型，默认升序，需要结合sort_field字段一起使用。 - ASC 升序。   - DESC 降序。                                                        |
   
#### 请求参数
无
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数                   | 参数类型                                                                                                 | 描述       |
|:---|:---|:---|
| total_count          | Integer                                                                                              | 总数       |
| notification_records | Array of [NotificationRecordInfo] objects | 通知拦截记录信息 |
   
 表4NotificationRecordInfo 
| 参数                | 参数类型   | 描述                      |
|:---|:---|:---|
| project_id        | String | 项目id                    |
| type              | String | 发送SMN类型:EMAIL-邮件、SMS-短信 |
| user_name         | String | 用户名                     |
| desktop_name      | String | 桌面名                     |
| desktop_pool_name | String | 桌面池名称                   |
| result            | String | 发送结果                    |
| error_message     | String | 报错信息                    |
| operate_time      | String | 操作时间                    |
   
**状态码：400**
表5响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码。                                                         |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：401**
表6响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码。                                                         |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：403**
表7响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码。                                                         |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：404**
表8响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码。                                                         |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
**状态码：500**
表9响应Body参数 
| 参数                            | 参数类型   | 描述                                                           |
|:---|:---|:---|
| error_code                    | String | 错误码。                                                         |
| error_msg                     | String | 错误描述。                                                        |
| error_detail                  | String | 错误详情。                                                        |
| encoded_authorization_message | String | 加密后的详细拒绝原因，用户可以自行调用STS服务的decode-authorization-message接口进行解密。 |
   
#### 请求示例
```
/v2/29dfe82ada564ac2b927e1ff036d9a9b/users/notification-records
```
#### 响应示例
**状态码：200**
通知拦截记录响应体。
```
{
  "total_count" : 2,
  "notification_records" : [ {
    "project_id" : "20b726affecc4411bcdc49a66e3e8f63",
    "type" : "EMAIL",
    "user_name" : "zhangsan",
    "desktop_name" : "desktop",
    "result" : "FAIL",
    "error_message" : "经检测,您提供的zhangsan,desktop信息违反了相关法律条款,请检查并修改后再尝试发送。",
    "operate_time" : "2025-04-15T01:40:23.584Z"
  }, {
    "project_id" : "20b726affecc4411bcdc49a66e3e8f63",
    "type" : "SMS",
    "user_name" : "lisi",
    "desktop_pool_name" : "desktopPool",
    "result" : "FAIL",
    "error_message" : "经检测,您提供的lisi,desktopPool信息违反了相关法律条款,请检查并修改后再尝试发送。",
    "operate_time" : "2025-09-15T01:40:23.584Z"
  } ]
}
```
#### 状态码
| 状态码 | 描述                      |
|:---|:---|
| 200 | 通知拦截记录响应体。              |
| 400 | 由于包含语法错误，当前请求无法被服务器理解。  |
| 401 | 鉴权失败。                   |
| 403 | 没有操作权限。                 |
| 404 | 找不到资源。                  |
| 500 | 服务内部错误，具体返回错误码请参见错误码说明。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-workspace/ErrorCode.html)。
