# Platform Notification Message

Weixin Mini Program After the launch, due to user operations, platform rules change, developers change functions and other reasons, triggering a lot of security operations notifications.These notices are communicated to developers primarily in several forms:

  1. MP background and WeChat message push
  2. Developer-configured server to receive WeChat message push: View message push server configuration

Platform notification messages are mainly the following:

# I. Authorized User Information Change

1、 Authorizing user data changes: When some user data is at risk,The platform cleans up user data and notifies Weixin Mini Program developers who have been authorized in the last 30 days via a message push server. We recommend that developers be aware of the incidents and proactively update or clean users' avatar and nicknames in a timely manner to reduce risk.
2、 Authorized user data withdrawal: When a user withdraws authorized information, the platform will notify the Weixin Mini Program developer via the message push server, and ask the developer to take care to delete the user information in a timely manner.
3、 Authorized users complete logging out: When authorized users complete log out, the platform will notify the Weixin Mini Program developer through the message push server, Please fulfill the corresponding personal information protection obligations in accordance with the law and in a timely manner to protect the rights and interests of users.

# 1. Event field definition

attribute type Introductions
ToUserName string UserName for Weixin Mini Program
FromUserName string Platform Push Service UserName
MsgType string Default is: Event
Event string User_info_modified: user profile changes, user_authorization_revoke: user revocation, user_authorization_cancellation: user completes the cancellation;
CreateTime number Sending Time
OpenID string Authorized User OpenID
AppID string Weixin Mini Program AppID
RevokeInfo string User's revoked authorization information, 1: license plate number, 2: address, 3: invoice information, 4: Bluetooth, 5: microphone, 6: nickname and profile picture, 7: camera, 8: mobile phone number, 12:WeChat Number of steps taken, 13: Location information, 14: Selected picture or video, 15: Selected file, 16: Email address, 18: Location information selected, 19: nickname Enter the WeChat nickname selected in the keyboard, 20: Get the WeChat head selected in the user profile componentimage
PluginID string Plug-in scenario user withdrawal, Plug-in AppID
OpenPID string Plug-in scenario user withdrawal, withdrawal of the user's OpenPID

# 2. Example of event push:

# 2.1 XML

<xml>

<ToUserName><![CDATA[gh_870882ca4b1]]></ToUserName>

<FromUserName><![CDATA[owAqB1v0ahK_Xlc7GshIDdf2yf7E]]></FromUserName>

<CreateTime>1626857200</CreateTime>

<MsgType><![CDATA[event]]></MsgType>

<Event><![CDATA[user_authorization_revoke]]></Event>

<OpenID><![CDATA[owAqB1nqaOYYWl0Ng484G2z5NIwU]]></OpenID>

<AppID><![CDATA[wx13974bf780d3dc89]]></AppID>

<RevokeInfo><![CDATA[1]]></RevokeInfo>

<PluginID><![CDATA[wx13974bf780d3dc89]]></PluginID>

< OpenPID><![CDATA[G7esq5NVzP76HIHoB95t4CVBP6to]]></OpenPID>

</xml>

# 2.2 JSON

{

"ToUserName": "gh_870882ca4b1",

"FromUserName": "oaKk346BaWE-eIn4oSRWbaM9vR7s",

"CreateTime": 1627359464,

"MsgType": "event",

"Event": "user_authorization_revoke",

"OpenID": "oaKk343WOktAaT2ygsX138BGblrg",

"AppID": "wx13974bf780d3dc89",

"RevokeInfo": "1",

"PluginID": "wx13974bf780d3dc89",

"OpenPID": " G7esq5NVzP76HIHoB95t4CVBP6to"

}

# II. Weixin Mini Program Notice on Punishment Information for Violations

When there is a violation of Weixin Mini Program, the platform will notify the Mini Program developer through the message push server, and it is recommended that Mini Program developers pay attention to receiving relevant notifications in a timely manner to check and rectify. This notification does not affect the notification methods such as in-site letters. Click to view Message Push

# 1. Event field definition

# 1.1 When the field [Event] is equal to "wxa_punish_event," it means that this is a notification about [Weixin Mini Program violation penalty event.

attribute type Introductions
Event string Event name: wxa_punish_event, i.e. Weixin Mini Program Violation Penalty Information
event_type number Type of event. 1: Warning; 2: Functional blocking; 3: Take it off the shelves; 4: Accounts are blocked; 10: The page is blocked.
punish_id string Violation Penalty ID, used to uniquely identify each violation
appid string AppID penalized Weixin Mini Program
punish_time number Time of violation (UNIX timestamp)
illegal_reason string Reasons for the violation
illegal_content string Violations
rule_name string Violation of Rules Name
rule_url string Violation of the Rules Link
adjust_guide_url string Links to complaints of violations and guidelines for rectification
detail string Details of the penalty, the content of which is a JSON character string. The JSON structure depends on the event_type. Please refer to the instructions below to correctly parse the JSON string contained in the field

# 1.2 Details of the incident (detailed interpretation)

  • When event_type = 1 , the JSON character string in** detail [** is as follows:

    attribute type Introductions
    warned_type number Type of warning. 1: Warning that your account is blocked; 2: The warning function is blocked; 3: Warning to get off the shelves.
    rectify_deadline number Warning cutoff time (UNIX timestamp)
    warned_function_names array|The warning list of features to be banned, and the length of each feature in the list is directly available at the corresponding index of warned_ban_days. Warned_function_names and warned_ban_days always have a one-to-one correspondence.(This field only takes effect when warned_type = 2)
    warned_ban_days array|List of days of warning blocking.When warned_type = 1, the list has only one item, which represents the number of days that the Weixin Mini Program account is warned to be banned.When warned_type = 2, each item in the list represents the number of days that the function at the corresponding index in warned_function_names is warned to be blocked.When warned_type = 3, the list has only one item, which represents the number of days that the Mini Program is warned to take down.Note: 0 stands for permanent ban
  • When event_type = 2 , the JSON character string in** detail [** is as follows:

    attribute type Introductions
    banned_days array|A list of days a function item has been banned, each item in the list represents the number of days a function item has been banned at the corresponding index in banned_function_names. Note: 0 stands for permanent ban
    banned_function_names array|The list of banned features, if you want to get the ban time of each feature in the list, can be obtained directly in the corresponding index of the banded_days. There is always a one-to-one correspondence between banded_days and banded_function_names.
  • When event_type = 3 , the JSON character string in** detail [** is as follows:

    attribute type Introductions
    suspended_days number How many days did it go off the shelves? Note: 0 means permanently taken down
  • When event_type = 4 , the JSON character string in** detail [** is as follows:

    attribute type Introductions
    banned_days number Number of days your account is blocked. Note: 0 stands for permanent ban
  • When event_type = 5 , the JSON character string in** detail [** is as follows:

    attribute type Introductions
    path string Path of blocked pages

# 2. Example of event push parameters

  • event_type=1

    • warned_type=1
      {
          "ToUserName": "gh_1d6c1222test",
          "FromUserName": "oyeHc4i5LqBbWLVTfnhf-3TZ4BNk",
          "CreateTime": 1699803867,
          "MsgType": "event",
          "Event": "wxa_punish_event",
          "punish_id": "649557",
          "appid": "wx54a8eaa26606test",
          "punish_time": 1699803865,
          "illegal_reason": "存在诱导分享行为",
          "illegal_content": [
              "违规内容测试"
          ],
          "detail": "{\"warned_type\":1,\"rectify_deadline\":1699796571,\"warned_function_names\":[],\"warned_ban_days\":[3]}",
          "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1-滥用分享行为",
          "rule_name": "《微信小程序平台运营规范》5.行为规范-5.1滥用分享行为",
          "adjust_guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw",
          "event_type": 1
      }
      
    • warned_type=2
      {
          "ToUserName": "gh_1d6c1222test",
          "FromUserName": "oyeHc4pIdqHZwh80SufyUuIzSenw",
          "CreateTime": 1699795665,
          "MsgType": "event",
          "Event": "wxa_punish_event",
          "punish_id": "649551",
          "appid": "wx54a8eaa26606test",
          "punish_time": 1699795663,
          "illegal_reason": "存在诱导分享行为",
          "illegal_content": [
              "违规内容测试"
          ],
          "detail": "{\"warned_type\":2,\"rectify_deadline\":1699796571,\"warned_function_names\":[\"分享朋友圈\",\"客服消息接口\"],\"warned_ban_days\":[1,1]}",
          "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1-滥用分享行为",
          "rule_name": "《微信小程序平台运营规范》5.行为规范-5.1滥用分享行为",
          "adjust_guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw",
          "event_type": 1
      }
      
    • warned_type=3
      {
          "ToUserName": "gh_1d6c1222test",
          "FromUserName": "oyeHc4tGxCvPcXlKeFI5tU0jV_yw",
          "CreateTime": 1699795665,
          "MsgType": "event",
          "Event": "wxa_punish_event",
          "punish_id": "649551",
          "appid": "wx54a8eaa26606test",
          "punish_time": 1699795663,
          "illegal_reason": "存在诱导分享行为",
          "illegal_content": [
              "违规内容测试"
          ],
          "detail": "{\"warned_type\":3,\"rectify_deadline\":1699796571,\"warned_function_names\":[],\"warned_ban_days\":[1]}",
          "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1-滥用分享行为",
          "rule_name": "《微信小程序平台运营规范》5.行为规范-5.1滥用分享行为",
          "adjust_guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw",
          "event_type": 1
      }
      
  • event_type=2

    {
        "ToUserName": "gh_1d6c1222test",
        "FromUserName": "oyeHc4gSrT2S8jG2Ll1ZS16rwqQk",
        "CreateTime": 1699791600,
        "MsgType": "event",
        "Event": "wxa_punish_event",
        "punish_id": "13577492",
        "appid": "wx54a8eaa26606test",
        "punish_time": 1699791599,
        "illegal_reason": "存在诱导分享行为",
        "illegal_content": [
            "违规内容测试"
        ],
        "detail": "{\"banned_days\":[1,1],\"banned_function_names\":[\"分享朋友圈\",\"客服消息接口\"]}",
        "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1-滥用分享行为",
        "rule_name": "《微信小程序平台运营规范》5.行为规范-5.1滥用分享行为",
        "adjust_guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw",
        "event_type": 2
    }
    
  • event_type=3

    {
        "ToUserName": "gh_1d6c1222test",
        "FromUserName": "oyeHc4qHkaYV-0NYupPZBTBrBNuw",
        "CreateTime": 1699801563,
        "MsgType": "event",
        "Event": "wxa_punish_event",
        "punish_id": "13577869",
        "appid": "wx54a8eaa26606test",
        "punish_time": 1699801560,
        "illegal_reason": "存在诱导分享行为",
        "illegal_content": [
            "违规内容测试"
        ],
        "detail": "{\"suspended_days\":1}",
        "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1-滥用分享行为",
        "rule_name": "《微信小程序平台运营规范》5.行为规范-5.1滥用分享行为",
        "adjust_guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw",
        "event_type": 3
    }
    
  • event_type=4

    {
        "ToUserName": "gh_1d6c1222test",
        "FromUserName": "oyeHc4jjAdCWq1klrk-puPMe0FC4",
        "CreateTime": 1699784111,
        "MsgType": "event",
        "Event": "wxa_punish_event",
        "punish_id": "9328325",
        "appid": "wx54a8eaa26606test",
        "punish_time": 1699784109,
        "illegal_reason": "存在诱导分享行为",
        "illegal_content": [
            "测试违规内容/证据"
        ],
        "detail": "{\"banned_days\":3}",
        "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1-滥用分享行为",
        "rule_name": "《微信小程序平台运营规范》5.行为规范-5.1滥用分享行为",
        "adjust_guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw",
        "event_type": 4
    }
    
  • event_type=10

    {
        "ToUserName": "gh_1d6c1222test",
        "FromUserName": "oyeHc4n0I6U3A4Fq7tfOAqmAJy8E",
        "CreateTime": 1699802583,
        "MsgType": "event",
        "Event": "wxa_punish_event",
        "punish_id": "94185814",
        "appid": "wx54a8eaa266009d6a",
        "punish_time": 1699802425,
        "illegal_reason": "发布低俗、性暗示或色情信息",
        "illegal_content": [
            "测试证据"
        ],
        "detail": "{\"path\":\"pages/fengjin/fengjin\"}",
        "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_6-2-色情低俗内容",
        "rule_name": "《微信小程序平台运营规范》6.信息内容规范-6.2色情低俗内容",
        "adjust_guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw",
        "event_type": 10
    }