WeChat official account development process guide

1. Material preparation

WeChat public platform URL
WeChat open platform URL

1. Apply for a service number (recommended to use a public mailbox, such as: [email protected] )
2. Prepare corresponding documents and materials
2.1 The following information is required for an enterprise's service number application

  • business license
  • Corporate seal (for certification)
  • public account information
  • Operator's ID and phone number
  • Public account name (think about the name in advance)
  • 300 yuan certification fee

3. Public domain name (https)
4. Register on the WeChat open platform (if conditions permit, register the platform together to facilitate the use of multiple applications under it, [unniId, openId])

2. Development Notes

0. Access verification

After logging in to the official website of the WeChat public platform,
perform basic server configuration on the development-basic settings page of the public platform. Developer.

See Api documentation for details

insert image description here

1. Summary of message types (MsgType)

  • Followed: subscribe
  • Unfollow: unsubscribe
  • Text|Emoji: text
  • Image: image
  • Voice: voice
  • Video: video
  • Small video: shortvideo
  • Geographic location: location
  • Connection message: link

The main business of the official account development is to passively accept the response information sent by the WeChat server at the back end, analyze the content of the information, and do the corresponding business according to the specific event type MsgType

2. The reason for applying for a service account is that the account type supports different functions and functions

The subscription account focuses on article push
, and the service account supports WeChat payment, serving the company's products
insert image description here

3. When the server configuration is enabled, the original menu of the official account will be invalid, and the custom menu will prevail

4. As described below, if the word Token appears in the Api, it will be unified as a temporary token obtained through AppId and AppSecret

Api address:
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
Document address:
https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_access_token .html

3. Development process and business scenarios (continuously supplemented)

1. Follow/subscribe the official account to realize the login function

document address

1.1 The user actively follows or unfollows the official account, WeChat will push this event to the URL filled in by the developer
insert image description here

2. Generate a QR code with parameters

document address

2.1 Create a QR code

Shared api: https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN
Temporary QR code: QR_STR_SCENE
Permanent QR code: QR_LIMIT_SCENE
Parameter value: {“expire_seconds”: 604800, “action_name ": "QR_STR_SCENE", "action_info": {"scene": {"scene_str": "test"}}}
insert image description here

2.2 Get the QR code

Api address: https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=TICKET
Reminder: TICKET remember to perform UrlEncode
insert image description here

2.3 The front end can directly display the QR code through the returned url

Guess you like

Origin blog.csdn.net/r657225738/article/details/123819487