获取App新增用户留存率
com.umeng.uapp:umeng.uapp.getRetentions-1
系统级输入参数|应用级输入参数|返回结果|示例|错误码|API工具
获取指定App某个时间范围内的新增用户留存率
系统级输入参数
名称 | 类型 | 是否必须 | 描述 | 示例值 |
---|---|---|---|---|
_aop_signature | String | 是 | 请求签名 | -- |
_aop_timestamp | String | 否 | 请求时间戳 | -- |
应用级输入参数
名称 | 类型 | 是否必须 | 描述 | 示例值 |
---|---|---|---|---|
appkey | String | 是 | 应用ID | -- |
startDate | String | 是 | 查询起始日期(2019-01-01) | 2019-01-01 |
endDate | String | 是 | 查询截止日期(2019-01-01) | 2019-01-01 |
periodType | String | 否 | 查询类型(按日daily,按周weekly,按月monthly 查询) | daily |
channel | String | 否 | 渠道名称(仅限一个App%20Store) | -- |
version | String | 否 | 版本名称(仅限一个1.0.0) | -- |
type | String | 否 | newUser(默认):新增用户留存率;activeUser:活跃用户留存率 | -- |
返回结果
名称 | 类型 | 描述 | 示例值 |
---|---|---|---|
retentionInfo | umeng.uapp.RetentionInfo[] | -- | -- |
请求示例
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import aop
import aop.api
import json
# 设置网关域名
aop.set_default_server('gateway.open.umeng.com')
# 设置apiKey和apiSecurity
aop.set_default_appinfo(12344, "xxxxxxxxxx")
# 构造Request和访问协议是否是https
req = aop.api.UmengUappGetRetentionsRequest()
# 发起Api请求
try:
resp = req.get_response(None, appkey="", startDate="2019-01-01", endDate="2019-01-01", periodType="daily", channel="", version="", type="")
print(resp)
except aop.ApiError as e:
# Api网关返回的异常
print(e)
except aop.AopError as e:
# 客户端Api网关请求前的异常
print(e)
except Exception as e:
# 其它未知异常
print(e)
响应示例
{
"retentionInfo":[
{
"date":"xxx",
"totalInstallUser":0,
"retentionRate":""
}
]
}
异常示例
{
"error_message":"Illegal argument xxx : expect [type: Long] but [type: java.lang.String]",
"error_code":"gw.ParamIllegal",
"request_id":"0ba0f599jdy76m43-18"
}