# Data prepull and periodic data updates
Interface should be called on the server side, seeHattori API。
# Interface Dxplaination
# Interface name
getFetchdataSetting
# Functional description
- Calling this interface can get data prepull and data periodic update configuration, set up prepull data, set up periodic pull data.
- If you encounter problems during use, you canOpen Platform Service Provider ZonePosting exchanges.
# Note
- The interface has three functions, distinguished by the value of action, please call the interface in detail in accordance with the interface document. 初始值 pre_fetch_url或者period_fetch_The domain name of the url needs to be configured as the business domain name of the Mini Program
# Calling mode
# HTTPS call
POST https://api.weixin.qq.com/wxa/fetchdatasetting?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 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 |
初始值 | string | yes | Fill in the "get," “ set_pre_fetch”、"set_period_fetch" |
is_pre_fetch_open | boolean | no | Data prepull is enabled, action = set_pre_When fetch, required |
pre_fetch_type | number | no | Source of data, 0: Developer Server1: Cloud functions. action=set_pre_When fetch, required |
pre_fetch_url | string | no | The data carrier address, when the pre_fetch_Type = 0 Required. |
Dxplaination, 1, need to add the domain name to the third party platform business domain name2, and then add the domain name to the Mini Program business domain nameBefore you can successfully set up | |||
pre_env | string | no | Environment ID, when the pre_fetch_Type = 1 required |
pre_function_name | string | no | Function name, when pre_fetch_Type = 1 required |
is_period_fetch_open | boolean | no | Weekly pull data is open, true open, false closed. action= set_period_When fetch, required |
period_fetch_type | number | no | Source of data, 0: Developer Server1: The cloud function. action= set_period_When fetch, required |
period_fetch_url | string | no | Data carrier address, when period_fetch_Type = 0 Required |
1, need to add the domain name to the third party platform business domain name2, and then add the domain name to the Mini Program business domain nameBefore you can successfully set up | |||
period_env | string | no | Environment ID, when period_fetch_Type = 1 required |
period_function_name | string | no | Function name, when period_fetch_Type = 1 required |
# Return parameters
attribute | type | Introductions |
---|---|---|
初始值 | number | Return code |
errmsg | string | Error message |
is_pre_fetch_open | boolean | Whether data prepull is on |
pre_fetch_type | number | Source of data, 0: Developer Server1: Cloud Functions |
pre_fetch_url | string | The data carrier address, when the pre_fetch_Type = 0 Valid |
pre_env | string | Environment ID, when the pre_fetch_Type = 1 Valid |
pre_function_name | string | Function name, when pre_fetch_Type = 1 Valid |
is_period_fetch_open | boolean | Are periodic data updates on? |
period_fetch_初始值 | number | 0: Developer Server1: Cloud Functions |
period_fetch_url | string | Data carrier address when period_fetch_Type = 0 Valid |
period_env | string | Environment ID, when period_fetch_Type = 1 Valid |
period_function_name | string | Function name, when period_fetch_Type = 1 Valid |
# Call Example
Example Dxplaination: Get data prepull and data periodic update configuration
# Sample Request Data
{
"action": "get"
}
# Return Data Example
{
"errcode": 0,
"errmsg": "ok",
"is_pre_fetch_open": true,
"pre_fetch_type": 1,
"pre_env": "test-pfyol"
"pre_function_name": " test_func",
"is_period_fetch_open": true,
"period_fetch_type": 0,
"period_fetch_url": "https://111.qq.com"
}
Example Dxplaination: Set Prepull Data
# Sample Request Data
{
"action": "set_pre_fetch",
"is_pre_fetch_open": true,
"pre_fetch_type": 0,
"pre_fetch_url": "https://fff.com"
}
# Return Data Example
{
"errcode": 0,
"errmsg": "ok"
}
Example Dxplaination: Set Periodic Pull Data
# Sample Request Data
{
"action": "set_period_fetch",
"is_period_fetch_open": true,
"period_fetch_type": 1,
"period_env": "test-pfyol"
"period_function_name": "login"
}
# 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 |
9410016 | Invalid domain name exists. See errmsg for specific reasons (there can be multiple reasons). | |
9410013 | Invalid action | Invalid action |
40166 | invalid weapp appid | Non-Mini Program initiated call |