Skip to content
1292169282 edited this page Oct 29, 2018 · 1 revision

Welcome to the XGDemoForAndroidStudio wiki!

  1. 统计api,提供针对pushid的推送相关统计数据。包括<应发,实发,抵达,展示,点击>等统计数据。
  2. 提供针对pushId下某状态的设备明细。对于明细数据,以邮件的方式触达用户
  3. 提供对单个设备的推送状态的查询(暂未实现) 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
  4.   {
  5.    "audience_type": "all",
  6.    "platform": "all",
  7.     "channel": "all",
    
  8.    "start_date": "YYYYMMDD",
  9.    "end_date": "YYYYMMDD",
  10.    "stat_tag": "单推推送标签,用于过滤",
  11.    "push_ids": [
  12.    "pushid1",
  13.    "pushid2"
  14.    ]
  15.   }

responseParam

  1.  {
  2.  "ret_code": 0,
    
  3.  "err_msg": "ok",
    
  4.  "result": [
    
  5.      {
    
  6.          "push_id": "total",
    
  7.          "android": {
    
  8.              "push_active": 1000,     //计划发送
    
  9.              "push_online": 900,       //设备在线
    
  10.             "verifySvc": 900,             //到达设备
    
  11.             "verify": 900,                  //展示
    
  12.             "click": 80                       //点击
    
  13.         }, 
    
  14.         "ios": {
    
  15.             "push_active": 1000,     //计划发送
    
  16.             "push_online": 900,       //信鸽后台下发
    
  17.             "verifySvc": 900,           //Apns 接收
    
  18.             "click": 80                     //点击
    
  19.         }
    
  20.     },
    
  21.     {
    
  22.         "push_id": "12345",
    
  23.         "android": {
    
  24.             "push_active": 1000,     //计划发送
    
  25.             "push_online": 900,       //设备在线
    
  26.             "verifySvc": 900,        //到达设备
    
  27.             "verify": 900,            //展示
    
  28.             "click": 80                //点击
    
  29.         },
    
  30.         "ios": {
    
  31.            "push_active": 1000,     //计划发送
    
  32.             "push_online": 900,       //信鸽后台下发
    
  33.             "verifySvc": 900,           //Apns 接收
    
  34.             "click": 80                     //点击
    
  35.         }
    
  36.     }
    
  37. ]
    
  38. } 明细数据请求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
  39.    {
  40.    "audience_type": "all",
  41.     "channel": "all",
    
  42.    "platform": "all",
  43.    "start_date": "YYYYMMDD",
  44.    "end_date": "YYYYMMDD",
  45.    "stat_tag": "单推推送标签,用于过滤",
  46.    "push_id": "String",
  47.    "email": "String",
  48.    "status": 2
  49.   }

responseParam

  1.    {
  2.    "ret_code": 0,
  3.    "err_msg": "ok",
  4.    "result": {
  5.    "request_id": 102345, //任务请求id
  6.    "request_ts": 1531279907
  7.    }
  8.   } 明细请求状态查询 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
  9.  {
    
  10.    "request_ids":[43]
    
  11.  }
    

responseParam

  1.   {
  2.  "taskList": [
    
  3.      {
    
  4.          "requestId": 43,
    
  5.          "taskStatus": "executing",
    
  6.          "executeCode": 0,
    
  7.          "executeMsg": ""
    
  8.      }
    
  9.  ],
    
  10. "ret_code": 0,
    
  11. "err_msg": "ok"
    

明细数据下载接口 api Path请求路径 GET /xg/statistics/filedownLoad 请求参数 参数名 类型 参数说明 request_id int (必须)分配的任务id authorization string 用户认证方式base64(APPID:SECRETKEY) ( 详见官网 RestApi 认证方式 ) 响应参数 待下载文件 : 文件名 accessId_requestId.txt 示例 requestParam

  1. 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

  1.   {
  2.  "push_id": "string",
    
  3.  "token_list": [
    
  4.      "token1",
    
  5.      "token2",
    
  6.      "token3"
    
  7.  ]
    
  8. }

responseParam

  1.  {
  2.  "ret_code": 0,
    
  3.  "err_msg": "ok",
    
  4.  "result": {
    
  5.      "ts": 1531279907,
    
  6.      "token_status": [
    
  7.          {
    
  8.              "token_id": "id1",
    
  9.              "status": 1
    
  10.         },
    
  11.         {
    
  12.             "token_id": "id2",
    
  13.             "status": 2
    
  14.         }
    
  15.     ]
    
  16. }
    
  17. }

Clone this wiki locally