# 1.2.1 查询用户积分总额

通过改接口查询用户积分总额

请求方式:GET

请求地址:{API_HOST}/api/v1/open/swan/integral/points

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_staff1:im.finogeeks.com"

响应Body:

{
    "userId": "@staff_staff1:im.finogeeks.com",
    "balance": 200, //总积分值
    "createdAt": 1604844904000, //毫秒时间戳
    "updatedAt": 1604931304000 //毫秒时间戳
}

# 1.2.2 查询用户的总积分和流水明细

通过该接口,返回用户的总积分和流水明细,改接口包含总积分和流水明细,建议使用单独的查询总积分和查询流水的接口

请求方式:GET

请求地址:{API_HOST}/api/v1/open/swan/integral/points/transaction/mine

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_staff1:im.finogeeks.com"

请求参数说明

参数 类型 是否必须 说明 默认值
type Int 需要删除的员工fcidl列表,该删除操作是软删除
startTime Long 开始时间,毫秒时间戳
endTime Long 结束时间,startTime和endTime都是空,表示长期有效
page Int page 从0开始,默认0 0
size Int size,默认20 20

响应Body:

{
    "staffId": "@staff_staff1:000000.finogeeks.com",
    "transaction": {
        "content": [
            {
                "id": 24,
                "tid": "000000.finogeeks.com",
                "mid": "M00000",
                "createAt": 1607044791746,
                "updateAt": 1607044791747,
                "userId": "@staff_staff1:000000.finogeeks.com",
                "type": "RETAIL_LIKE",
                "detailId": 24,
                "points": 12,
                "info": "客户点赞观点 获得积分"
            },
            {
                "id": 23,
                "tid": "000000.finogeeks.com",
                "mid": "M00000",
                "createAt": 1607044791730,
                "updateAt": 1607044791734,
                "userId": "@staff_staff1:000000.finogeeks.com",
                "type": "RETAIL_VIEW_TIMELINE",
                "detailId": 23,
                "points": 12,
                "info": "客户浏览观点 获得积分"
            }
        ],
        "page": 0,
        "size": 20,
        "total": 2
    },
    "balance": 24,
    "oneMonthExpired": 0
}

# 1.2.3 分页查询用户积分流水明细

通过该接口,可以获取用户的积分流水明细,根据时间倒排分页

请求方式:GET

请求地址:{API_HOST}/api/v1/open/swan/integral/points/transaction

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_staff1:im.finogeeks.com"

请求参数说明

参数 类型 是否必须 说明 默认值
startTime Long 开始时间,毫秒时间戳
endTime Long 结束时间,startTime和endTime都是空,表示长期有效
page Int page 从0开始,默认0 0
size Int size,默认20 20

响应Body:

{
    "transaction": [
      "points": "2",
      "userId": "@staff_staff1:im.finogeeks.com",
      "detailId": "aaabbbbbcccc",
      "createdAt": 1606889327579,
      "type": "RetailLike",
      "info": "积分获取信息描述"
    ],
    "size": 10,
    "total": 1
}

# 1.2.4 增加或兑换扣减用户积分

通过该接口,可以给用户增加或者进行积分兑换扣减

请求方式:POST

请求地址:{API_HOST}/api/v1/open/swan/integral/points

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_staff1:im.finogeeks.com"

请求Body参数说明:

参数 类型 是否必须 说明 默认值
transactionId string 交易流水id
userId string 结束时间,startTime和endTime都是空,表示长期有效
point Int page 从0开始,默认0 0
type string size,默认20 20
info string

请求Body示例:

{
    "transactionId": "1111-xxxxe-111122",
    "userId": "@staff_staff1:im.finogeeks.com",
    "point": 2,
    "type": "积分类型",
    "info": "积分获得信息描述"
}

响应返回示例:

status 200
{}

# 1.2.5 积分事件的上报

积分事件的上报,用户可以上报管理后台配置的事件类型,会根据对应的积分规则触发对应的积分;

请求方式:POST

请求地址:{API_HOST}/api/v1/open/swan/integral/points/report

请求头部:

key value
Content-Type application/json
X-Consumer-Custom-ID "@staff_staff1:im.finogeeks.com"

请求body参数说明:

参数 类型 是否必须 说明 默认值
type string 积分事件类型
userId string 用户id,投顾上报就是b端用户id,c端用户上报就是c端用户id
staffId string 投顾的id
operationId string 操作id,保证每次上报的唯一即可,用于去重

返回值示例:

{
    "type": "VIEW_STUDIO",
    "userId": "@retail_1234442:im.finogeeks.com",
    "staffId": "@staff_staff1:im.finogeeks.com",
    "operationId": "8c614374-7fce-46e4-90d7-ec9e094b6f96"
}

响应返回示例:

status 200
{}