Push Plan API

Última actualización:2023-11-15

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
          POST v4//v4/push_plan

        
Este bloque de código se muestra en una ventana flotante

Request Parameters

Parameter Name Type Required Description
plan_id string Yes Unique identifier of the push plan
  • Format rules: A combination of letters (case-sensitive), numbers, and underscores. Starting with an underscore is prohibited.
  • Length limit: A maximum of 50 characters.
  • Uniqueness constraint: Cannot be modified after being set.
  • Update strategy: When the plan_id already exists, update the plan_description. When it does not exist, create a new plan.
  • plan_description string Yes Description information of the push plan
  • Content requirements: It is necessary to include key business information such as the push scenario, target users, and push content.
  • Format specification: Supports Chinese, English, numbers, and common punctuation marks.
  • Length suggestion: No more than 200 characters (the system does not impose a mandatory limit).
  • Request Example

    { "plan_id": "push_20231001_001", "plan_description": "Push plan for the Double 11 promotion event, covering all users" }
              {
      "plan_id": "push_20231001_001",
      "plan_description": "Push plan for the Double 11 promotion event, covering all users"
    }
    
            
    Este bloque de código se muestra en una ventana flotante

    Return Parameter Description

    Successful Response

    { "plan_id": "push_20231001_001" }
              {
      "plan_id": "push_20231001_001"
    }
    
            
    Este bloque de código se muestra en una ventana flotante

    Failed Response

    { "error": { "code": 27303, "message": "Empty plan id" } }
              {
      "error": {
        "code": 27303,
        "message": "Empty plan id"
      }
    }
    
            
    Este bloque de código se muestra en una ventana flotante

    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
              GET v4/push_plan/list?page_index=x&page_size=xx&send_source=x&search_description=xxx
    
            
    Este bloque de código se muestra en una ventana flotante

    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
              GET /v4/push_plan/list?page_index=1&page_size=20&send_source=1&search_description=Double 11
    
            
    Este bloque de código se muestra en una ventana flotante

    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 }
              {
      "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
    }
    
            
    Este bloque de código se muestra en una ventana flotante

    Failed Response

    { "error": { "code": 1003, "message": "Parameter value is invalid" } }
              {
        "error": {
            "code": 1003,
            "message": "Parameter value is invalid"
        }
    }
    
            
    Este bloque de código se muestra en una ventana flotante

    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
              GET /v4/status/plan/msg/?plan_ids=xxxxxx,xxxxxx&start_date=yyyy-MM-dd&end_date=yyyy-MM-dd
    
            
    Este bloque de código se muestra en una ventana flotante

    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:
  • 1. Within 30 days before the current date
  • 2. End date >= Start date
  • end_date string Yes End date (Format: yyyy-MM-dd), which must meet:
  • 1. Interval between the start date and the end date ≤ 31 days
  • 2. Not earlier than the start date
  • Request Example

    GET /v4/status/plan/msg/?plan_ids=push_20231101,push_20231102&start_date=2023-11-01&end_date=2023-11-15
              GET /v4/status/plan/msg/?plan_ids=push_20231101,push_20231102&start_date=2023-11-01&end_date=2023-11-15
    
            
    Este bloque de código se muestra en una ventana flotante

    Return Parameter Description

    Successful Response

    { "push_20231101": { "msg_ids": ["msg_001", "msg_002"] }, "push_20231102": { "msg_ids": ["msg_003"] } }
              {
      "push_20231101": {
        "msg_ids": ["msg_001", "msg_002"]
      },
      "push_20231102": {
        "msg_ids": ["msg_003"]
      }
    }
    
            
    Este bloque de código se muestra en una ventana flotante

    Failed Response

    { "error": { "code": 21044, "message": "The time interval exceeds one month." } }
              {
        "error": {
            "code": 21044,
            "message": "The time interval exceeds one month."
        }
    }
    
            
    Este bloque de código se muestra en una ventana flotante

    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
    在文档中心打开
    icon
    Contacto