/v2/miniprogram/app/info/list/query

POST /v2/miniprogram/app/info/list/query

This API is used by the super app to inquire about the details of the mini program list.

Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

Request parameters

Field

Data type

Required

Description

Example

queryStartIndex

Integer

No

Indicates the starting index to query the mini program list.

Value range: 0 - unlimited

Note:

  • By default, the value is 0, which means the starting index is 0.
  • For the next API call, specify the queryStartIndex parameter based on the endIndex parameter returned from the previous response, with the relation: queryStartIndex = endIndex + 1. Otherwise, the queried data will be duplicated or incomplete. For example, when the value of endIndex returned from the previous response is 30, specify the queryStartIndex parameter to be 31.

0

querySize

Integer

No

Indicates how many mini programs to query.

By default, the value is 50, which means the number of mini programs to query is 50.

If both queryStartIndex and querySize are not specified, the data of the first 50 mini programs is returned no matter how many times this API is called.

Value range: 0 - 50

1

orderKey

String

No

Indicates how mini programs are sorted, for example, by mini program ID or by release time.

By default, the value is APP_CREATE_TIME, which means the mini programs are sorted by creation time.

Valid values are:

  • APP_ID: The mini programs are sorted by mini program ID.
  • PUBLISH_TIME: The mini programs are sorted by release time.
  • APP_NAME: The mini programs are sorted by their names.
  • APP_CREATE_TIME: The mini programs are sorted by creation time.

"APP_NAME"

orderType

String

No

Indicates that mini programs are sorted in ascending or descending order.

By default, the value is ASC, which means the mini programs are sorted in ascending order.

Valid values are:

  • DESC: The mini programs are sorted in descending order.
  • ASC: The mini programs are sorted in ascending order.

"DESC"

userId

String

No

Indicates the unique ID assigned by the super app to identify a user.

  • Maximum length: 64 characters

-

relatedEnv

String

No

Indicates the related environment where a mini program is released.

By default, the value is prod, which means the mini program is released to the production environment.

Valid values are:

  • prod: The mini program is released to the production environment.
  • dev: The mini program is released to the development environment.
  • test: The mini program is released to the test environment.
  • sandbox: The mini program is released to the sandbox environment.

"prod"

deviceInfo

DeviceInfo

No

Indicates the information of the client device or the super app on which a mini program is running.

-

appName

String

No

Indicates the name of a mini program. Fuzzy matching is used in the query.

  • Maximum length: 36 characters

-

appSlogan

String

No

Indicates the tagline of a mini program. Fuzzy matching is used in the query.

  • Maximum length: 36 characters

-

appStatus

String

No

Indicates the status of a mini program.

"init"/"online"

keyword

String

No

Indicates the keyword that is used for querying the mini program list.

"appName1"

Response parameters

Field

Data type

Required

Description

Example

result

Result

Yes

Indicates the request result, such as status and error codes.

-

endIndex

Integer

Yes

Indicates the end position of the current data in the mini program list that match the query.

When endIndex is greater than totalCount, there is no data on the next page.

Value range: 0 - unlimited

0

totalCount

Integer

Yes

Indicates how many mini programs that match the query.

Value range: 0 - unlimited

57

appInfoDetails

Array<DeployAppInfo>

No

Indicates the list of the mini programs.

An empty array is returned when the mini program queried by specifying the appName, appSlogan, or relatedEnv parameters does not exist.

Maximum size: 50 elements

-

Result process logic

In the response, the result.resultStatus field indicates the result of processing a request. The following table describes each result status:

resultStatus

Description 

S

The request to query the mini program list is successful.

The corresponding result.resultCode is SUCCESS and the result.resultMessage  is Success.

U

The status of the request to query the mini program list is unknown. 

The corresponding result.resultCode is UNKNOWN_EXCEPTION and the result.resultMessage is "An API calling is failed, which is caused by unknown reasons." For details, see the Common error codes section.

F

The request to query the mini program list failed.

The corresponding result.resultCode and result.resultMessage can vary based on different situations. For details, see the following Error codes section.

Error codes

Error codes are usually classified into the following categories:

  • Common error codes are common for all mini program OpenAPIs in V2.  
  • API-specific error codes: This API does not have its dedicated error codes.

Samples

The data flow of sending a request to query the mini program list is illustrated as follows:

image

  1. The super app server calls this API to send a request to Mini Program Platform for querying the mini program list.
  2. Mini Program Platform processes the request.
  3. Mini Program Platform returns the data to the super app server in JSON format.

Request

copy
{
    "orderKey": "APP_NAME",
    "orderType": "DESC",
    "querySize": 1,
    "queryStartIndex": 0,
    "deviceInfo": {
        "***": "***"
    },
    "userId": "***",
    "relatedEnv": "prod",
    "appName": "appName"
}

Response

copy
{
    "appInfoDetails": [
        {
            "appDescription": "test",
            "appId": "2102010113769***",
            "appName": "test",
            "appSlogan": "test",
            "categoryDetails": [
                {
                    "categoryId": "1000",
                    "categoryName": "Others"
                }
            ],
            "createTime": "1660133170000",
            "deployVersion": "1.0.2.1660133170552",
            "developerVersion": "1.0.2",
            "iconUrl": "https://oss-local-nightly.marmot-cloud.com/storage/gmpop-test/2021/03/30/b7b8ab3a26e74f96bfb8ae44ceff814c/5b78c3117acaa05f42e194b4e12a96a3.jpg",
            "packageSize": 52152,
            "publishTime": "1660133171000",
            "relatedClientId": "demo",
            "relatedEnv": "prod",
            "relatedWorkspaceId": "210220900020010606065",
            "searchKeywords": [
                "3432"
            ],
            "serviceEmail": "test@163.com",
            "serviceTel": "+355-232342344",
            "releaseStatus": "ONLINE"
        }
    ],
    "endIndex": 0,
    "result": {
        "resultCode": "SUCCESS",
        "resultMessage": "Success",
        "resultStatus": "S"
    },
    "totalCount": 57
}