# Set QR Code Rules
Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide
Interface name: qrcodeJumpAdd
This interface is used to add or modify Service Account two-dimensional code rules to Weixin Mini Program two-dimensional code rules
# 1. How to call
# HTTPS calls
POST https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpadd?access_token=ACCESS_TOKEN
# Cloud Calls
- This interface does not support cloud calls
# Third party invocation
This interface supports Third Party Platform generation business call.
This interface belongs to the permission set id: 3, 18
When a service provider is authorized by one of the permissions set, it can call on behalf of the merchant by using authorizer_access_token , which can be viewed in the third-party call documentation.
# 2. Request parameters
# Query parametersQuery String parameters
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
access_token | string | yes | Interface invocation credentials, using access_token , authorizer_access_token |
# Request BodyRequest Payload
Parameter Name | type | Required to fill in | Example | Introductions |
---|---|---|---|---|
prefix | string | yes | http://weixin.qq.com/q/kZgfwMTm72Wxxxx | The rule is that the URL with reference to Service Account must be the URL beginning with http://weixin.qq.com/q/, for examplehttp://weixin.qq.com/q/02P5KzM_xxxxx |
appid | string | yes | wxxxxxx | Service Account AppID Weixin Mini Program |
path | string | yes | pages/index/index | Weixin Mini Program Function page |
is_edit | number | yes | 0 | Edit the marker, 0 indicates the addition of QR code rules, and 1 indicates the modification of existing QR code regulations (note that already published rules do not support modification). |
# 3. Return Parameters
# Response Payload
Parameter Name | type | Introductions |
---|---|---|
errcode | number | Error code |
errmsg | string | Error message |
# 4. Note
# Instructions for invoking
- This interface is used to add or modify QR code rules. It applies to adding or modifying QR code Rules for "scan a normal QR code to open Weixin Mini Program" and for "scan the Service Account QR code to Open a Mini Program."
- If you are adding or modifying the "sweep ordinary two-dimensional code to open Weixin Mini Program" two-dimensional code rule, the parameters areprefix、permit_sub_rule、path、open_version、debug_url、is_edit。
- If you are adding or modifying a QR code rule that says "scan Service Account QR code to open Weixin Mini Program QR code," the parameters prefix, AppID, path, and is_edit are involved, as described in the documentation below.
# Service Account Call Dxplaination
- In order to invoke this interface, the service provider must first obtain Service Account The permission set id of 3 must be authorized to the service provider, otherwise the 61007 error will occur.
- Service Account The interface must be associated with Weixin Mini Program before it can be invoked. If a service number does not already associate a Mini Program, you can associate another Mini Program by using the linkMiniprogram interface, or at Official Account Administration Console - Advertising and Services - Small Program Management.
# 5. Code examples
# 5.1 Add or modify the code rule for "Scan ordinary code to open Weixin Mini Program"
Example Requests
{
"prefix": "https://weixin.qq.com/qrcodejump",
"permit_sub_rule": 1,
"path": "pages/index/index",
"open_version": 1,
"debug_url": [
"https://weixin.qq.com/qrcodejump?a=1",
"https://weixin.qq.com/qrcodejump?a=2"
],
"is_edit": 0
}
Return an example
{
"errcode": 0,
"errmsg": "ok"
}
# 5.2 Add or modify the "sweep Service Account two-dimensional code to open Weixin Mini Program" two-dimensional code rule
Example Requests
{
"prefix": "http://weixin.qq.com/q/kZgfwMTm72Wxxxx",
"appid": “wxxxxxx”,
"path": "pages/index/index",
"is_edit": 0
}
Return an example
{
"errcode": 0,
"errmsg": "ok"
}
# 6. Error code
The following is a list of error codes for this interface, other error codes can refer to General error codes
Error code | Error Description | Solutions |
---|---|---|
-1 | The system is busy. | Please try again. |
0 | ok | success |
40001 | invalid credential access_token isinvalid or not latest | AppSecret error while getting access_token, or access_token is invalid.Developers should check that AppSecret is correct, or that they are calling interfaces for the appropriate Official Account |
40097 | invalid args | The published rules do not support changes |
40166 | invalid appid | AppID Invalid parameters |
44990 | Interface requests are too fast | More than 5 times / second |
85066 | Link Error | Check the legitimacy of the links |
85068 | test url is not the sub prefix | A test link is not a sublink |
85069 | check confirm file fail | The validation file failed |
85070 | URL Hit Blacklist | Could not be added |
85071 | Link duplicates | Do not add repeatedly |
85072 | Links are being occupied | Check link affiliation |
85073 | The number of rules is full. | Exceeding the quantity limit |
85075 | Personal Weixin Mini Program restrictions | Unable to set rules |
85076 | check ICP fail | Check ICP Failure |
886001 | The system is busy. | Please try again. |
# 7. Scope of application
This interface supports "Service Account (authentication only)" account type calls.None of the other account types can be invoked without special instructions.