# Upload code and generate demo version

Debugging tools

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

commit

# Functional description

  • 初始值 id(template_Id), and then call this interface to upload code for an authorized Mini Program and generate an experience version.

  • If you encounter problems during use, you canOpen Platform Service Provider ZonePosting exchanges.

# Note

  • If the interface involves a geolocation-dependent privacy interface, you need to use the_json参数中配置requiredPrivateInfos
  • After uploading the code, you need to wait until the detection task is over before submitting the code audit, otherwise, 61039 errors will occur when submitting the code audit.
  • Developers can do this throughgetCodePrivacyInfoInterface to get the test results, confirm the end of the test task and then submit the code review
  • Do not retry the upload code and submit code audit interfaces together, or 61039 errors will still occur if the detection task after each upload is not over and a new detection task is initiated.
  • If the location-dependent interface is used in the code, but is not yet available in ext_Configure requiredPrivateInfos in the json parameter. A 61040 error will occur when the code is submitted for review.
  • If the code uses a geolocation interface, but the appid Mini Program does not have permission for the geolocation api, then a 61040 error will appear when the code is submitted for review. If the developer confirms that it does not need to use the geolocation interface, then it does not need to apply for permission, only need to submit the code to review the privacy in the interface._api_not_The use parameter is declared not to be used.

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/wxa/commit?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 to which this interface belongs is: 18

  • After the service provider has been authorized with one of the permission sets, it can do so by using初始值_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
template_id number yes Code templates in the code base ID, the code template template is available through the getTemplateList interface_id。 Note that if the template id is the template id of the standard template library, then ext_The parameters supported by json are: {"extAppid": " ", "ext": {}, "window": {}}
ext_json string yes In order to facilitate the developers of third-party platforms to introduce extAppid The development and debugging work of the[Ext.json Configuration File](https://developers.weixin.qq.com/miniprogram/dev/devtools/ext.html#% E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%A8%A1%E6%9D%BF%E5%BC%80%E5%8F%91)Concept, which is used to control the contents of the ext.json configuration file. For additional information on this parameter, please see the " ext_JSON added. " 。
user_version string yes Code version number, which the developer can customize (the length should not exceed 64 Character)
user_desc string yes Code description, developers can customize

# Return parameters

attribute type Introductions
errcode number Return code
errmsg string Return Information

# Other Notes

# Dxplaination of requiredPrivateInfos

  • For the new geolocation interface and related process adjustments, you can view the community announcement:https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01
  • 7.14, the geo-dependent interface used in the code (total 8 See Table 1), third party developers are required to ext_json In the parameters requiredPrivateInfos Declaration in a configuration item
  • In ext_RequidPrivateInfos is configured in the json parameter with the ruleWhole replacementThat is, if it is also configured in apagejson, it will eventually be ext._The configuration of json overrides the requiredPrivateInfos of the apagejson configuration. The rest of the rules can be viewed below.ext_JSON added.
  • In ext_The following is an example of configuring requiredPrivateInfos in the json parameter
{
  "template_id": "95",
  "ext_json": "{"requiredPrivateInfos":["onLocationChange","startLocationUpdate"]}",
  "user_version": "V1.0",
  "user_Desc": "test"
}
  • RequidPrivateInfos will mainly check whether the format is correct, fill in the API name is correct, fill in the API name has permissions, fill in the API name is mutually exclusive. The corresponding error code can be viewed in the error code document at the end of the document.
  • RequidPrivateInfos will take effect after 2022.7.14, the document is updated in advance to facilitate developers to understand the parameters of the interface in advance, and adjust in advance.

# ext_JSON added.

  1. In order to facilitate third-party platforms to use the same Mini Program template to provide services for different Mini Programs, the third party may place custom information in the ext_json In the template Mini Program, you can use the wx.getExtConfigSync Interface to get custom information to distinguish between different Mini Programs. See details:[Mini Program template development](https://developers.weixin.qq.com/miniprogram/dev/devtools/ext.html#% E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%A8%A1%E6%9D%BF%E5%BC%80%E5%8F%91)
  2. ext_json The parameters in theMini Program configurationHowever, if the template id is the template id of the standard template library, then ext_The parameters supported by json are: {"extAppid": ", "ext": {}, "window": {}}
  3. ext_json Limited support in Pages, which supports a subset of configuration template pages ext_json No new pages are added).
  4. ext_json Limited support in SubPackages, which supports configuration template subgroups and subsets of their pages ext_json Subcontracts configured in the template must be declared in the template and cannot be added to sub-packages pages).
  5. ext_Json supports plugins configuration, which overrides the plugins configuration in apagejson in the template. For details on the use of the plugin please refer toUsing Plugins
  6. If there is already a configuration in the code, the merge rules for the configuration are:
  • Ext Whole Replacement
  • Pages Total replacement
  • The corresponding page is found in extPages, and the same level overrides page.json
  • Window sibling coverage
  • Add extAppid directly to apagejson
  • NetworkTimeout Sibling Coverage
  • CustomOpen Total Replacement
  • tabbar
  • Global replacement of functionPages
  • SubPackages Global Replacement
  • navigateToMiniProgaramAppIdList:Overall replacement
  • Replacement of plugins

Additional Notes:

  • What is peer coverage? withWindow sibling coverageFor example, iterate over extjson's window object member, override it if it exists in apagejson's window object, and add it if it does not.
  • What is Total Replacement? withReplacement of pluginsFor example, if Apagejson has a plugin object, it is overwritten with the plugin object in extjson, if it does not exist, it is added.

Special Field Dxplaination:

parameter Introductions
ext Custom fields are allowed only here and can be called in an Mini Program
extPages Page configuration
extAppid Authorized Party Appid, can be filled in merchant AppID to distinguish between different merchants
sitemap Used to configure whether the Mini Program and its pages are allowed to be indexed by WeChat

# Call Example

Example Dxplaination: Example of Common Template Library Code Submission

# Sample Request Data



{
  "template_id": "0",
  "ext_初始值 "{"extAppid":"","ext":{"attr1":"value1","attr2":"value2"},"extPages":{"index":{},"search/index":{}},"pages":["index","search/index"]," window":{},"networkTimeout":{},"tabBar":{},"plugin":{}}",
  "user_version": "V1.0",
  "user_Desc": "test"
}


 

# Return Data Example


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

Example Dxplaination: Example of Standard Template Library Code Submission

# Sample Request Data


{
  "template_id": "0",
  "ext_json": "{"extAppid":"","ext":{"attr1":"value1","attr2":"value2"}," window":{}}",
  "user_version": 初始值
  "user_Desc": "test"
} 

# Return Data Example


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

# Error code

Error code Error code Solutions
-60005
-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
40014 invalid access_Token Illegal access_Token Please take the developer seriously. access_Token Of the validity (such as whether it is expired), or to see if you are working for the appropriate Official Account message template Call interface
80082 You do not have permission to use this plugin.
9402203 Standard template extjson error Standard template ext_JSON error, illegal parameters passed, If it is a template of the standard template library, then ext_Json supports only {"extAppid": ", "ext": {}, "window": {}}
85013 invalid ext_json, parse fail or containing invalid path Invalid custom configuration
9402202 concurrent limit Do not submit frequently until the last operation is completed.
初始值 template not exist Invalid template number
85043 invalid template, something wrong? Template error
85044 package exceed max limit Code package exceeds size limit
85045 some path in ext_json not exist ext_json There are paths that don't exist
85046 pagepath missing in tabbar list tabBar Lacking in path
85047 pages are empty pages Field is empty
85048 parse ext_json fail ext_json Parse failure
80067 Cannot find the plugin used
80066 Illegal plugin version
85310 is wrong API name requiredPrivateInfos There is a problem with the format or the api name is wrong
85312 is not authorized requiredPrivateInfos Configure an API without permission
85311 is mutually exclusive RequidPrivateInfos includes a mutex api