写点什么

MobPush 推送查询

  • 2024-08-23
    上海
  • 本文字数:5662 字

    阅读完需:约 19 分钟

查询推送接口推送的内容只能是 JSON 表示的一个推送对象。

调用验证

详情参见 REST API 概述的 鉴权方式 说明。

频率控制

详情参见推送限制策略的 接口限制 说明。

查询推送任务状态

调用地址

  • POST http://api.push.mob.com/v3/push/getWorkStatus

推送对象

  • 以 JSON 格式表达,表示一条推送相关的所有信息

请求示例

curl --location --request POST 'http://api.push.mob.com/v3/push/getWorkStatus' \ --header 'key: 2e08782eb311b' \ --header 'sign: 15863cb512d9bac150cfc089cfac0b74' \ --header 'Content-Type: application/json' \ --data-raw '{"appkey":"2e08782eb311b","workId":"1609fr73wopsdgcqli4g"}'
复制代码

响应示例

  • 请求成功

{    "status": 200,    "res": "已下发",    "error": null,    "code": 2}
复制代码
  • 请求失败

{    "status": 5801,    "res": null,    "error": "数据校验失败"}
复制代码
  • 响应参数

返回字段说明

未开始:创建定时任务,但是还未到任务执行时间

已下发:任务正常开始执行,还未到任务的截止时间

下发失败:任务开始执行异常,圈选人群过程失败

推送完成:到任务的截止时间,已处理下发完目标设备

已取消:成功取消执行该任务,不会继续下发

已撤回:成功撤回该任务

任务异常:未知异常

查询推送详情

根据 workId 查询

调用地址

  • POST http://api.push.mob.com/v3/stats/getByWorkId

推送对象

  • 以 JSON 格式表达,表示一条推送相关的所有信息

请求示例

curl --location --request POST 'http://api.push.mob.com/v3/stats/getByWorkId' \ --header 'key: 2e08782eb311b' \ --header 'sign: 15863cb512d9bac150cfc089cfac0b74' \ --header 'Content-Type: application/json' \ --data-raw '{"appkey":"2e08782eb311b","workId":"1609fr73wopsdgcqli4g"}'
复制代码

响应示例

  • 请求成功

{    "status": 200,    "res": {        "workno": null,        "id": "1609fr73wopsdgcqli4g",        "android": {            "fetchNum": 1,            "deliverNum": 1,            "deliverFailNum": 0,            "reportNum": 1,            "reportFailNum": 0,            "clickNum": 0        },        "ios": null,        "factory": null,        "mobpush": {            "fetchNum": 1,            "deliverNum": 1,            "deliverFailNum": 0,            "reportNum": 1,            "reportFailNum": 0,            "clickNum": 0        },        "iostcp": null,        "androidtcp": {            "fetchNum": 1,            "deliverNum": 1,            "deliverFailNum": 0,            "reportNum": 1,            "reportFailNum": 0,            "clickNum": 0        },        "apns": null,        "huawei": null,        "xiaomi": null,        "flyme": null,        "fcm": null,        "oppo": null,        "vivo": null,        "offlineIos": null,        "offlineAndroid": null,        "sms": null    },    "error": null}
复制代码
  • 请求失败

{    "status": 5801,    "res": null,    "error": "数据校验失败"}
复制代码
  • 响应参数

根据 workId 数组查询

调用地址

  • POST http://api.push.mob.com/v3/stats/getByWorkIds

推送对象

  • 以 JSON 格式表达,表示一条推送相关的所有信息

请求示例

curl --location --request POST 'http://api.push.mob.com/v3/stats/getByWorkIds' \ --header 'key: 2e08782eb311b' \ --header 'sign: f5a56c1cd0c1613efe38659548aa930d' \ --header 'Content-Type: application/json' \ --data-raw '{"appkey":"2e08782eb311b","workIds":["1609fr73wopsdgcqli4g","1609hk2tuchfl5i3l1j4"]}'
复制代码

响应示例

  • 请求成功

{    "status": 200,    "res": [        {            "workno": null,            "id": "1609fr73wopsdgcqli4g",            "android": {                "fetchNum": 1,                "deliverNum": 1,                "deliverFailNum": 0,                "reportNum": 1,                "reportFailNum": 0,                "clickNum": 0            },            "ios": null,            "factory": null,            "mobpush": {                "fetchNum": 1,                "deliverNum": 1,                "deliverFailNum": 0,                "reportNum": 1,                "reportFailNum": 0,                "clickNum": 0            },            "iostcp": null,            "androidtcp": {                "fetchNum": 1,                "deliverNum": 1,                "deliverFailNum": 0,                "reportNum": 1,                "reportFailNum": 0,                "clickNum": 0            },            "apns": null,            "huawei": null,            "xiaomi": null,            "flyme": null,            "fcm": null,            "oppo": null,            "vivo": null,            "offlineIos": null,            "offlineAndroid": null,            "sms": null        },        {            "workno": null,            "id": "1609hk2tuchfl5i3l1j4",            "android": {                "fetchNum": 2,                "deliverNum": 2,                "deliverFailNum": 0,                "reportNum": 1,                "reportFailNum": 0,                "clickNum": 0            },            "ios": null,            "factory": {                "fetchNum": 1,                "deliverNum": 1,                "deliverFailNum": 0,                "reportNum": 0,                "reportFailNum": 0,                "clickNum": 0            },            "mobpush": {                "fetchNum": 1,                "deliverNum": 1,                "deliverFailNum": 0,                "reportNum": 1,                "reportFailNum": 0,                "clickNum": 0            },            "iostcp": null,            "androidtcp": {                "fetchNum": 1,                "deliverNum": 1,                "deliverFailNum": 0,                "reportNum": 1,                "reportFailNum": 0,                "clickNum": 0            },            "apns": null,            "huawei": {                "fetchNum": 1,                "deliverNum": 1,                "deliverFailNum": 0,                "reportNum": 0,                "reportFailNum": 0,                "clickNum": 0            },            "xiaomi": null,            "flyme": null,            "fcm": null,            "oppo": null,            "vivo": null,            "offlineIos": null,            "offlineAndroid": null,            "sms": null        }    ],    "error": null}
复制代码
  • 请求失败

{    "status": 5801,    "res": null,    "error": "数据校验失败"}
复制代码
  • 响应参数

根据 workno 查询

workno 为自定义任务 ID,只能查询最近 3 天的数据

调用地址

  • POST http://api.push.mob.com/v3/stats/getByWorkno

推送对象

  • 以 JSON 格式表达,表示一条推送相关的所有信息

请求示例

curl --location --request POST 'http://api.push.mob.com/v3/stats/getByWorkno' \ --header 'key: 2e08782eb311b' \ --header 'sign: 8ecb4cf84760efe64578a83583b324b5' \ --header 'Content-Type: application/json' \ --data-raw '{"appkey":"2e08782eb311b","workno":"gxd123456789"}'
复制代码

响应示例

  • 请求成功

{    "status": 200,    "res": {        "workno": "gxd123456789",        "id": "1609hg9ho7l4a1hw8pog",        "android": {            "fetchNum": 2,            "deliverNum": 0,            "deliverFailNum": 0,            "reportNum": 0,            "reportFailNum": 0,            "clickNum": 0        },        "ios": null,        "factory": null,        "mobpush": null,        "iostcp": null,        "androidtcp": null,        "apns": null,        "huawei": null,        "xiaomi": null,        "flyme": null,        "fcm": null,        "oppo": null,        "vivo": null,        "offlineIos": null,        "offlineAndroid": null,        "sms": null    },    "error": null}
复制代码
  • 请求失败

{    "status": 5801,    "res": null,    "error": "数据校验失败"}
复制代码
  • 响应参数

根据日期查询

调用地址

  • POST http://api.push.mob.com/v3/stats/getByDay

推送对象

  • 以 JSON 格式表达,表示一条推送相关的所有信息

请求示例

curl --location --request POST 'http://api.push.mob.com/v3/stats/getByDay' \ --header 'key: 2e08782eb311b' \ --header 'sign: b223342835bbb272132e8a2732c75442' \ --header 'Content-Type: application/json' \ --data-raw '{"appkey":"2e08782eb311b","day":"20230518"}'
复制代码

响应示例

  • 请求成功

{    "status": 200,    "res": {        "appkey": "2e08782eb311b",        "day": "20230518",        "fetchNum": 5,        "fetchNumAndroid": 5,        "fetchNumIos": 0,        "workNum": 5,        "workNumAndroid": 5,        "workNumIos": 0,        "deliverNumTcp": 2,        "reportNumTcp": 2,        "clickNumTcp": 0,        "deliverNum": 3,        "deliverNumAndroid": 3,        "deliverNumIos": 0,        "reportNum": 2,        "reportNumAndroid": 2,        "reportNumIos": 0,        "clickNum": 0,        "clickNumAndroid": 0,        "clickNumIos": 0,        "apiNum": 0,        "apiNumAndroid": 0,        "apiNumIos": 0,        "activeNum": 2,        "activeNumAndroid": 2,        "activeNumIos": 0,        "newDeviceNum": 1,        "newDeviceNumAndroid": 1,        "newDeviceNumIos": 0,        "onlineTimeAvg": 0,        "onlineTimeAvgAndroid": 0,        "onlineTimeAvgIos": 0,        "onlineTimeAll": 0,        "onlineTimeAllAndroid": 0,        "onlineTimeAllIos": 0,        "openAppAvg": 7,        "openAppAvgAndroid": 7,        "openAppAvgIos": 0,        "openAppAll": 14,        "openAppAllAndroid": 14,        "openAppAllIos": 0    },    "error": null}
复制代码
  • 请求失败

{    "status": 5801,    "res": null,    "error": "数据校验失败"}
复制代码
  • 响应参数

查询每次下发的设备信息

该接口暂只支持查精准推送的推送设备详情(例如:别名、rid、别名文件推送和 rid 文件推送)

该接口维护中,暂不可用

调用地址

  • POST http://api.push.mob.com/v3/stats/getByDevice

推送对象

  • 以 JSON 格式表达,表示一条推送相关的所有信息

请求示例

curl --location --request POST 'http://api.push.mob.com/v3/stats/getByDevice' \--header 'key: 2e08782eb311b' \--header 'sign: f4050aef0ee25440d74119817aea42bf' \--header 'Content-Type: application/json' \--data-raw '{"appkey":"2e08782eb311b","workId":"1609fr73woqnm4lzptkw","pageIndex":1,"pageSize":20}'
复制代码

响应示例

  • 请求成功

{    "status": 200,    "res": {        "totalPages": 1,        "total": 1,        "content": [            {                "id": "1609fr73woqnm4lzptkw65l0soev0d0b4lc",                "rid": "65l0soev0d0b4lc",                "alias": null,                "guardId": "4ac763ec-522f-4969-9789-9b7c076116a5",                "tag": null,                "workId": "1609fr73woqnm4lzptkw",                "patchId": "1609fr73woqnm4lzptkw_0_XIAOMI",                "offline": null,                "deliver": [                    "mobpush"                ],                "deliverTime": [                    1684736743029                ],                "report": [                    "mobpush"                ],                "reportTime": [                    1684736743321                ],                "click": null,                "clickTime": null            }        ]    },    "error": null}
复制代码
  • 请求失败

{    "status": 5801,    "res": null,    "error": "数据校验失败"}
复制代码
  • 响应参数

根据活动任务 id 查询活动任务聚合数据

调用地址

  • POST http://api.push.mob.com/v3/stats/getActivity

推送对象

  • 以 JSON 格式表达,表示一条推送相关的所有信息

请求示例

// 活动任务id为用户自行设置,且唯一curl --location --request POST 'http://api.push.mob.com/v3/stats/getActivity' \--header 'key: 2e08782eb311b' \--header 'sign: 03ee692eb1319994970167619cb6f721' \--header 'Content-Type: application/json' \--data-raw '{"appkey":"2e08782eb311b","activityWorkId":"1775565980385"}'
复制代码

响应示例

  • 请求成功

{    "status": 200,    "res": {        "appkey": "2e08782eb311b",        "activityWorkId": "1775565980385",        "fetchNum": 2,        "deliverNum": 0,        "reportNum": 0,        "clickNum": 0    },    "error": null}
复制代码
  • 请求失败

{    "status": 5801,    "res": null,    "error": "数据校验失败"}
复制代码
  • 响应参数


用户头像

还未添加个人签名 2019-05-08 加入

还未添加个人简介

评论

发布
暂无评论
MobPush推送查询_Java_MobTech袤博科技_InfoQ写作社区