Push Plan API
The APIs in this module mainly focus on the creation, modification, and query operations of the push plan ID itself.
Call Verification
For details, refer to the description of the [Authentication Method](/zh_CN/docs/app-push/rest-api/rest-api-overview#Authentication Method) in the REST API Overview.
Create and Update Push Plan
This interface is used to create or update a push plan. By passing in plan_id
and plan_description
, the system will perform a creation or update operation based on whether the plan_id
exists.
Call Address
POST v4//v4/push_plan
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
plan_id | string | Yes | Unique identifier of the push plan |
plan_description | string | Yes | Description information of the push plan |
Request Example
{
"plan_id": "push_20231001_001",
"plan_description": "Push plan for the Double 11 promotion event, covering all users"
}
Return Parameter Description
Successful Response
{
"plan_id": "push_20231001_001"
}
Failed Response
{
"error": {
"code": 27303,
"message": "Empty plan id"
}
}
Query Push Plan
This interface is used to query the push plan list in pages, and supports filtering by the sending source and fuzzy searching for the plan description/plan ID.
Call Address
GET v4/push_plan/list?page_index=x&page_size=xx&send_source=x&search_description=xxx
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
page_index | int | Yes | The page number for pagination (counting starts from 1 ) |
page_size | int | Yes | The number of data entries per page, with a maximum support of 100 entries |
send_source | int | No | Sending source identifier: 0 -API, 1 -Web Console |
search_description | string | No | Fuzzy matching of the plan description or plan ID (supports Chinese, English, numbers, and underscores) |
Request Example
GET /v4/push_plan/list?page_index=1&page_size=20&send_source=1&search_description=Double 11
Return Parameter Description
Successful Response
{
"push_plan_info": [
{
"push_id": "push_20231111",
"plan_description": "Double 11全站Push Plan",
"count": 15,
"create_time": "2023-11-01T10:00:00Z",
"last_used_time": "2023-11-11T20:30:00Z"
}
],
"total": 1
}
Failed Response
{
"error": {
"code": 1003,
"message": "Parameter value is invalid"
}
}
Query Msgid Based on Push Plan
This interface is used to obtain the associated message IDs of the specified push plan within the last month, and supports batch query of the associated message data of multiple plans.
Call Address
GET /v4/status/plan/msg/?plan_ids=xxxxxx,xxxxxx&start_date=yyyy-MM-dd&end_date=yyyy-MM-dd
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
plan_ids | string | Yes | List of push plan IDs, separated by English commas for multiple IDs, with a maximum support of 100 IDs |
start_date | string | Yes | Start date (Format: yyyy-MM-dd ), which must meet: |
end_date | string | Yes | End date (Format: yyyy-MM-dd ), which must meet: |
Request Example
GET /v4/status/plan/msg/?plan_ids=push_20231101,push_20231102&start_date=2023-11-01&end_date=2023-11-15
Return Parameter Description
Successful Response
{
"push_20231101": {
"msg_ids": ["msg_001", "msg_002"]
},
"push_20231102": {
"msg_ids": ["msg_003"]
}
}
Failed Response
{
"error": {
"code": 21044,
"message": "The time interval exceeds one month."
}
}
Error Code Description
Error Code | Description | Suggested Handling Method |
---|---|---|
21015 | Request parameters for creating a push plan are incorrect | Check if the types of plan_id or plan_description are correct |
27300 | The push plan identifier is illegal | Check plan_id to make it conform to the naming rules |
27301 | The push plan description is illegal | Check plan_description to make it conform to the rules |
27303 | The push plan identifier is empty | Provide a valid push plan identifier when creating a push plan |
27304 | The length of the push plan identifier exceeds the limit | Make the length of the push plan identifier less than 50 |
21004 | Permission verification for creating a push plan fails | Confirm whether the caller has the access permission to the interface |
27000 | Internal server error | Contact technical support or retry |
1003 | The parameters for querying the push plan are illegal | Check if page_index/page_size is greater than 0 |
21004 | Permission verification for querying the push plan fails | Confirm whether the caller has the access permission to the interface |
27302 | Exceeded the upper limit of push plan usage | Contact technical support to increase the limit |
21009 | Internal system error, cannot be retried | Contact technical support |
23001 | Permission verification for querying Msgid based on the push plan fails | Confirm whether the caller has the access permission to the interface |
3010 | The API call volume of the query interface exceeds the limit | Contact technical support |
23002 | The valid pl parameter passed in for querying Msgid based on the push plan is incorrect | Check the validity of plan_ids or whether the date parameters are passed |
21003 | The passed-in date is illegal | Check the validity of the date |
21044 | The interval between the start and end dates exceeds one month | Make the interval between the start and end dates less than one month |