Operation-related APIs
This topic introduces all operation-related APIs. Call APIs per your business requirements to realize specific operation-related services/capabilities.
These APIs are embedded in the com.iap.ac.android.biz.OperationManager
class.
Note: These APIs are applicable to all versions of the Android SDK 2.67.0 and later. For more, see SDK release notes.
setRegionGatewayUrl API
This API is called to set the regional proxy, the gateway URL address.
Method signature
companion object {
fun setRegionGatewayUrl(gatewayUrl: String) { }
}
Parameters
Parameter | Data type | Required | Description |
gatewayUrl | String | Yes | Indicates the gateway URL address. |
Return value
N/A
Sample
OperationManager.setRegionGatewayUrl("https://xxx.yyy.com")
setRegionLogUploadUrl API
This API is called to set the regional proxy, the log uploading URL address.
Method signature
companion object {
fun setRegionLogUploadUrl(logUploadUrl: String){ }
}
Parameters
Parameter | Data type | Required | Description |
logUploadUrl | String | Yes | Indicates the log uploading URL address. |
Return value
N/A
Sample
OperationManager.setRegionLogUploadUrl("https://xxx.yyy.com")
searchAppsByKeywords API
This API is called to search mini programs by keywords. Results can be paginated to support large datasets.
Method signature
companion object {
fun searchAppsByKeywords(
keywords: String,
queryStartIndex: Int,
querySize: Int,
callBack: FetchSearchAppsByKeywordCallBack<SearchAppsResult>
) { }
}
Parameters
Parameter | Data type | Required | Description |
keywords | String | Yes | The search terms used to query mini programs. |
queryStartIndex | Int | Yes | The starting index for the query result. Use |
querySize | Int | Yes | The maximum number of results to return per query request. |
callBack | FetchSearchAppsByKeywordCallBack<SearchAppsResult> | Yes | A callback to execute methods upon query completion. For more information, refer to |
Return value
N/A
Sample
OperationManager.searchAppsByKeywords("keyword", 0, 10, object : FetchSearchAppsByKeywordCallBack<SearchAppsResult>() {
override fun onResponse(result: SearchAppsResult) {
// Handle successful response
}
override fun onFailure(errorCode: Int, errorMessage: String) {
// Handle error
}
})
fetchLaunchableGroupsWithCodes API
This API is called to retrieve details of mini service sections using their unique identifiers. It prioritizes locally cached data that is retrieved within the predefined timeframe. If cached data is outdated, fresh data will be fetched directly from the server.
Method signature
companion object {
fun fetchLaunchableGroupsWithCodes(
codes: List<String>,
callback: FetchLaunchableGroupsCallback<Map<String, LaunchableGroup>>
) { }
}
Parameters
Parameter | Data type | Required | Description |
codes | List<String> | Yes | A list of unique codes that are assigned by Mini Program Platform to identify mini service sections. |
callback | FetchLaunchableGroupsCallback<Map<String, LaunchableGroup>> | Yes | A callback to execute methods upon request completion. For more information, refer to |
Return value
N/A
Error codes
Error code | Error message | Further action |
10100 | API is banned | Occurs due to operational misconfiguration. Please contact overseas_support@service.alibaba.com for help. |
10102 | Paramaters are invalid | Check the Parameters table to ensure all parameter types are correct and that all required parameters are specified. |
20100 | Error message varies based on the specific error. | Typically occurs when the API call is successful but the response indicates a failure (the success field is |
Sample
var codes = listOf("MINI_SERVICE_LAST_USED", "MINI_SERVICE_FAVORITE")
OperationManager.fetchLaunchableGroupsWithCodes(codes, object : FetchLaunchableGroupsCallback<Map<String, LaunchableGroup>>() {
override fun onResponse(result: Map<String, LaunchableGroup>) {
// Handle successful response
}
override fun onFailure(errorCode: String, errorMessage: String) {
// Handle error
}
})
fetchLaunchableGroupsWithCodesNoCache API
This API is called to retrieve details of mini service sections using their unique identifiers. It directly fetches data from the server.
Method signature
companion object {
fun fetchLaunchableGroupsWithCodesNoCache(
codes: List<String>,
callback: FetchLaunchableGroupsCallback<Map<String, LaunchableGroup>>
) {
}
}
Parameters
Parameter | Data type | Required | Description |
codes | List<String> | Yes | A list of unique codes that are assigned by Mini Program Platform to identify mini service sections. |
callback | FetchLaunchableGroupsCallback<Map<String, LaunchableGroup>> | Yes | A callback to execute methods upon request completion. For more information, refer to |
Return value
N/A
Error codes
Error code | Error message | Further action |
10100 | API is banned | Occurs due to operational misconfiguration. Please contact overseas_support@service.alibaba.com for help. |
10102 | Paramaters are invalid | Check the Parameters table to ensure all parameter types are correct and that all required parameters are specified. |
20100 | Error message varies based on the specific error. | Typically occurs when the API call is successful but the response indicates a failure (the success field is |
Sample
var codes = listOf("MINI_SERVICE_LAST_USED", "MINI_SERVICE_FAVORITE")
OperationManager.fetchLaunchableGroupsWithCodesNoCache(codes, object : FetchLaunchableGroupsCallback<Map<String, LaunchableGroup>>() {
override fun onResponse(result: Map<String, LaunchableGroup>) {
// Handle successful response
}
override fun onFailure(errorCode: String, errorMessage: String) {
// Handle error
}
})