fetchApps

The fetchApps API is called by the super app to run a query based on the specified query conditions to asynchronously fetch a list of mini programs that are launched to their app. This API provides a pagination capability to return the data.

Method signature

copy
function fetchApps(
  request: FetchAppsRequest,
  success: (result: FetchAppsResult) => void,
  error?: (error: BaseError) => void
) 

Request parameters

Field

Data type

Description

Required

request

FetchAppsRequest

An object that is used to set the query conditions of mini programs.

Yes

success

FetchAppsResult

The result that is used to return a list of mini programs that match the specified query conditions.

Yes

error

BaseError

The callback that is executed upon failure to query. When executed, it receives an instance of BaseError object that includes the error code and its corresponding error description. Specify this parameter if you need to handle the encountered errors.

No

Response parameters

N/A

Error codes

Error code

Error message

Further action

2

INVALID_PARAMETER

Parameter error.

Refer to the Request parameters table and check whether all parameter types are correct and if 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 help.

10104

NETWORK_ERROR

Network error.

Check the network connection and try again.

Sample

copy
function fetchAppListFunc() {
  var startIndex = 1;
  var size = 10;
  var rquestVo: FetchAppsRequest = {
    queryStartIndex: startIndex,
    querySize: size,
  };
  fetchApps(
    rquestVo,
    (result: FetchAppsResult) => {
      // result
    },
    (error: BaseError) => {
      // error
    }
  );
}