# 查询推送

查询推送详情。

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/helpdesk/v1/notifications/:notification_id
HTTP Method | GET
接口频率限制 | [100 次/分钟](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
支持的应用类型 | Custom App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用** | 获取服务台资源详情(helpdesk:all:readonly)
字段权限要求 | **注意事项**：该接口返回体中存在下列敏感字段，仅当开启对应的权限后才会返回；如果无需获取这些字段，则不建议申请<br>获取用户 user ID(contact:user.employee_id:readonly)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | `user_access_token`<br>**值格式**："Bearer `access_token`"<br>**示例值**："Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[了解更多：如何选择与获取 access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)

**注意事项**：服务台请求Header中还需添加“服务台token”参数：

Key: X-Lark-Helpdesk-Authorization

Value: base64(helpdesk_id:helpdesk_token)，通过base64加密将helpdesk_id和helpdesk_token用':'连接而成的字符串。

[了解更多：获取与使用服务台token](https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN)

### 路径参数

名称 | 类型 | 描述
---|---|---
notification_id | string | 唯一ID<br>**示例值**："1624326025000"

### 查询参数

名称 | 类型 | 必填 | 描述
---|---|---|---
user_id_type | string | 否 | 用户 ID 类型<br>**示例值**：open_id<br>**可选值有**：<br>- open_id：标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。[了解更多：如何获取 Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的，在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID，应用开发商可以把同个用户在多个应用中的身份关联起来。[了解更多：如何获取 Union ID？](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：标识一个用户在某个租户内的身份。同一个用户在租户 A 和租户 B 内的 User ID 是不同的。在同一个租户内，一个用户的 User ID 在所有应用（包括商店应用）中都保持一致。User ID 主要用于在不同的应用间打通用户数据。[了解更多：如何获取 User ID？](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br>**默认值**：`open_id`<br>**当值为 `user_id`，字段权限要求**：<br>获取用户 user ID(contact:user.employee_id:readonly)

## 响应

### 响应体

名称 | 类型 | 描述
---|---|---
code | int | 错误码，非 0 表示失败
msg | string | 错误描述
data | \- | \-
notification | notification | push任务详情
id | string | 非必填，创建成功后返回
job_name | string | 必填，任务名称
status | int | 非必填，创建成功后返回
create_user | notification_user | 非必填，创建人
user_id | string | 非必填，用户id
avatar_url | string | 非必填，头像地址
name | string | 非必填，用户名称
created_at | string | 非必填，创建时间（毫秒时间戳）
update_user | notification_user | 非必填，更新用户
user_id | string | 非必填，用户id
avatar_url | string | 非必填，头像地址
name | string | 非必填，用户名称
updated_at | string | 非必填，更新时间（毫秒时间戳）
target_user_count | int | 非必填，目标推送用户总数
sent_user_count | int | 非必填，已推送用户总数
read_user_count | int | 非必填，已读用户总数
send_at | string | 非必填，推送任务触发时间（毫秒时间戳）
push_content | string | 必填，推送内容，详见：https://open.feishu.cn/tool/cardbuilder?from=howtoguide
push_type | int | 必填，<br>0（定时推送：push_scope不能等于3） 1（新人入职推送：push_scope必须等于1或者3；new_staff_scope_type不能为空）
push_scope_type | int | 必填，<br>推送范围（服务台私信） 0：组织内全部成员（user_list和department_list必须为空） 1：不推送任何成员（user_list和department_list必须为空，chat_list不可为空） 2：推送到部分成员（user_list或department_list不能为空） 3：入职新人 以上四种状态，chat_list都相对独立，只有在推送范围为1时，必须需要设置chat_list
new_staff_scope_type | int | 非必填，<br>新人入职范围类型（push_type为1时生效） 0：组织内所有新人 1：组织内特定的部门（new_staff_scope_department_list 字段不能为空）
new_staff_scope_department_list | notification_department\[\] | 非必填，新人入职生效部门列表
department_id | string | 部门ID
name | string | 非必填，部门名称
user_list | notification_user\[\] | 非必填，push推送到成员列表
user_id | string | 非必填，用户id
avatar_url | string | 非必填，头像地址
name | string | 非必填，用户名称
department_list | notification_department\[\] | 非必填，push推送到的部门信息列表
department_id | string | 部门ID
name | string | 非必填，部门名称
chat_list | notification_chat\[\] | 非必填，push推送到的会话列表(群)
chat_id | string | 非必填，会话ID
name | string | 非必填，会话名称
ext | string | 非必填，预留扩展字段
approval_app_link | string | 审批链接

### 响应体示例
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "notification": {
            "id": "6981801914270744596",
            "job_name": "测试推送任务",
            "status": 0,
            "create_user": {
                "user_id": "ou_7277fd1262bfafc363d5b2a1f9c2ac90",
                "avatar_url": "http://*.com/*.png",
                "name": "test"
            },
            "created_at": "1626332244719",
            "update_user": {
                "user_id": "ou_7277fd1262bfafc363d5b2a1f9c2ac90",
                "avatar_url": "http://*.com/*.png",
                "name": "test"
            },
            "updated_at": "1626332244719",
            "target_user_count": 1,
            "sent_user_count": 1,
            "read_user_count": 1,
            "send_at": "1626332244719",
            "push_content": "{   \"config\": {     \"wide_screen_mode\": true   },   \"elements\": [     {       \"tag\": \"div\",       \"text\": {         \"tag\": \"lark_md\",         \"content\": \"[飞书](https://www.feishu.cn)整合即时沟通、日历、音视频会议、云文档、云盘、工作台等功能于一体，成就组织和个人，更高效、更愉悦。\"       }     }   ] }",
            "push_type": 0,
            "push_scope_type": 0,
            "new_staff_scope_type": 0,
            "new_staff_scope_department_list": [
                {
                    "department_id": "od_7277fd1262bfafc363d5b2a1f9c2ac90",
                    "name": "测试部门"
                }
            ],
            "user_list": [
                {
                    "user_id": "ou_7277fd1262bfafc363d5b2a1f9c2ac90",
                    "avatar_url": "http://*.com/*.png",
                    "name": "test"
                }
            ],
            "department_list": [
                {
                    "department_id": "od_7277fd1262bfafc363d5b2a1f9c2ac90",
                    "name": "测试部门"
                }
            ],
            "chat_list": [
                {
                    "chat_id": "oc_7277fd1262bfafc363d5b2a1f9c2ac90",
                    "name": "测试群聊"
                }
            ],
            "ext": "{}"
        },
        "approval_app_link": "http://applink.feishu.cn/*xx"
    }
}
```

### 错误码

HTTP状态码 | 错误码 | 描述 | 排查建议
---|---|---|---
400 | 154000 | Bad request, please check your request body | 请求不合法，请检查参数
401 | 154001 | Unauthorized, please check you have the correct access | 检查Authorization 和 X-Lark-Helpdesk-Authorization 是否正确，应用和服务台属于同一租户
403 | 154003 | Please check you have the correct access | 检查是否申请正确权限
404 | 154004 | Resource not found | 资源不存在，请检查ID值
405 | 154005 | Method Forbidden | 检查是否有权限创建推送
500 | 155000 | Internal error | 内部错误，请联系我们

