fetchAppInfoListByKeyword
The fetchAppInfoListByKeyword JSAPI is called by the my.call JSAPI to run a query with mini program keywords to asynchronously fetch a list of mini programs that are launched to their app. This JSAPI provides a pagination capability to return the data.
Parameters
Name | Type | Required | Description |
queryStartIndex | Int | Yes | Indicates the starting index to query the mini program list. The index list is determined by the specified category parameters. Note: By default, the value is |
keyword | String | Yes | Indicates the keyword that is used as query conditions for querying the mini program list. |
querySize | Int | Yes | Indicates the number of mini programs to query. |
category | String | No | Indicates the category that mini program belongs to. Specify this parameter with the unique category ID that is assigned by Mini Program Platform. You can get the ID from the Mini Program Platform console. |
success | No | The callback function that is called upon successful call. | |
fail | Function | No | The callback function that is called when the JSAPI call fails. |
complete | Function | No | The callback function that is called upon call completion (to be executed upon either successful or failed call). |
Success callback function
The incoming parameter is of the Object type with the followings:
Name | Type | Required | Description |
success | Bool | Yes | Whether the query result is successful. Valid values are:
|
errorCode | String | No | The error code about the query request. This parameter is returned if the query fails. |
errorMessage | String | No | The error message about the query request. This parameter is returned if the query fails. |
totalCount | Int | No | Indicates how many mini programs that match the specified query conditions. |
appInfoList | List<appInfoList> | No | Indicates the list of the mini programs. An empty array is returned when the value of totalCount is Maximum size: 50 elements |
appInfoList object
Name | Type | Required | Description |
appId | String | Yes | Indicates the unique ID that is assigned by Mini Program Platform to identify a mini program. |
appName | String | Yes | Indicates the mini program name. |
developerVersion | String | Yes | Indicates the release version of a mini program, which follows the |
deployVersion | String | Yes | Indicates the release version of a mini program, with a timestamp. It follows the |
appSlogan | String | Yes | Indicates the tagline of a mini program. |
appDesc | String | Yes | Indicates the description of a mini program. |
iconUrl | String | Yes | Indicates the icon URL of the mini program logo. |
status | String | Yes | Indicates the mini program release status in your super app. Valid values are:
|
packageSize | Number | Yes | Indicates the mini program package size. |
createTime | Number | Yes | Indicates the date and time when a mini program is created, which is in the timestamp format. |
publishTime | Number | No | Indicates the date and time when a mini program is released, in the timestamp format. |
relatedClientId | String | No | Indicates the ID of the super app where a mini program is released. |
relatedWorkspace | String | No | Indicates the ID of the workspace where a mini program is released. |
category | String | No | Indicates the name of the first-level category that a mini program belongs to. |
categoryId | String | No | Indicates the unique ID that is assigned by Mini Program Platform to identify the first-level mini program category. |
categoryInfos | List<categoryInfos> | No | The categories that a mini program belongs to. |
extendInfoMap | Yes | An extended attribute that is used to provide additional information if needed. |
categoryInfos object
Name | Type | Required | Description |
category | String | Yes | The name of the first-level category that a mini program belongs to. |
categoryId | String | Yes | The unique ID that is assigned by Mini Program Platform to identify the first-level mini program category. |
categoryCode2 | String | No | The unique ID that is assigned by Mini Program Platform to identify the secondary mini program category. |
category2 | String | No | The name of the secondary category that a mini program belongs to. |
categoryCode3 | String | No | The unique ID that is assigned by Mini Program Platform to identify the tertiary mini program category. |
category3 | String | No | The name of the tertiary category that a mini program belongs to. |
extendInfoMap
An extended attribute that is used to provide additional information. It is of the Map<String,object> type.
Key name | Description | Required | Value type | Value example |
firstPublishTime | Indicates the date and time when a mini program is released for the first time, which is in the timestamp format. | No | String | 1732760477345 |
tagList | Indicates the tags of a mini program. | No | List<String> | ["tag1","tag2","tag3] |
Error codes
Error code | Error message | Further action | |
2 or 10102 | INVALID_PARAMETER | Parameter error. | Refer to the Parameters table and check whether all parameter types are correct and whether all required parameters are specified. |
3 | UNKNOWN_ERROR | Server fluctuations. | Retry the request. If the problem persists, please contact overseas_support@service.alibaba.com for assistance. |
10104 | NETWORK_ERROR | Network error. | Check the network connection and try again. |
Sample
In the my.call JSAPI, fetchAppInfoListByKeyword is used as its parameter. For more information, see the syntax of my.call JSAPI.
my.call('fetchAppInfoListByKeyword', {
keyword: '8',
queryStartIndex: 0,
querySize: 20,
success: (res) => {
my.alert({
content: JSON.stringify(res),
});
},
fail: (res) => {
my.alert({
content: JSON.stringify(res),
});
},
});