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
Future<MiniApiResult<FetchAppsResult>> fetchApps(FetchAppsRequest request);

Request parameters

Field

Data type

Required

Description

request

FetchAppsRequest object

Yes

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

Response parameters

Name

Type

Description

Required

success

Bool

Indicates whether the API call is successful.

Yes

data

FetchAppsResult object

Indicates the data that is returned by the API. It returns a list of mini programs that match the specified query conditions.

No

errorCode

Int

Indicates the error code when the API call failed. See the following Error codes section for details.

No

errorMsg

String

Indicates the error description according to the error code when the API call failed. See the following Error codes section for details.

No

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
void _fetchAppListOperate() {
  FetchAppsRequest request = FetchAppsRequest(startIndex, size,
                                                category: category,relatedEnv: relatedEnv,sortDescriptor: sortDescriptor,ascending: ascending);
  IAPMiniProgram.instance.fetchApps(request).then((result){
    if(result.success){
      //request success
    }else{
      //request error 
    }
  });
}