Querying All Push Information for Specific Period

Last updated: 2020-01-15 10:23:39

PDF

API Description

Request method: POST
Calling frequency limit: 200 times/hour.

https://api.tpns.tencent.com/v3/statistics/get_push_record

Feature: This API queries the basic information and settings of all tasks within a specified time range.

Parameter Descriptions

Request Parameters

Parameter name Required Type Description
startDate Yes string Start date of the query,
  • Format: YYYY-MM-DD
  • Query limit: within the last 3 months
  • endDate Yes string End date of the query, format: YYYY-MM-DD
    msgType No string Message type:
  • notify: notification
  • message: silent message
  • pushType No string Push type:
  • all: full push
  • tag: tag push
  • token: device list/device single push
  • account: account list/account single push
  • offset No int Paged query starting offset
    limit No int Paged query number of messages by page (maximum 200)

    Response Parameters

    Parameter name Type Description
    retCode int Returned status code
    errMsg string Error message
    pushRecordData JsonArray Returned results, with pushRecordData structure variables shown in following table
    count int Number of eligible records

    pushRecordData

    Parameter name Type Description Value description
    date string Push time Format: YYYY-MM-DD hh:mm:ss
    pushId int Message ID -
    title string Push title -
    content int Push content -
    status string Push status
  • PUSH_INIT //Task created
  • PUSH_WAIT; // Waiting for task to be scheduled
  • PUSH_STARTED; // Push started
  • PUSH_FINISHED; // Push finished
  • PUSH_FAILED; //Push failed
  • PUSH_CANCELED; // Push canceled by user
  • PUSH_DELETED; // Push deleted
  • pushType string Push target
  • all //Full push
  • tag //Tag push
  • token_list //Device list
  • account_list //Account list
  • package_account_push //Number package push
  • messageType string Push type
  • notify //Notification
  • message //Message
  • environment string Push environment
  • product //Production environment
  • dev //Development environment
  • expireTime uint32 Expiration time Unit: second
    xgMediaResources string Rich media information -
    multiPkg bool Multi-package-name push? -
    targetList jsonArrary(string) Push account or push device list Valid when pushType is token_list or account_list
    tagSet JsonObject Tag settings Valid when pushType is tag
    Data structure:
    {
    "op":"OR", //Inter–tag logic operation
    "tagWithType":[
    { "tagTypeName":"xg_user_define", //Tag type
    "tagValue":"test68" //Tag value}
    ]
    }
    uploadId uint32 Number package ID Valid when pushType is package_account_push
    pushConfig JsonObject Push configuration information
    "Android": for specific push configuration information related to Android, refer to the following code
    "iOS": for specific push configuration related to iOS, refer to the following code

    Configuration Information

    Android Push Configuration Information

    "android":{
     "ring":1, //ring
     "vibrate":0, //vibrate
     "lights":1, //breathing light
     "clearable":1, //whether clearable or not
     "action":{
     // Action type; 1. Open activity or app; 2. Open browser; 3. Open Intent
     "action_type":1
     },
     "custom_content":"{}" //custom parameter
    }

    iOS Push Configuration Information

    "ios":{
     "aps": {
     "alert": {
     "subtitle": "my subtitle"
     },
     "badge_type": 5, //badge number displayed by app (optional) -2 auto-increment,-1 unchanged,
     "sound":"notification sound effect", //default means the default sound effect
     "category": "INVITE_CATEGORY",
     "mutable-content" : 1
     }
    }

    Example

    Request Example

    {
     "limit": 50,
     "startDate": "2019-07-01",
     "endDate": "2019-08-01",
     "msgType": "notify",
     "pushType": "all",
     "offset": 0
    }

    Response Example

    Blind watermarking can protect against different kinds of image theft attacks such as clipping, smudging, and color change. The anti-theft effect is related to the original image size and the attack intensity. For more details, please submit a ticket.

    {
        "retCode": 0,
        "errMsg": "NO_ERROR",
        "count": 126,
        "pushRecordData": [
            {
                "date": "2019-11-18 11:26:54",
                "pushId": "12",
                "title": "test title",
                "content": "test log",
                "status": "PUSH_FINISHED",
                "pushType": "all",
                "targetList": null,
                "tagSet": null,
                "uploadId": 0,
                "groupId": "",
                "expireTime": 43200,
                "messageType": "notify",
                "xgMediaResources": "",
                "environment": "product",
                "pushConfig": {
                    "android": {
                        "n_id": 0,
                        "builder_id": 0,
                        "ring": 1,
                        "ring_raw": "",
                        "vibrate": 1,
                        "lights": 1,
                        "clearable": 1,
                        "icon_type": 0,
                        "icon_res": "",
                        "style_id": 0,
                        "small_icon": "",
                        "action": {
                            "action_type": 3,
                            "activity": "",
                            "aty_attr": null,
                            "browser": null,
                            "intent": ""
                        },
                        "custom_content": ""
                    },
                    "ios": null,
                    "iot": null
                },
                "multiPkg": true,
                "source": "api"
            }
        ]
    }