# 获取可设置公众号列表

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

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

接口英文名：getLinkForShow

通过本接口可以获取[扫码关注组件](/miniprogram/dev/component/official-account.md)允许展示的公众号列表

## 1. 调用方式

### HTTPS 调用

```bash
GET https://api.weixin.qq.com/wxa/getwxamplinkforshow?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",
    "必填": "是",
    "说明": "接口调用凭证，可使用 [authorizer_access_token](/doc/oplatform/openApi/ticket-token/api_getauthorizeraccesstoken)"
  }
]
```

### 请求体 `Request Payload`

```json
[
  {
    "参数名": "page",
    "类型": "number",
    "必填": "是",
    "说明": "页码，从 0 开始"
  },
  {
    "参数名": "num",
    "类型": "number",
    "必填": "是",
    "说明": "每页记录数，最大为 20"
  }
]
```

## 3. 返回参数

### 返回体 `Response Payload`

```json
[
  {
    "参数名": "errcode",
    "类型": "number",
    "说明": "返回码"
  },
  {
    "参数名": "errmsg",
    "类型": "string",
    "说明": "错误信息"
  },
  {
    "参数名": "total_num",
    "类型": "number",
    "说明": "总记录数"
  },
  {
    "参数名": "biz_info_list",
    "类型": "objarray",
    "说明": "公众号信息列表"
  }
]
```

">

### Res.biz_info_list(Array) `Object Payload`

公众号信息列表

```json
[
  {
    "参数名": "nickname",
    "类型": "string",
    "说明": "公众号昵称"
  },
  {
    "参数名": "appid",
    "类型": "string",
    "说明": "公众号 appid"
  },
  {
    "参数名": "headimg",
    "类型": "string",
    "说明": "公众号头像"
  }
]
```

## 4. 注意事项

本接口无特殊注意事项

## 5. 代码示例

请求示例

```
GET https://api.weixin.qq.com/wxa/getwxamplinkforshow?page=0&num=20&access_token=ACCESS_TOKEN
```

返回示例

```json
{
  "errcode": 0,
  "errmsg": "ok",
  "total_num": 10,
  "biz_info_list": [
    {
      "nickname": "公众号昵称",
      "appid": "公众号appid",
      "headimg": "公众号头像"
    }
  ]
}
```

## 6. 错误码

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

```json
[
  {
    "错误码": "40001",
    "错误描述": "invalid credential  access_token isinvalid or not latest",
    "解决方案": "获取 access_token 时 AppSecret 错误，或者 access_token 无效。请开发者认真比对 AppSecret 的正确性，或查看是否正在为恰当的公众号调用接口"
  }
]
```

## 7. 适用范围

本接口支持「第三方平台」账号类型代调用，权限集请参考「调用方式」部分。其他账号类型如无特殊说明，均不可调用。
