# Platform Notification Message

After the WeChat mini program was launched, it triggered a lot of security operation notifications due to user operations, platform rules changes, developers changing functions and other reasons. These notifications are communicated to developers in several ways:

  1. MP Backstage and WeChat messaging
  2. Developer-configured server to receive WeChat messages: ViewMessage Push Server Configuration

Platform notification messages are mainly of the following types:

# I. Change of Authorized User Information

1、 Authorized user data change: When some user data is at risk, the platform will clean up the user data. And through the push message server to notify the authorized Mini Program developers in the last 30 days, we recommend that developers pay attention to the response event, and take the initiative to update or clean up the user's avatar and nickname in time to reduce risk.
2、 Authorization User Data Withdrawal: When the user withdraws the authorization information, the platform will notify the Mini Program developer through the message push server, and ask the developer to delete the user information in a timely manner.
3、 Authorized users complete the logout: When the authorized users complete the logout, the platform will notify the mini program developer through the message push server, and please fulfill the corresponding personal information protection obligations in accordance with the law and regulations in a timely manner to protect the rights and interests of users.

# 1. Event field definition

attribute type Introductions
ToUser string UserName for Mini Programs
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 AppID for Mini Programs
RevokeInfo string Authorization information withdrawn by the user, 1: License Plate Number, 2: Address, 3: Invoice Info, 4: Bluetooth, 5: Microphone, 6: Nickname and Avatar, 7: Camera, 8: Phone Number, 12: WeRun Steps, 13: Location Info, 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 avatar selected in the User Avatar component
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>

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

<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. Information Notice on Penalties for Violations of Minor Programs

When there is a violation of the mini program, the platform will notify the mini program developer through the message push server, and it is recommended that the mini program developer pay attention to receiving the relevant notice in time for investigation and rectification, and this notice does not affect the notification methods such as the existing station letter. Click to viewMessage Push Server Configuration

# 1. Event field definition

# 1.1 Field [Event] is equal to " wxa_punish_event " At the time, it means that this is a notice about the "Mini Program violation incident."

attribute type Introductions
Event string Event Name: wxa_punish_Event, that is, Mini Program violation penalty information
event_type number Event type. 1: Warning2: Functional blocking3: Off the Shelf4: Account Blocking10: Page blocked.
punish_id string Violation Penalty ID, used to uniquely identify each violation
appid string AppID of Penalized Mini Program
punish_Time number Time of violation (UNIX timestamp)
illegal_reason string Reasons for violations
illegal_content string Content violations
Rule_Name string Name of Violation
Rule_url string Breaking Rules Links
adjust_Guide_url string Links to Complaints and Rectification Guidelines
detail string Details of the violation penalty, the content of which is a JSON character string, depending on the event_Type, please refer to the instructions below for the correct parsing of the JSON character string contained in this field

# 1.2 Details of the incident (detailed interpretation)

  • whenevent_type=1timedetailThe JSON character string in

    attribute type Introductions
    warned_type number Warning type. 1: Warning Account Blocking2: Warning function blocked3: Warning off the shelf.
    rectify_deadline number Deadline for warning(UNIX Time Stamp)
    warned_function_names array Warning to block the list of features, if you want to get the list of each feature block duration, you can directly in the warned_ban_Get the corresponding index of days, warned_function_Names and warned_ban_Days is always one-to-one correspondence. (This field is only used when warned_Type = 2)
    warned_ban_days array List of days blocked by warnings. When warned_When type = 1, the list has only one item, which represents the number of days that the Mini Program account is warned to block. When warned_When type = 2, each item in the list represents warned_function_The number of days a feature at the corresponding index in names was warned to block. When warned_When 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
  • whenevent_type=2timedetailThe JSON character string in

    attribute type Introductions
    banned_days array A list of days when a feature item is banned, each item in the list represents banned_function_The number of days a feature at the corresponding index in names was blocked. Note: 0 stands for permanent ban
    banned_function_names array The list of banned features, if you need to get the banned duration of each feature in the list, you can directly find the banned feature in the banned list._Get at the corresponding index of days, banned_Days and banned_function_The names are always one-to-one correspondence.
  • whenevent_type=3timedetailThe JSON character string in

    attribute type Introductions
    suspended_days number Days off the shelf. Note: 0 is permanently off the shelf
  • whenevent_type=4timedetailThe JSON character string in

    attribute type Introductions
    banned_days number Number of days the account is blocked. Note: 0 stands for permanent ban
  • whenevent_type=5timedetailThe JSON character string in

    attribute type Introductions
    path string Blocked page path

# 2. Event push parameter example

  • event_type=1

    • warned_type=1
      {
          "ToUserName":  "gh_1d6c1222test",
          "FromUserName": "oyeHc4i5LqBbWLVTfnhf-3TZ4BNk",
          "CreateTime": 1699803867,
          "MsgType": "event",
          "Event": "wxa_punish_event",
          "punish_id": "649557",
          "apps":  "wx54a8eaa26606test",
          "punish_time": 1699803865,
          "illegal_reason": "Presence induced sharing behavior,"
          "illegal_content": [
              "Breach Content Testing"
          ],
          "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 - Abuse of Sharing " ,
          "rule_name": "WeChat Mini Program Platform Operation Code 5. Code of Conduct -5.1 Abuse of Sharing Behavior,"
          "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",
          "apps":  "wx54a8eaa26606test",
          "punish_time": 1699795663,
          "illegal_reason": "Presence induced sharing behavior,"
          "illegal_content": [
              "Breach Content Testing"
          ],
          "detail": "{"warned_type":2,"rectify_deadline":1699796571,"warned_function_names":[" Share WeChat Moments"," Customer Service Message Interface"],"warned_ban_days":[1,1]}",
          "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1 - Abuse of Sharing " ,
          "rule_name": "WeChat Mini Program Platform Operation Code 5. Code of Conduct -5.1 Abuse of Sharing Behavior,"
          "adjust_Guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw " ,
          "event_type": 1
      }
      
    • warned_type=3
      {
          "ToUserName":  "gh_1d6c1222test",
          "FromUserName": " oyeHc4tGxCvPcXlKeFI5tU0jV_is",
          "CreateTime": 1699795665,
          "MsgType": "event",
          "Event": "wxa_punish_event",
          "punish_id": "649551",
          "apps":  "wx54a8eaa26606test",
          "punish_time": 1699795663,
          "illegal_reason": "Presence induced sharing behavior,"
          "illegal_content": [
              "Breach Content Testing"
          ],
          "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 - Abuse of Sharing " ,
          "rule_name": "WeChat Mini Program Platform Operation Code 5. Code of Conduct -5.1 Abuse of Sharing Behavior,"
          "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",
        "apps":  "wx54a8eaa26606test",
        "punish_time": 1699791599,
        "illegal_reason": "Presence induced sharing behavior,"
        "illegal_content": [
            "Breach Content Testing"
        ],
        "detail": "{"banned_days":[1,1],"banned_function_names":[" Share WeChat Moments"," Customer Service Message Interface"]}",
        "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1 - Abuse of Sharing " ,
        "rule_name": "WeChat Mini Program Platform Operation Code 5. Code of Conduct -5.1 Abuse of Sharing Behavior,"
        "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",
        "apps":  "wx54a8eaa26606test",
        "punish_time": 1699801560,
        "illegal_reason": "Presence induced sharing behavior,"
        "illegal_content": [
            "Breach Content Testing"
        ],
        "detail": "{"suspended_days":1}",
        "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1 - Abuse of Sharing " ,
        "rule_name": "WeChat Mini Program Platform Operation Code 5. Code of Conduct -5.1 Abuse of Sharing Behavior,"
        "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",
        "apps":  "wx54a8eaa26606test",
        "punish_time": 1699784109,
        "illegal_reason": "Presence induced sharing behavior,"
        "illegal_content": [
            " Test the offending content/evidence "
        ],
        "detail": "{"banned_days":3}",
        "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_5-1 - Abuse of Sharing " ,
        "rule_name": "WeChat Mini Program Platform Operation Code 5. Code of Conduct -5.1 Abuse of Sharing Behavior,"
        "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",
        "apps":  "wx54a8ea266009d6a" 
        "punish_time": 1699802425,
        "illegal_reason": "posting vulgar, sexually suggestive or pornographic information,"
        "illegal_content": [
            "test the evidence."
        ],
        "detail": "{" path":"pages/fengjin/fengjin"}",
        "rule_url": "https://developers.weixin.qq.com/miniprogram/product/index.html#_6-2 - Porn Vulgar Content " ,
        "rule_name": "WeChat Mini Program Platform Operation Specification 6. Information Content Specification - 6.2. Pornographic and vulgar content."
        "adjust_Guide_url": "https://mp.weixin.qq.com/s/73rLZmwPeQ87Q89DYQcfkw " ,
        "event_type": 10
    }