Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program small program search submitPages


May 20, 2021 WeChat Mini Program Development Document


Table of contents


search.submitPages

This interface should be called on the server side, as detailed in the Service Side API.
This interface supports cloud calls. Developer tool version required . . . 1.02.1904090 (latest stable download)
wx-server-sdk >= 0.4.0

Small program developers can submit the small program page url and parameter information through this interface, so that WeChat can be more timely to include the page information of the small program, the page information submitted by the developer will probably be used for the display of small program search results.

How to call:

  • HTTPS call
  • Cloud calls

HTTPS call

The request address

POST https://api.weixin.qq.com/wxa/search/wxaapi_submitpages?access_token=TOKEN

Request parameters

Property Type The default Required Description
access_token string Is The interface calls the credentials
pages Array.<Object> Is A list of small program page information

The structure of the pages

Property Type The default Required Description
path string Is The page path
query string Is Page parameters

Returns a value

Object

The returned JSON packet

Property Type Description
errcode string Error code
errmsg string The error message

The legal value of errcode

Value Description The lowest version
-1 The system is busy, so please try again later
0 The request was successful
40066 The submitted page is marked as blocked by sitemap, see the errmsg prompt.
40210 The path parameter in pages does not exist or is empty
40212 There are illegal qurys in paegs, and the query format follows the URL standard, which is k1-v1-k2-v2
40219 Pages do not exist or the parameters are empty
47001 HTTP request package is not legal JSON
47004 Each time you submit more than 1000 pages (Note: Each submission page should be less than or equal to 1000)
47006 The number of submitted pages on the same day reached the upper limit of the quota, please try again tomorrow.
85091 The search switch of the applet is turned off.Please visit the Settings page to open the switch and try again
85083 The search function of the applet is disabled

An example of a request

curl -d '
{
    "pages": [
        {
            "path": "pages/index/index",
            "query": "userName=wechat_user"
        },
        {
            "path": "pages/video/index",
            "query": "vid=123"
        }
    ]
}' https://api.weixin.qq.com/wxa/search/wxaapi_submitpages?access_token=TOKEN

Cloud calls

Cloud call is the ability provided by the small program Cloud Development to call WeChat open interfaces in cloud functions and need to be used in cloud functions via wx-server-sdk.

The interface method

openapi.search.submitPages
The permissions for the search.submitPages API need to be configured in config.json, details

Request parameters

Property Type The default Required Description
pages Array.<Object> Is A list of small program page information

The structure of the pages

Property Type The default Required Description
path string Is The page path
query string Is Page parameters

Returns a value

Object

The returned JSON packet

Property Type Description
errCode string Error code
errMsg string The error message

The legal value of errCode

Value Description The lowest version
0 Success

Abnormal

Object

The exception thrown

Property Type Description
errCode string Error code
errMsg string The error message

The legal value of errCode

Value Description The lowest version
-1 The system is busy, so please try again later
40066 The submitted page is marked as blocked by sitemap, see the errmsg prompt.
40210 The path parameter in pages does not exist or is empty
40212 There are illegal qurys in paegs, and the query format follows the URL standard, which is k1-v1-k2-v2
40219 Pages do not exist or the parameters are empty
47001 The http request package is not a legitimate JSON
47004 More than 1000 pages per submission (Note: The number of pages per submission should be less than or equal to 1000)
47006 The number of submission pages for the same day has reached the quota limit, please try again tomorrow
85091 The search switch for the small program is turned off. Visit the settings page to turn on the switch and try again
85083 The search function of the small program is disabled