# 查询服务卡片状态
接口应在服务器端调用,不可在前端(小程序、网页、APP等)直接调用,具体可参考接口调用指南
接口英文名:getUserNotify
查询服务卡片状态
# 1. 调用方式
# HTTPS 调用
POST https://api.weixin.qq.com/wxa/get_user_notify?access_token=ACCESS_TOKEN
# 云调用
- 本接口不支持云调用
# 第三方调用
本接口支持第三方平台代商家调用。
该接口所属的权限集 id 为:18
服务商获得其中之一权限集授权后,可通过使用 authorizer_access_token 代商家进行调用,具体可查看 第三方调用 说明文档。
# 2. 请求参数
# 查询参数 Query String parameters
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| access_token | string | 是 | 接口调用凭证,可使用 access_token、authorizer_access_token |
# 请求体 Request Payload
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| openid | string | 是 | 用户身份标识符 |
| notify_code | string | 是 | 动态更新令牌 |
| notify_type | number | 是 | 卡片id |
# 3. 返回参数
# 返回体 Response Payload
| 参数名 | 类型 | 说明 |
|---|---|---|
| errcode | number | 错误码 |
| errmsg | string | 错误信息 |
| notify_info | object | 卡片状态 |
# Res.notify_info Object Payload
卡片状态
| 参数名 | 类型 | 说明 |
|---|---|---|
| notify_type | number | 卡片id |
| content_json | string | 上次有效推送的卡片状态与状态相关字段,没推送过为空字符串。 |
| code_state | number | code 状态:0 正常;1 有风险;2 异常;10 用户拒收本次code |
| code_expire_time | number | code 过期时间,秒级时间戳。 |
# 4. 注意事项
本接口无特殊注意事项
# 5. 代码示例
# 5.1 成功返回
请求示例
{
"openid": "xxx",
"notify_type": 1001,
"notify_code": "xxx"
}
返回示例
{
"errcode": 0,
"errmsg": "ok",
"notify_info": {
"notify_type": 1001,
"content_json": "{\"cur_status\":2,\"license_plate\":\"粤A·12345A\",\"arrival_time\":1679569348,\"wxa_path_query\":\"\"}",
"code_state": 1,
"code_expire_time": 1681906267
}
}
# 5.2 异常返回
请求示例
{
"openid": "xxx",
"notify_type": 1001,
"notify_code": "xxx"
}
返回示例
{
"errcode": 85437,
"errmsg": "invalid notify_code"
}
# 6. 错误码
以下是本接口的错误码列表,其他错误码可参考 通用错误码;调用接口遇到报错,可使用官方提供的 API 诊断工具 辅助定位和分析问题。
| 错误码 | 错误描述 | 解决方案 |
|---|---|---|
| 40003 | invalid openid | 不合法的 OpenID ,请开发者确认 OpenID 的有效性 |
| 85431 | system error | 系统繁忙,稍后重试 |
| 85434 | invalid notify_type | notify_type 参数不合法 |
| 85437 | invalid notify_code | notify_code 不存在 |
| 85438 | notify_code expired | notify_code 已过期 |
# 7. 适用范围
本接口在不同账号类型下的可调用情况:
| 小程序 | 小游戏 |
|---|---|
| ✔ | ✔ |
- ✔:该账号可调用此接口
- 其他未明确声明的账号类型,如无特殊说明,均不可调用此接口;