WeChat Mini Program----Open the mini program from text messages, emails, web pages outside WeChat and other scenarios through URLScheme or URLLink

1. Method for launching mini programs via text messages, emails, web pages, WeChat, etc.

  1. "URL Scheme Launches Mini Program"
  2. "URL Link launches mini program"

2. Function description

  1. URL Scheme: This interface is used to obtain the scheme code of the mini program, and is suitable for business scenarios where mini programs are launched via text messages, emails, external web pages, WeChat, etc. Currently, it is only open to mini programs for domestic non-individual subjects. For details, see Obtaining URL Scheme.
  2. URL Link: Get the mini program URL Link, suitable for business scenarios where mini programs are launched via text messages, emails, web pages, WeChat, etc. Currently, it is only open to mini programs for domestic non-individual subjects. For details, see Obtaining URL Link.

3. Call upper limit

  1. Generation end: The total number of URL Scheme (encrypted plain text) and URL Link generated per day is capped at 500,000;
  2. Open side: The total number of times a mini program can be opened through URL Scheme (encrypted plain text) and URL Link is capped at 3 million per day;
  3. Starting from December 19, 2023, the URL Scheme restriction of one person per link will be cancelled, allowing the same connection to be accessed by multiple users. Detailed adjustment instructions can be found in the "URL Scheme and URL Link Optimization Announcement".

4. Other matters needing attention

4.1 URL Scheme
  1. Encrypted URL Scheme supports developers to splice query parameters after the link. For details, see Obtaining URL Scheme;
  2. If you need to open a mini program on a webpage in WeChat, please use the WeChat open tab - mini program jump button. If you don't have a public account, you can also directly use the mini program identity to develop web pages and jump to the mini program without authentication. See the cloud development static website jump mini program. program. Mini programs that meet the open scope can send text messages that support opening the mini program;
  3. This function basically covers the WeChat version currently used by users, and developers do not need to be compatible with lower versions;
  4. Only the URL Scheme of published applet can be generated;
  5. When jumping to WeChat through URL Scheme, a system pop-up box may be triggered to ask. If the user chooses not to jump, the mini program cannot be opened. Developers are asked to properly handle scenarios where users choose not to jump;
  6. Some browsers will restrict direct jump when opening a web page. You can refer to the sample web page to set the jump button.
4.2 URL Link
  1. Encrypted URL Link supports developers to splice query parameters behind the link. For details, see Obtaining URL Link;
  2. Only URL links for published mini programs can be generated;
  3. When opening the URL Link in WeChat or on an Android phone, the official H5 intermediate page will be redirected first by default. If you need to customize H5 content, you can use the cloud to develop a static website.

5. Calling method

5.1 HTTPS calls
  1. URL Scheme:POST https://api.weixin.qq.com/wxa/generatescheme?access_token=ACCESS_TOKEN;
  2. URL Link:POST https://api.weixin.qq.com/wxa/generate_urllink?access_token=ACCESS_TOKEN。
5.2 Cloud call
  1. URL Scheme: The interface method is: openapi.urlscheme.generate;
  2. URL Link: The interface method is: openapi.urllink.generate.
5.3 Third-party calls
1. URL Scheme
  1. The calling method and incoming and outgoing parameters are the same as HTTPS, only the calling token is different;
  2. The permission set IDs to which this interface belongs are: 88, 115;
  3. After the service provider obtains authorization from one of the permission sets, it can use authorizer_access_token to make calls on behalf of the merchant.
2. URL Link
  1. The calling method and incoming and outgoing parameters are the same as HTTPS, only the calling token is different;
  2. The permission set IDs to which this interface belongs are: 88, 115;
  3. After the service provider obtains authorization from one of the permission sets, it can use authorizer_access_token to make calls on behalf of the merchant.

6. Request parameters

6.1 URL Scheme
  1. Parameter Description
Attributes type default value Required illustrate
access_token string yes Interface call credentials
jump_what Object no Information about the target applet to jump to.
expire_time number no The expiration time of the expired scheme code is the Unix timestamp. The generated expiration scheme code is valid before this time. The maximum validity period is 30 days. Required when is_expire is true and expire_type is 0
expire_type number no Default value 0, expiration scheme code failure type, expiration time: 0, expiration interval days: 1
expire_interval number no The number of days between expiration of expired scheme codes. The generated expiration scheme code is valid until the interval is reached. The maximum interval is 30 days. Required when is_expire is true and expire_type is 1.
  1. jump_wxa Description
Attributes type default value Required illustrate
path string no The mini program page path entered through the scheme code must be a page where a published mini program exists, and queries cannot be carried. When path is empty, it will jump to the mini program homepage.
query string no The query when entering the mini program through the scheme code has a maximum length of 1024 characters. It only supports numbers, uppercase and lowercase English and some special characters: !#$&'()*+,/:;=?@-._~%`
env_version string no Default value is "release". The version of the applet to open. The official version is "release", the experience version is "trial", and the development version is "develop", which only takes effect when opened outside WeChat.
6.2 URL Link
  1. Parameter Description
Attributes type default value Required illustrate
access_token string yes Interface call credentials
path string no The mini program page path entered through URL Link must be a page where a published mini program exists, and query cannot be carried. When path is empty, it will jump to the mini program home page.
query string no The query when entering the mini program through URL Link has a maximum length of 1024 characters. It only supports numbers, uppercase and lowercase English and some special characters: !#$&'()*+,/:;=?@-._~%
expire_time number no The expiration time of the expired URL Link is the Unix timestamp. The generated expired URL Link is valid before this time. The maximum validity period is 30 days. expire_type is 0 required
expire_type number no Default value 0. Mini Program URL Link expiration type, expiration time: 0, expiration interval days: 1
expire_interval number no The number of days between expiration of the expired URL Link. The generated expired URL Link is valid before the interval is reached. The maximum interval is 30 days. expire_type is 1 required
cloud_base object no The cloud-developed static website customizes H5 configuration parameters and can configure the transferred cloud-developed H5 page. If left blank, the official H5 page will be used by default.
env_version string no Default value is "release". The version of the applet to open. The official version is "release", the experience version is "trial", and the development version is "develop", which only takes effect when opened outside WeChat.
  1. cloud_base description
Attributes type default value Required illustrate
env string yes Cloud development environment
domain string no Custom domain name for static website. If left blank, the default domain name will be used.
path string no Cloud development static website H5 page path, query cannot be carried
query string no Cloud development static website H5 page query parameters, maximum 1024 characters, only supports numbers, uppercase and lowercase English and some special characters: !#$&'()*+,/:;=?@-._~%`
resource_appid string no Required for third-party batch cloud development, indicating the appid of creating the env (mini program/third-party platform)

7. Attention

The url_link returned by part of the URL Link will be intercepted by QQ Browser! ! ! , so I still use URL Scheme for now! ! !

Insert image description here

Guess you like

Origin blog.csdn.net/m0_38082783/article/details/135381618