# 获取小程序违规处罚记录
接口应在服务器端调用,不可在前端(小程序、网页、APP等)直接调用,具体可参考接口调用指南
接口英文名:getIllegalRecords
调用本 API 可以获取小程序的违规处罚记录。使用过程中如遇到问题,可在开放平台服务商专区发帖交流。
# 1. 调用方式
# HTTPS 调用
POST https://api.weixin.qq.com/wxa/getillegalrecords?access_token=ACCESS_TOKEN
# 云调用
- 本接口不支持云调用
# 第三方调用
本接口支持第三方平台代商家调用。
该接口所属的权限集 id 为:76
服务商获得其中之一权限集授权后,可通过使用 authorizer_access_token 代商家进行调用,具体可查看 第三方调用 说明文档。
# 2. 请求参数
# 查询参数 Query String parameters
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| access_token | string | 是 | 接口调用凭证,可使用 authorizer_access_token |
# 请求体 Request Payload
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| start_time | number | 否 | 查询时间段的开始时间,如果不填,则表示end_time之前90天内的记录 |
| end_time | number | 否 | 查询时间段的结束时间,如果不填,则表示start_time之后90天内的记录 |
# 3. 返回参数
# 返回体 Response Payload
| 参数名 | 类型 | 说明 |
|---|---|---|
| errcode | number | 返回码 |
| errmsg | string | 错误信息 |
| records | objarray | 违规处罚记录列表 |
# Res.records(Array) Object Payload
违规处罚记录列表
| 参数名 | 类型 | 说明 |
|---|---|---|
| illegal_record_id | string | 违规处罚记录id |
| create_time | number | 违规处罚时间 |
| illegal_reason | string | 违规原因 |
| illegal_content | string | 违规内容 |
| rule_url | string | 规则链接 |
| rule_name | string | 违反的规则名称 |
# 4. 注意事项
调用该接口,需要小程序将18、76的权限集授权给第三方平台;
# 其他说明
- 如果start_time和end_time都没有指定,则表示查询距离当前时间最近的90天内的记录。
# 5. 代码示例
请求示例
{
"start_time": 1600051606,
"end_time": 1600053000
}
返回示例
{
"errcode": 0,
"errmsg": "ok",
"records": [
{
"illegal_record_id": "2_11100",
"create_time": 1600051800,
"illegal_reason": "内容涉嫌欺诈",
"illegal_content": "违规内容",
"rule_url": "https://developers.weixin.qq.com/miniprogram/product/#_6-2-色情低俗内容",
"rule_name": "《微信小程序平台运营规范》",
},
{
"illegal_record_id": "3_11102",
"create_time": 1600051802,
"illegal_reason": "内容低俗",
"illegal_content": "违规内容",
"rule_url": "https://developers.weixin.qq.com/miniprogram/product/#_5-11-欺诈行为",
"rule_name": "《微信小程序平台运营规范》",
}
]
}
# 6. 错误码
以下是本接口的错误码列表,其他错误码可参考 通用错误码;调用接口遇到报错,可使用官方提供的 API 诊断工具 辅助定位和分析问题。
| 错误码 | 错误描述 | 解决方案 |
|---|---|---|
| -1 | system error | 系统繁忙,此时请开发者稍候再试 |
| 40001 | invalid credential access_token isinvalid or not latest | 获取 access_token 时 AppSecret 错误,或者 access_token 无效。请开发者认真比对 AppSecret 的正确性,或查看是否正在为恰当的公众号调用接口 |
| 43007 | require bizuser authorize | 检查授权关系 |
# 7. 适用范围
本接口支持「第三方平台」账号类型代调用,权限集请参考「调用方式」部分。其他账号类型如无特殊说明,均不可调用。