接口简介

  • 本接口主要用于获取红包列表
  • 本接口支持page分页

重要说明:…

接口请求说明

请求方式

GET https://站点接口域名/openapi/packages

请求参数

参数名 类型 是否必须 说明
source int 红包来源类型:0 默认(帖子,本地圈), 1 帖子,2 本地圈
page int 页码 (默认1)
per-page int 每页返回数据条数,默认为20,配合page使用

当使用page进行分页时,我们还会在响应头中返回额外的分页基础数据:

  • X-Pagination-Current-Page 指示当前返回的是第几页的数据
  • X-Pagination-Per-Page 指示每页数据的条数
  • X-Pagination-Page-Count 指示总页数
  • X-Pagination-Total-Count 指示信息流总条数

请求示例

# GET请求
curl -X GET \
  'https://站点接口域名/openapi/packages?source=0&page=1&per-page=10' \
  -H 'authorization: Bearer 5d54b53a9f9bd' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

接口响应说明

响应示例

{
    "code": 0,
    "text": "",
    "data": [
        {
            "id": 19389,
            "sourceid": 203452,
            "source": 1,
            "uid": 24,
            "type": 1,
            "sum": "1.00",
            "num": 1,
            "curr": 1,
            "msg": "感谢分享!",
            "status": 3,
            "created_at": "2019-08-07 09:27:36"
        },
        {
            "id": 18764,
            "sourceid": 2780,
            "source": 1,
            "uid": 206,
            "type": 1,
            "sum": "0.01",
            "num": 1,
            "curr": 1,
            "msg": "感谢分享!",
            "status": 3,
            "created_at": "2019-06-24 09:27:37"
        },
        {
            "id": 18763,
            "sourceid": 184196,
            "source": 1,
            "uid": 1078,
            "type": 1,
            "sum": "0.01",
            "num": 1,
            "curr": 0,
            "msg": "感谢分享!",
            "status": 0,
            "created_at": "2019-06-24 09:26:54"
        },
        {
            "id": 18652,
            "sourceid": 6829,
            "source": 2,
            "uid": 1228,
            "type": 1,
            "sum": "500.00",
            "num": 10,
            "curr": 2,
            "msg": "感谢分享!",
            "status": 4,
            "created_at": "2019-06-18 15:28:36"
        },
        {
            "id": 18413,
            "sourceid": 6820,
            "source": 2,
            "uid": 4,
            "type": 1,
            "sum": "10.00",
            "num": 50,
            "curr": 0,
            "msg": "感谢分享!",
            "status": 4,
            "created_at": "2019-05-30 16:05:32"
        },
        {
            "id": 18410,
            "sourceid": 6819,
            "source": 2,
            "uid": 4,
            "type": 1,
            "sum": "100.00",
            "num": 10,
            "curr": 0,
            "msg": "感谢分享!",
            "status": 0,
            "created_at": "2019-05-30 15:58:41"
        },
        {
            "id": 18186,
            "sourceid": 6809,
            "source": 2,
            "uid": 1228,
            "type": 1,
            "sum": "10.00",
            "num": 10,
            "curr": 1,
            "msg": "感谢分享!",
            "status": 4,
            "created_at": "2019-05-15 16:58:28"
        },
        {
            "id": 18185,
            "sourceid": 184264,
            "source": 1,
            "uid": 1228,
            "type": 1,
            "sum": "5.00",
            "num": 5,
            "curr": 0,
            "msg": "感谢分享!",
            "status": 4,
            "created_at": "2019-05-15 16:55:19"
        },
        {
            "id": 17373,
            "sourceid": 184186,
            "source": 1,
            "uid": 127,
            "type": 1,
            "sum": "1.00",
            "num": 5,
            "curr": 1,
            "msg": "感谢分享!",
            "status": 4,
            "created_at": "2019-03-19 16:26:58"
        },
        {
            "id": 17176,
            "sourceid": 6724,
            "source": 2,
            "uid": 127,
            "type": 1,
            "sum": "0.10",
            "num": 1,
            "curr": 1,
            "msg": "感谢分享!",
            "status": 3,
            "created_at": "2019-03-11 09:57:41"
        }
    ],
    "time": 1565948178
}

响应结果说明

字段名 类型 说明
id int 红包id
sourceid int 帖子或本地圈id
source int 红包来源 帖子 1 ,本地圈 2
uid int 发红包的用户id
type int 红包类型 0 普通红包 1 拼手气红包
sum string 红包总额
num int 红包总量
curr int 红包当前已抢数量
msg string 红包寄语
status string 红包状态 1 可抢 3 已抢完 4 已过期
create_at string 创建时间
文档更新时间: 2019-12-05 10:10   作者:漫漫