All Products
Search
Document Center

Mobile Platform as a Service:Scheduled Push Tasks

Last Updated:Feb 24, 2025

Query Scheduled Push Task List

Retrieve a list of all created scheduled push tasks, which includes both scheduled and loop push tasks.

Request parameters

Parameter name

Type

Required

Example

Description

appId

String

Yes

ONEX570DA89211721

mPaaS App ID

workspaceId

String

Yes

test

mPaaS workspace

startTime

long

Yes

1619798400000

The start timestamp for triggering the scheduled push, not the creation time of the scheduled push task.

endtTime

long

Yes

1630425600000

The end timestamp for triggering the scheduled push.

type

int

No

0

Push method, where:

  • 0 - Simple push

  • 1 - Template push

  • 2 - Batch push

  • 3 - Group push

uniqueId

String

No

49ec0ed5a2a642bcbe139a2d7a419d6d

The unique ID of the scheduled push task. If the main task ID is provided, information on all subtasks under the main task is returned. If a subtask ID is provided, information on the subtask is returned.

pageNumber

int

No

1

The page number. Default value: 1.

pageSize

int

No

10

The paging size. Default value: 500.

Response parameters

Parameter name

Type

Example

Description

RequestId

String

B589F4F4-CD68-3CE5-BDA0-6597F33E23916512

Request ID

ResultCode

String

OK

Request result code

ResultMessage

String

param is invalid

Request error description

ResultContent

JSON

Response content

data

JSON

Response content. This parameter value is contained in the ResultContent JSON string.

totalCount

int

10

Total count

list

JSONArray

Task array

uniqueId

String

56918166720e46e1bcc40195c9ca71db

The unique ID of the scheduled push task.

  • If the strategyType value is 1, it indicates the main ID of the scheduled push task.

  • If the strategyType value is 2, it indicates the sub ID of the loop task.

parentId

String

56918166720e46e1bcc40195c9ca71db

The main ID of the scheduled push task.

  • If the strategyType value is 1, it indicates the main ID of the scheduled push task.

  • If the strategyType value is 2, it indicates the main ID of the loop task.

pushTime

Date

1630486972000

Estimated push time

pushTitle

String

Test title

Notification title

pushContent

String

Test body

Notification content

type

int

0

Push method, where:

  • 0 - Simple push

  • 1 - Template push

  • 2 - Batch push

  • 3 - Group push

deliveryType

int

1

Push type, where:

  • 1 - Android

  • 2 - iOS

  • 3 - UserId

strategyType

int

1

Push strategy type, where:

  • 1 - Scheduled

  • 2 - Loop

executedStatus

int

0

Execution status, where:

  • 0 - Not executed

  • 1 - Executed

createType

int

0

Creation method, where:

  • 0 - API

  • 1 - Console

gmtCreate

Date

1629971346000

Creation time

Usage example

DefaultProfile.addEndpoint("cn-hangzhou", "mpaas", "mpaas.cn-hangzhou.aliyuncs.com");
        // Create a DefaultAcsClient instance and initialize
        // The Alibaba Cloud account AccessKey has access privileges for all APIs, which poses a high risk. We strongly recommend that you create and use a RAM user for API access or routine maintenance. Please log on to the RAM console to create a RAM user
        // This example shows how to save the AccessKey and AccessKeySecret in environment variables. You can also save them in the configuration file based on your business requirements
        // We strongly recommend that you do not save the AccessKey and AccessKeySecret in the code, as there is a risk of key leakage
        // It is recommended to complete the environment variable configuration first
        String accessKeyId = System.getenv("MPAAS_AK_ENV");
        String accessKeySecret = System.getenv("MPAAS_SK_ENV");
        DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // Region ID
            accessKeyId,      
            accessKeySecret); 
        IAcsClient client = new DefaultAcsClient(profile);

        QueryPushSchedulerListRequest request = new QueryPushSchedulerListRequest();
        request.setAppId("ONEXPREF4F5C52081557");
        request.setWorkspaceId("default");
        request.setStartTime(Long.valueOf("1625068800000"));
        request.setEndTime(Long.valueOf("1630425600000"));
        request.setType(0);
        request.setUniqueId("49ec0ed5a2a642bcbe139a2d7a419d6d");
        request.setPageNumber(1);
        request.setPageSize(10);

        QueryPushSchedulerListResponse response;
        try {
            response = client.getAcsResponse(request);
            System.out.println(response.getResultCode());
            System.out.println(response.getResultMessage());
        } catch (ClientException e) {
            e.printStackTrace();
        }

Cancel Scheduled Push Task

Cancel any unexecuted scheduled push tasks, including loop push tasks, with support for batch cancellation.

Request parameters

Parameter name

Type

Required

Example

Description

appId

String

Yes

ONEX570DA89211721

mPaaS App ID

workspaceId

String

Yes

test

mPaaS workspace

type

int

No

0

Scheduled push task ID type. Default value: 0.

  • 0 - Main task ID, corresponding to parentId

  • 1 - Subtask ID, corresponding to uniqueId

uniqueIds

String

Yes

714613eb,714613ec,714613ed

The unique ID of the scheduled push task. Multiple IDs are separated by commas, with a maximum of 30 IDs.

Response parameters

Parameter name

Type

Example

Description

RequestId

String

B589F4F4-CD68-3CE5-BDA0-6597F33E23916512

Request ID

ResultCode

String

OK

Request result code

ResultMessage

String

param is invalid

Request error description

ResultContent

String

{714613eb=1,714613ed=0}

Cancellation result, where 1 indicates success and 0 indicates failure.

Usage example

DefaultProfile.addEndpoint("cn-hangzhou", "mpaas", "mpaas.cn-hangzhou.aliyuncs.com");
        // Create a DefaultAcsClient instance and initialize
        // The Alibaba Cloud account AccessKey has access privileges for all APIs, which poses a high risk. We strongly recommend that you create and use a RAM user for API access or routine maintenance. Please log on to the RAM console to create a RAM user
        // This example shows how to save the AccessKey and AccessKeySecret in environment variables. You can also save them in the configuration file based on your business requirements
        // We strongly recommend that you do not save the AccessKey and AccessKeySecret in the code, as there is a risk of key leakage
        // It is recommended to complete the environment variable configuration first
        String accessKeyId = System.getenv("MPAAS_AK_ENV");
        String accessKeySecret = System.getenv("MPAAS_SK_ENV");
        DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // Region ID
            accessKeyId,      
            accessKeySecret); 
        IAcsClient client = new DefaultAcsClient(profile);

CancelPushSchedulerRequest request = new CancelPushSchedulerRequest();
        request.setAppId("ONEXPREF4F5C52081557");
        request.setWorkspaceId("default");
        request.setUniqueIds("49ec0ed5a2a642bcbe139a2d7a419d6d, 49ec0ed5a2a642bcbe139a2d7a419d6c");

        CancelPushSchedulerResponse response;
        try {
            response = client.getAcsResponse(request);
            System.out.println(response.getResultCode());
            System.out.println(response.getResultMessage());
        } catch (ClientException e) {
            e.printStackTrace();
        }