# Add or modify QR code rules

Debugging tools

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

addJumpQRCode

# Functional description

This interface is used to add or modify QR code rules

# Note

# Call Dxplaination

  • The interface is used to add or modify the two-dimensional code rules, and is applicable to add or modify the two-dimensional code rules of "scanning ordinary two-dimensional code to open a Mini Program," and also applies to add or modify the two-dimensional code rules of "scanning service number two-dimensional code to open a Mini Program."
  • If it is to increase or modify the "sweep ordinary two-dimensional code to open a Mini Program" two-dimensional code rules, the parameters involved are prefix, permit_sub_rule、path、open_version、debug_url、is_edit。
  • If it is to increase or modify the two-dimensional code rules of "sweep service number to open Mini Program," it involves parameters prefix, appid, path, is_Edit, details can be found in the documentation below.

# Service Number Call Dxplaination

  • To invoke this interface, the service provider must first obtain a service number. id A permission set of 3 is granted to the service provider, otherwise an error of 61007 will occur.
  • The service number must be associated with the Mini Program before the interface can be invoked. If the service number is not already associated with the Mini Program, you can do so by(linkMiniprogram)The interface is associated.

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpadd?access_token=ACCESS_TOKEN 

# Third Party Invocation

  • The calling method and parameters are the same as HTTPS, only the calling token is different

  • The permission set id of this interface is: 3, 18

  • After the service provider has been authorized with one of the permission sets, it can do so by usingauthorizer_access_TokenCalling on behalf of the merchant

# Request parameters

attribute type Required Introductions
access_Token string yes Interface invokes the certificate, which is URL Parameters, non Body Parameters. useauthorizer_access_Token
is_edit number yes Edit Flag Bit, 0 New QR code rules, 1 Means to modify existing QR code rules.
初始值 string yes QR code rules.
path string yes Mini Program function page.
open_version number yes Test range.
1 indicates the development version (configuration is only available to the developer)2 indicates the experience version (configuration is effective for administrators and experiencers))3 is the official version (the configuration is valid for developers, administrators, and experimenters).
Add or modify the two-dimensional code rules of "scan the ordinary two-dimensional code to open the Mini Program" only need to pass this parameter.
debug_url array no Test link, at most 5 A complete link to the QR code used for testing. This link must comply with the rules of the QR code that has been filled out.
Add or modify the two-dimensional code rules of "scan the ordinary two-dimensional code to open the Mini Program" only need to pass this parameter.
permit_sub_rule number yes Are all subrules that conform to the QR code prefix matching rule exclusive? 1 For non-occupancy, 2 For occupancy.View detailed rules
Add or modify the two-dimensional code rules of "scan the ordinary two-dimensional code to open the Mini Program" only need to pass this parameter.
appid string yes Scan the appid of Mini Program that you want to jump after the service number QR code. Add or modify the QR code rule of "scan service number QR code open Mini Program" to pass this parameter.

# Return parameters

attribute type Introductions
errcode number Error code
errmsg string Error message

# Other Notes

  • Regardless of whether the ordinary QR code rule is released, the developer/Experiencer/The Administrator is scanning debug_url The corresponding two-dimensional code, according to the open_version To decide whether to open the development, trial, or official version.

# Call Example

Example Dxplaination: Add or modify the two-dimensional code rules of "scan the ordinary two-dimensional code to open the Mini Program"

# Sample Request Data


{
  "prefix": "https://WeChat.qq.com/qrcodejump,
  "permit_sub_rule": 1,
  "path": "pages/index/index",
  "open_version": 1,
  "debug_url": [
    "https://WeChat.qq.com/qrcodejump?a=1",
    "https://WeChat.qq.com/qrcodejump?a = 2
  ],
  "is_edit": 0
} 

# Return Data Example


{
  "errcode": 0,
  "errmsg": "ok"
} 

Example Dxplaination: Add or modify the QR code rules of "scan the service number QR code to open the Mini Program"

# Sample Request Data


{
  "prefix": "http://WeChat.qq.com/q/kZgfwMTm72Wxxxx",
  "appid": “wxxxxxx”,
  "path": "pages/index/index",
  "is_edit": 0
} 

# Return Data Example


{
  "errcode": 0,
  "errmsg": "ok"
} 

# Error code

Error code Error code Solutions
-1 system error The system is busy, please wait for the developer to try again
40001 invalid credential  access_Token isinvalid or not latest Obtain access_Token time AppSecret Error, or access_Token Invalid. Please take the developer more seriously. AppSecret Of the correctness, or to see if you are working for the appropriate Official Account message template Call interface
85066 illegal prefix Link error
85070 prefix in black list The URL hit the blacklist and could not be added
85071 prefix added repeated This link has been added, please do not repeat it
85072 prefix owned by other The link is already occupied.
85073 prefix beyond limit QR code rules are full
85075 can not access Personal Type Mini Program Can't Set QR Code Rules