一、留存分析查询API

此API用于客户根据书签编号获取到相应留存分析的结果查询

二、调用方法

API URL: https://higateway.haishuu.com/gateway/hi-api/v1/retention-analysis-list
请求方式:POST Content-Type: application/json
接口状态:正常

2.1 请求参数

名称 位置 类型 是否必填 描述
hi-api-key header String 访问接口的权限key
字段 名称 类型 是否必填 描述
projectCode 项目编码 String 该数据所属的项目编码
bookmarkId 书签编号 Long 书签编号
curl --request POST \
  --url https://higateway.haishuu.com/gateway/hi-api/v1/retention-analysis-list \
  --header 'Content-Type: application/json' \
  --header 'hi-api-key: #K-xxx' \
  --data '{
    "projectCode": "projectCode",
    "bookmarkId": 185xxxxxxxx3342
}'

2.2 返回参数

字段 名称 类型 描述
status 接口响应状态码 Integer 成功=200
code 业务响应编码 String 成功=0
message 业务响应描述 String 操作成功
success 接口成功标记 Boolean true 成功, false 失败
data 返回数据 Oject 返回数据
字段 名称 类型 描述
windowsGap 窗口时长 Integer 窗口时长
windowsGapTu 窗口时长单位 String day 日, week 周, month 月
target 分析类型 String loss 流失, retention 留存
result 分析结果 List 分析结果
字段 名称 类型 描述
pk_day 分析时间 String 分析时间
users_cnt 用户数 Integer 用户数
bins 分组项汇总 String 分组项汇总
day_N 留存数 String 分析类型为 留存 有该字段,第n天留存数,窗口时长有几天/周/月就有多少个属性 例如:day_0 当天/周/月留存数,day_1 次天/周/月留存数,day_2 第2天/周/月留存数…
day_N_percent 留存率 String 分析类型为 留存 有该字段,第n天留存率 例如:day_0_percent 当天/周/月留存率,day_1_percent 次天/周/月留存率,day_2_percent 第2天/周/月留存率…
day_N_show 同时展示 String 分析类型为 留存 有该字段,第n天留存率 例如:day_0_show 当天/周/月 同时展示,day_1_show 次天/周/月 同时展示,day_2_show 第2天/周/月 同时展示 …
day_N_loss 流失数 String 分析类型为 流失 有该字段,第n天流失数,窗口时长有几天/周/月就有多少个属性 例如:day_0_loss 当天/周/月流失数,day_1_loss 次天/周/月流失数,day_2_loss 第2天/周/月流失数…
day_N_loss_percent 流失率 String 分析类型为 流失 有该字段,第n天流失率 例如:day_0_loss_percent 当天/周/月流失流失率,day_1_loss_percent 次天/周/月流失率,day_2_loss_percent 第2天/周/月流失率 …
event.xxx.xxx 事件属性分组字段 String 有分组项时存在,例如:event.H_pageview.H_app_version
users.xxx 用户属性分组字段 String 有分组项时存在,例如:users.user_name
catalog_tag.xxx 用户标签分组字段 String 有分组项时存在,例如:catalog_tag.feature_20220112_147
catalog_cluster.xxx 用户分群分组字段 String 有分组项时存在,例如:catalog_cluster.cluster_20220124_746

留存

{
    "status": 200,
    "code": "0",
    "message": "操作成功",
    "success": true,
    "data": {
        "result": [
            {
                "pk_day": "2024-12-05",
                "userscnt": 1,
                "bins": "无分组项限制汇总",
                "day_1": 1,
                "day_2": 1,
                "day_3": 1,
                "day_4": 1,
                "day_5": 1,
                "day_6": 1,
                "day_7": 1,
                "day_1_percent": 1,
                "day_2_percent": 1,
                "day_3_percent": 1,
                "day_4_percent": 1,
                "day_5_percent": 1,
                "day_6_percent": 1,
                "day_7_percent": 1,
                "users.H_city": "无分组项限制汇总",
                "event.H_pageview.event": "无分组项限制汇总",
                "event.any_event.H_app_version": "无分组项限制汇总",
                "catalog_tag.feature_20241210_002": "无分组项限制汇总",
                "catalog_cluster.cluster_20241202_888": "无分组项限制汇总"
            },
            {
                "pk_day": "2024-12-05",
                "userscnt": 1,
                "bins": "H_pageview,(null),(null),不属于分群_20241202_888,(null)",
                "day_1": 1,
                "day_2": 1,
                "day_3": 1,
                "day_4": 1,
                "day_5": 1,
                "day_6": 1,
                "day_7": 1,
                "day_1_percent": 1,
                "day_2_percent": 1,
                "day_3_percent": 1,
                "day_4_percent": 1,
                "day_5_percent": 1,
                "day_6_percent": 1,
                "day_7_percent": 1,
                "users.H_city": "(null)",
                "event.H_pageview.event": "H_pageview",
                "event.any_event.H_app_version": "(null)",
                "catalog_tag.feature_20241210_002": "(null)",
                "catalog_cluster.cluster_20241202_888": "不属于分群_20241202_888"
            }
        ],
        "windowsGap": 7,
        "windowsGapTu": "day",
        "target": "retention"
    }
}

留存-同时展示

{
    "status": 200,
    "code": "0",
    "message": "操作成功",
    "success": true,
    "data": {
        "result": [
            {
                "pk_day": "2024-12-05",
                "userscnt": 1,
                "bins": "H_pageview,(null),(null),不属于分群_20241202_888,(null)",
                "day_0": 0,
                "day_1": 0,
                "day_2": 0,
                "day_3": 0,
                "day_4": 0,
                "day_5": 0,
                "day_6": 0,
                "day_7": 0,
                "day_0_percent": 0,
                "day_1_percent": 0,
                "day_2_percent": 0,
                "day_3_percent": 0,
                "day_4_percent": 1,
                "day_5_percent": 0,
                "day_6_percent": 0,
                "day_7_percent": 0,
                "day_0_show": 0,
                "day_1_show": 0,
                "day_2_show": 0,
                "day_3_show": 0,
                "day_4_show": 2,
                "day_5_show": 0,
                "day_6_show": 0,
                "day_7_show": 0,
                "users.H_city": "(null)",
                "event.any_event.H_app_version": "(null)",
                "event.H_pageview.event": "H_pageview",
                "catalog_cluster.cluster_20241202_888": "不属于分群_20241202_888",
                "catalog_tag.feature_20241210_002": "(null)"
            },
            {
                "pk_day": "总体",
                "userscnt": 1,
                "bins": "无分组项限制汇总",
                "day_0": 0,
                "day_1": 0,
                "day_2": 1,
                "day_3": 0,
                "day_4": 0,
                "day_5": 0,
                "day_6": 0,
                "day_7": 0,
                "day_0_percent": 0,
                "day_1_percent": 0,
                "day_2_percent": 0,
                "day_3_percent": 0,
                "day_4_percent": 1,
                "day_5_percent": 0,
                "day_6_percent": 0,
                "day_7_percent": 0,
                "day_0_show": 0,
                "day_1_show": 0,
                "day_2_show": 0,
                "day_3_show": 0,
                "day_4_show": 0,
                "day_5_show": 0,
                "day_6_show": 0,
                "day_7_show": 0,
                "users.H_city": "无分组项限制汇总",
                "event.any_event.H_app_version": "无分组项限制汇总",
                "event.H_pageview.event": "无分组项限制汇总",
                "catalog_cluster.cluster_20241202_888": "无分组项限制汇总",
                "catalog_tag.feature_20241210_002": "无分组项限制汇总"
            }
        ],
        "windowsGap": 7,
        "windowsGapTu": "day",
        "target": "retention"
    }
}

流失

{
    "status": 200,
    "code": "0",
    "message": "操作成功",
    "success": true,
    "data": {
        "result": [
            {
                "pk_day": "2024-12-05",
                "userscnt": 1,
                "bins": "无分组项限制汇总",
                "day_1_loss": 1,
                "day_2_loss": 1,
                "day_3_loss": 1,
                "day_4_loss": 1,
                "day_5_loss": 1,
                "day_6_loss": 1,
                "day_7_loss": 1,
                "day_1_loss_percent": 1,
                "day_2_loss_percent": 1,
                "day_3_loss_percent": 1,
                "day_4_loss_percent": 1,
                "day_5_loss_percent": 1,
                "day_6_loss_percent": 1,
                "day_7_loss_percent": 1,
                "users.H_city": "无分组项限制汇总",
                "event.H_pageview.event": "无分组项限制汇总",
                "event.any_event.H_app_version": "无分组项限制汇总",
                "catalog_tag.feature_20241210_002": "无分组项限制汇总",
                "catalog_cluster.cluster_20241202_888": "无分组项限制汇总"
            },
            {
                "pk_day": "2024-12-05",
                "userscnt": 1,
                "bins": "H_pageview,(null),(null),不属于分群_20241202_888,(null)",
                "day_1_loss": 1,
                "day_2_loss": 1,
                "day_3_loss": 1,
                "day_4_loss": 1,
                "day_5_loss": 1,
                "day_6_loss": 1,
                "day_7_loss": 1,
                "day_1_loss_percent": 1,
                "day_2_loss_percent": 1,
                "day_3_loss_percent": 1,
                "day_4_loss_percent": 1,
                "day_5_loss_percent": 1,
                "day_6_loss_percent": 1,
                "day_7_loss_percent": 1,
                "users.H_city": "(null)",
                "event.H_pageview.event": "H_pageview",
                "event.any_event.H_app_version": "(null)",
                "catalog_tag.feature_20241210_002": "(null)",
                "catalog_cluster.cluster_20241202_888": "不属于分群_20241202_888"
            }
        ],
        "windowsGap": 7,
        "windowsGapTu": "day",
        "target": "loss"
    }
}

三、错误码

接口响应状态码 接口响应状态码描述 业务响应编码 业务响应编码描述
200 成功 0 成功
5001 业务异常 API_KEY_EXPIRED API_KEY已过期
5001 业务异常 NOT_IN_IP_WHITE_LIST IP白名单限制
5001 业务异常 API_KEY_NOT_EXISTED API_KEY不存在
5001 业务异常 BOOKMARK_RELY_ON_STATUS_ERROR 书签状态异常
5001 业务异常 BOOKMARK_TYPE_ERROR 书签类型异常
6001 参数验证异常 PARAM_VERIFY_FAIL 参数验证失败
{
    "status": 5001,
    "code": "NOT_IN_IP_WHITE_LIST",
    "message": "IP白名单限制 [172.23.7.64]",
    "success": false,
    "data": null
}
作者:梁松竹  创建时间:2024-12-10 13:34
最后编辑:梁松竹  更新时间:2024-12-27 11:29