-
Notifications
You must be signed in to change notification settings - Fork 0
Home
1292169282 edited this page Oct 29, 2018
·
1 revision
Welcome to the XGDemoForAndroidStudio wiki!
- 统计api,提供针对pushid的推送相关统计数据。包括<应发,实发,抵达,展示,点击>等统计数据。
- 提供针对pushId下某状态的设备明细。对于明细数据,以邮件的方式触达用户
- 提供对单个设备的推送状态的查询(暂未实现)
restApi接口设计
推送统计api
Path请求路径/xg/statistics/received
请求参数
参数名 类型 参数说明
audience_type String (必须)推送类型
1)1:all:全量推送
2)2:tag:标签推送
3)3:token:单设备推送
4)4:token_list :设备列表推送
5)5:account:单账号推送
6)6:account_list:账号列表推送
channel String (非必, 不填or 填all 代表不区分通道)厂商通道
0)0:all:不区分通道类型
1)1:xiaomi:小米通道
2)2:huawei:华为通道
3)3:meizu:魅族通道
4)4:oppo:oppo 通道
5)5:fcm:fcm 通道
6)6:gcm:gcm 通道
7)7:xinge:xinge 通道
platform String (必须)客户端平台类型
1)1:all:all:安卓&&苹果
2)2:android:安卓
3)3:ios:苹果
start_date String (非必须,仅对单推有效)统计起始日期,默认为推送日期
end_date String (非必须,仅对单推有效)统计结束如期,默认为当前日期
stat_tag String (非必须,仅对单推有效)单推聚合标签
push_ids JsonArrary (非必须) 待查询pushIds。 限制 100 条。
当audience_type=all or tag 时, push_ids 必填 且push_ids 元素长度大于0
当 audience_type=token or token_list or account or account_list 时。 push_ids 选填。 当push_Ids 长度为0 时, 按照stat_tag, start_date, end_date, 3 个字段进行聚合统计 响应参数 参数名 类型 参数说明 ret_code int 返回码 err_msg String 错误信息 result jsonObject 查询的推送统计结果信息 示例 requestParam - {
- "audience_type": "all",
- "platform": "all",
-
"channel": "all", - "start_date": "YYYYMMDD",
- "end_date": "YYYYMMDD",
- "stat_tag": "单推推送标签,用于过滤",
- "push_ids": [
- "pushid1",
- "pushid2"
- ]
- }
responseParam
- {
-
"ret_code": 0, -
"err_msg": "ok", -
"result": [ -
{ -
"push_id": "total", -
"android": { -
"push_active": 1000, //计划发送 -
"push_online": 900, //设备在线 -
"verifySvc": 900, //到达设备 -
"verify": 900, //展示 -
"click": 80 //点击 -
}, -
"ios": { -
"push_active": 1000, //计划发送 -
"push_online": 900, //信鸽后台下发 -
"verifySvc": 900, //Apns 接收 -
"click": 80 //点击 -
} -
}, -
{ -
"push_id": "12345", -
"android": { -
"push_active": 1000, //计划发送 -
"push_online": 900, //设备在线 -
"verifySvc": 900, //到达设备 -
"verify": 900, //展示 -
"click": 80 //点击 -
}, -
"ios": { -
"push_active": 1000, //计划发送 -
"push_online": 900, //信鸽后台下发 -
"verifySvc": 900, //Apns 接收 -
"click": 80 //点击 -
} -
} -
] - }
明细数据请求api
Path请求路径 /xg/statistics/statusAsync
请求参数
参数名 类型 参数说明
audience_type String (必须)推送类型
1)1:all:全量推送
2)2:tag:标签推送
3)3:token:单设备推送
4)4:token_list :设备列表推送
5)5:account:单账号推送
6)6:account_list:账号列表推送
platform String (必须)客户端平台类型
1)1:all:all:安卓&&苹果
2)2:android:安卓
3)3:ios:苹果
channel String (非必, 不填or 填all 代表不区分通道)厂商通道
0)0:all:不区分通道类型
1)1:xiaomi:小米通道
2)2:huawei:华为通道
3)3:meizu:魅族通道
4)4:oppo:oppo 通道
5)5:fcm:fcm 通道
6)6:gcm:gcm 通道
7)7:xinge:xinge 通道
start_date String (非必须, 仅对单推有效)统计起始日期,默认为推送日期
end_date String (非必须, 仅对单推有效)统计结束如期,默认为当前日期
stat_tag String (非必须,仅对单推有效)单推推送标签,用于过滤。该字段在调用接口 创建推送任务时设置。
详见官网V3 RestApi 非必须字段描述。
仅当audience_type=token or token_list or account or account_list 时,
且push_id 元素不存在时, 该字段有效 且必填,单推统计按照该字段进行聚合。 push_id String (非必须)推送的pushId。 仅当audience_type=all or tag 时有效,且必填。 用于对全推 或tag t推 进行明细查询时,过滤查询明细数据。 status Int (必须)待筛选用户的过滤状态。1-100 :android ,100-200 :ios 1 计划发送 2 实际发送
3 未发送 4 抵达设备 5 发送未抵达设备 6 展示 7 抵达未展示 8 点击 9 展示未点击 101 计划发送
102 信鸽后台下发 103 未发送 104 抵达 105 发送未抵达 106 点击
107 抵达未点击 响应参数 参数名 类型 参数说明 ret_code int 返回码 err_msg String 错误信息 result jsonObject 请求id, 对于每次请求时 产生。 示例 requestParam - {
- "audience_type": "all",
-
"channel": "all", - "platform": "all",
- "start_date": "YYYYMMDD",
- "end_date": "YYYYMMDD",
- "stat_tag": "单推推送标签,用于过滤",
- "push_id": "String",
- "email": "String",
- "status": 2
- }
responseParam
- {
- "ret_code": 0,
- "err_msg": "ok",
- "result": {
- "request_id": 102345, //任务请求id
- "request_ts": 1531279907
- }
- } 明细请求状态查询 api Path请求路径 /xg/statistics/statusAsyncTaskQuery 请求参数 参数名 类型 参数说明 request_ids JsonArrary (必须)待查询任务id 响应参数 参数名 类型 参数说明 ret_code int 返回码 err_msg String 错误信息 taskList jsonObject 任务状态列表 exm: [{"requestId":43,"taskStatus":"executing","executeCode":0,"executeMsg":""} ] taskStatus: created 任务已创建,distributed 任务已分配执行, executing 执行中, failed 执行失败, stopped 永久中止 示例 requestParam
-
{ -
"request_ids":[43] -
}
responseParam
- {
-
"taskList": [ -
{ -
"requestId": 43, -
"taskStatus": "executing", -
"executeCode": 0, -
"executeMsg": "" -
} -
], -
"ret_code": 0, -
"err_msg": "ok"
明细数据下载接口 api Path请求路径 GET /xg/statistics/filedownLoad 请求参数 参数名 类型 参数说明 request_id int (必须)分配的任务id authorization string 用户认证方式base64(APPID:SECRETKEY) ( 详见官网 RestApi 认证方式 ) 响应参数 待下载文件 : 文件名 accessId_requestId.txt 示例 requestParam
- openapi.xg.qq.com/xg-web-service-push/xg/statistics/filedownLoad?authorization=认证鉴权&request_id=47
responseParam
1.
单个设备状态查询接口api (暂未实现)
Path请求路径 /xg/statistics/devicestatus
请求参数
参数名 类型 参数说明
push_id Int 推送的pushId
token_list JsonArrary 待查询token 列表
限制数目待评估
响应参数
参数名 类型 参数说明
ret_code int 返回码
err_msg String 错误信息
result jsonObect 查询结果
示例
requestParam
- {
-
"push_id": "string", -
"token_list": [ -
"token1", -
"token2", -
"token3" -
] - }
responseParam
- {
-
"ret_code": 0, -
"err_msg": "ok", -
"result": { -
"ts": 1531279907, -
"token_status": [ -
{ -
"token_id": "id1", -
"status": 1 -
}, -
{ -
"token_id": "id2", -
"status": 2 -
} -
] -
} - }