# 小程序认证进度查询

[调试诊断](https://developers.weixin.qq.com/console/devtools/debug?utm_source=api_tools)

> 接口应在服务器端调用，不可在前端（小程序、网页、APP等）直接调用，具体可参考[接口调用指南](/doc/oplatform/developers/dev/guide.md)。

接口英文名：secwxaapi_queryauth

小程序认证进度查询

## 1. 调用方式

### HTTPS 调用

```bash
POST https://api.weixin.qq.com/wxa/sec/queryauth?access_token=ACCESS_TOKEN
```

### 云调用

- 本接口不支持云调用。

### 第三方调用

- 本接口支持第三方平台代商家调用。

- 该接口所属的权限集 id 为：18

- 服务商获得其中之一权限集授权后，可通过使用 [authorizer_access_token](/doc/oplatform/developers/dev/AuthorizerAccessToken.md) 代商家进行调用，具体可查看 [第三方调用](/doc/oplatform/Third-party_Platforms/2.0/Before_Develop/call_interface.md) 说明文档。

## 2. 请求参数

### 查询参数 `Query String Parameters`

```json
[
  {
    "参数名": "access_token",
    "类型": "string",
    "必填": "是",
    "示例": "ACCESS_TOKEN",
    "说明": "接口调用凭证，可使用 [authorizer_access_token](/doc/oplatform/openApi/ticket-token/api_getauthorizeraccesstoken)"
  }
]
```

### 请求体 `Request Payload`

```json
[
  {
    "参数名": "taskid",
    "类型": "string",
    "必填": "是",
    "说明": "认证任务id"
  }
]
```

## 3. 返回参数

### 返回体 `Response Payload`

```json
[
  {
    "参数名": "errcode",
    "类型": "number",
    "说明": "错误码"
  },
  {
    "参数名": "errmsg",
    "类型": "string",
    "说明": "错误信息"
  },
  {
    "参数名": "task_status",
    "类型": "number",
    "说明": "当前任务流程的状态码：0: 初始状态；1: 任务超时, 24小时内有效；2: 用户授权拒绝；3: 用户授权同意；4: 发起人脸流程；5: 人脸认证失败；6: 人脸认证ok；7: 人脸认证后，已经提交手机号码下发验证码；8: 手机验证失败；9: 手机验证成功；11: 创建认证审核单失败；12: 创建认证审核审核单成功；14: 验证失败；15: 等待支付"
  },
  {
    "参数名": "auth_url",
    "类型": "string",
    "说明": "小程序管理员授权链接"
  },
  {
    "参数名": "apply_status",
    "类型": "number",
    "说明": "审核单状态，创建认证审核审核单成功后该值有效。0：审核单不存在；1：待支付；2：审核中；3：打回重填；4：认证通过；5：认证最终失败（不能再修改）"
  },
  {
    "参数名": "orderid",
    "类型": "number",
    "说明": "小程序后台展示的认证订单号"
  },
  {
    "参数名": "appid",
    "类型": "string",
    "说明": "小程序appid"
  },
  {
    "参数名": "refill_reason",
    "类型": "string",
    "说明": "当审核单被打回重填(apply_status=3)时有效"
  },
  {
    "参数名": "fail_reason",
    "类型": "string",
    "说明": "审核最终失败的原因(apply_status=5)时有效"
  }
]
```

## 4. 注意事项

本接口无特殊注意事项

## 5. 代码示例

请求示例

```bach
https://api.weixin.qq.com/wxa/sec/queryauth?access_token=TOKEN
```
```json
{
    "taskid": "xxxx"
}
```

返回示例

```json
{
  "errcode": 0,
  "errmsg": "",
  "task_status": 15,
  "apply_status": 0,
  "appid": "wx123123123123123"
}
```

## 6. 错误码

以下是本接口的错误码列表，其他错误码可参考 [通用错误码](/doc/oplatform/developers/errCode/README.md)；调用接口遇到报错，可使用官方提供的 [API 诊断工具](https://developers.weixin.qq.com/console/devtools/debug?utm_source=api_errcode) 辅助定位和分析问题。

```json
[
  {
    "错误码": "-1",
    "错误描述": "system error",
    "解决方案": "系统繁忙，此时请开发者稍候再试"
  },
  {
    "错误码": "0",
    "错误描述": "ok",
    "解决方案": "ok"
  }
]
```

## 7. 适用范围

本接口在不同账号类型下的可调用情况：

```json
[
  {
    "小程序": "✔",
    "小游戏": "✔"
  }
]
```

- ✔：该账号可调用此接口。
- 其他未明确声明的账号类型，如无特殊说明，均不可调用此接口。
