fetchApps

The fetchApps API is called by the super app to run a query with FetchAppRequestVO 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
void fetchApps(FetchAppRequestVO fetchAppRequestVO, OnRpcResultListener<FetchAppsResult> listListener) 

Request parameters

Name

Type

Description

Required

fetchAppRequestVO

FetchAppRequestVO

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

M

listListener

OnRpcResultListener<FetchAppsResult>

The callback function that is used to return the query result.

  • If the query is successful, it returns a list of mini programs that match the specified query conditions. See FetchAppsResult for details.
  • If the query fails, it returns the error code and error message. See Error for details.

M

Response parameters

Name

Type

Description

Required

result

FetchAppsResult

The mini program list that is returned when the query is successful.

O

error

Error

The error code and error message that are returned when the query fails.

O

Error codes

Error code

Error message

Description

Further action

2

INVALID_PARAMETER

Parameter error.

Refer to the Request parameters table and check if 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 assistance.

10104

NETWORK_ERROR

Network error.

Check the network connection and try again.

Samples

Kotlin

copy
val fetchAppRequestVO = FetchAppRequestVO(queryStartIndex, querySize)
fetchAppRequestVO.setCategory(category)
fetchAppRequestVO.setRelatedEnv(relatedEnv)
Griver.fetchApps(fetchAppRequestVO,  object : OnRpcResultListener<FetchAppsResult?>() {
      fun onResultSuccess(result: FetchAppsResult?) {
          //return the mini program list
      }
      fun onResultFailed(errorCode: Int, errorMessage: String?) {
          //return the error code and error message
      }
})

Java

copy
FetchAppsRequestVO fetchAppRequestVO = new FetchAppRequestVO(queryStartIndex,querySize);
fetchAppRequestVO.setCategory(category);
fetchAppRequestVO.setRelatedEnv(relatedEnv);
Griver.fetchApps(fetchAppRequestVO,
      new OnRpcResultListener<FetchAppsResult>() {
          @Override
          public void onResultSuccess(FetchAppsResult result) {
               //return the mini program list
          }

          @Override
          public void onResultFailed(int errorCode, String errorMessage) {
              //return the error code and error message
         }
});