# 查询精选展示位
接口应在服务器端调用,不可在前端(小程序、网页、APP等)直接调用,具体可参考接口调用指南
接口英文名:getbanner
通过该接口可查询当前生效的精选展示位和流程中的申请。
# 1. 调用方式
# HTTPS 调用
POST https://api.weixin.qq.com/channels/ec/basics/homepage/banner/get?access_token=ACCESS_TOKEN
# 云调用
- 本接口不支持云调用
# 第三方调用
本接口支持第三方平台代商家调用。
该接口所属的权限集 id 为:129、131
服务商获得其中之一权限集授权后,可通过使用 authorizer_access_token 代商家进行调用,具体可查看 第三方调用 说明文档。
# 2. 请求参数
# 查询参数 Query String parameters
参数名 | 类型 | 必填 | 示例 | 说明 |
---|---|---|---|---|
access_token | string | 是 | ACCESS_TOKEN | 接口调用凭证,可使用 access_token、authorizer_access_token |
# 请求体 Request Payload
无
# 3. 返回参数
# 返回体 Response Payload
参数名 | 类型 | 说明 |
---|---|---|
errcode | number | 错误码 |
errmsg | string | 错误信息 |
banner | object | 当前生效的展示位。 |
apply | object | 最近一次流程中的申请。不返回已生效或已撤销的申请。 |
# Res.banner Object Payload
当前生效的展示位。
参数名 | 类型 | 说明 |
---|---|---|
banner | objarray | 精选展示位。 |
scale | number | 当前生效的展示位的展示样式。枚举值可参考下文 |
# Res.apply Object Payload
最近一次流程中的申请。不返回已生效或已撤销的申请。
参数名 | 类型 | 说明 |
---|---|---|
apply_id | number | 申请编号 |
state | number | 申请状态。枚举值可参考下文 |
banner | objarray | 精选展示位申请明细 |
scale | number | 展示位的展示样式。枚举值可参考下文 |
# Res.banner.banner(Array) Object Payload
精选展示位。
参数名 | 类型 | 说明 |
---|---|---|
banner | object | - |
type | number | 展示位类型。枚举值可参考下文 |
product | object | - |
finder | object | - |
official_account | object | - |
# Res.banner.banner(Array).banner Object Payload
参数名 | 类型 | 说明 |
---|---|---|
img_url | string | 图片url |
title | string | 标题 |
description | string | 描述 |
# Res.banner.banner(Array).product Object Payload
参数名 | 类型 | 说明 |
---|---|---|
product_id | number | 商品id |
# Res.banner.banner(Array).finder Object Payload
参数名 | 类型 | 说明 |
---|---|---|
finder_user_name | string | 视频号ID |
feed_id | string | 视频号视频的唯一标识 |
# Res.banner.banner(Array).official_account Object Payload
参数名 | 类型 | 说明 |
---|---|---|
url | string | 公众号文章url |
# Res.apply.banner(Array) Object Payload
精选展示位申请明细
参数名 | 类型 | 说明 |
---|---|---|
banner | object | 精选展示位。 |
audit_state | number | 审核状态。具体参数内容可参考:1-审核中;2-审核驳回 |
audit_desc | string | 审核结果描述。audit_state为驳回时有值。 |
# Res.apply.banner(Array).banner Object Payload
精选展示位。
参数名 | 类型 | 说明 |
---|---|---|
banner | object | - |
type | number | 展示位类型。枚举值可参考: 1-商品;3-视频号;4-公众号 |
product | object | - |
finder | object | - |
official_account | object | - |
# Res.apply.banner(Array).banner.banner Object Payload
参数名 | 类型 | 说明 |
---|---|---|
img_url | string | 图片url |
title | string | 标题 |
description | string | 描述 |
# Res.apply.banner(Array).banner.product Object Payload
参数名 | 类型 | 说明 |
---|---|---|
product_id | number | 商品id |
# Res.apply.banner(Array).banner.finder Object Payload
参数名 | 类型 | 说明 |
---|---|---|
finder_user_name | string | 视频号ID |
feed_id | string | 视频号视频的唯一标识 |
# Res.apply.banner(Array).banner.official_account Object Payload
参数名 | 类型 | 说明 |
---|---|---|
url | string | 公众号文章url |
# 4. 注意事项
展示样式
枚举值 | 描述 |
---|---|
1 | 小图模式 |
2 | 大图模式 |
展示位类型
枚举值 | 描述 |
---|---|
1 | 商品 |
2 | 视频号 |
2 | 公众号 |
申请状态
枚举值 | 描述 |
---|---|
1 | 审核中 |
2 | 审核驳回 |
审核状态
枚举值 | 描述 |
---|---|
1 | 审核中 |
2 | 审核驳回 |
# 5. 代码示例
请求示例
POST https://api.weixin.qq.com/channels/ec/basics/homepage/banner/get?access_token=ACCESS_TOKEN
返回示例
{
"errcode": 0,
"errmsg": "ok",
"banner": {
"scale": 2,
"banner": [
{
"type": 1,
"product": {
"product_id": 123
},
"banner": {
"img_url": "https://store.mp.video.tencent-cloud.com/abc",
"title": "测试商品展示位标题",
"description": "测试商品展示位描述"
}
},
{
"type": 3,
"finder": {
"finder_user_name": "sphabc",
"feed_id": "export/abc"
},
"banner": {
"img_url": "https://store.mp.video.tencent-cloud.com/bcd",
"title": "测试视频号视频展示位标题",
"description": "测试视频号视频展示位描述"
}
},
{
"type": 4,
"official_account": {
"url": "http://mp.weixin.qq.com/abc"
},
"banner": {
"img_url": "https://store.mp.video.tencent-cloud.com/cde",
"title": "测试公众号文章展示位标题",
"description": "测试公众号文章展示位描述"
}
}
]
},
"apply": {
"apply_id": 123,
"state": 2,
"scale": 2,
"banner": [
{
"audit_state" : 1,
"audit_desc" : "图片不合规",
"banner": {
"type": 1,
"product": {
"product_id": 456
},
"banner": {
"img_url": "https://store.mp.video.tencent-cloud.com/xyz",
"title": "测试商品展示位标题",
"description": "测试商品展示位描述"
}
}
},
{
"audit_state" : 1,
"audit_desc" : "图片不合规",
"banner": {
"type": 4,
"official_account": {
"url": "http://mp.weixin.qq.com/xyz"
},
"banner": {
"img_url": "https://store.mp.video.tencent-cloud.com/wxy",
"title": "测试公众号文章展示位标题",
"description": "测试公众号文章展示位描述"
}
}
},
{
"audit_state" : 1,
"audit_desc" : "图片不合规",
"banner": {
"type": 3,
"finder": {
"finder_user_name": "sphxyz",
"feed_id": "export/xyz"
},
"banner": {
"img_url": "https://store.mp.video.tencent-cloud.com/vwx",
"title": "测试视频号视频标题",
"description": "测试视频号视频描述"
}
}
}
]
}
}
# 6. 错误码
以下是本接口的错误码列表,其他错误码可参考 通用错误码
错误码 | 错误描述 | 解决方案 |
---|---|---|
268549675 | 既无生效中的精选展示位,也无流程中的申请。 | |
268555516 | 无权限,仅供微信小店使用。 |
# 7. 适用范围
本接口支持「微信小店」账号类型调用。其他账号类型如无特殊说明,均不可调用。