Plus (ThinkSNS+)

Plus (ThinkSNS+)

  • 文档 [New]
  • 文档
  • REST API v2
  • 反馈
  • GitHub

›圈子

基本

  • 概述
  • 启动信息
  • Json Web Token 授权
  • 验证码
  • 位置
  • 标签
  • 消息通知
  • 钱包(旧版本)
  • Plus Pay(新钱包-支付工具)
  • 支付能力
  • 文件
  • 关于我们
  • 广告
  • 举报
  • 积分
  • 环信
  • 评论
  • 文件存储

用户

  • 用户
  • 注册
  • 收到的评论
  • 收到的喜欢
  • 关注
  • 标签
  • 身份认证
  • 找人
  • 排行榜
  • 反馈
  • 打赏用户
  • 未读消息
  • 签到
  • 消息

动态

  • 发布动态
  • 获取动态
  • 删除动态
  • 设置评论收费
  • 评论
  • 喜欢
  • 收藏
  • 置顶
  • 打赏
  • 排行榜
  • 举报
  • 积分部分新增接口
  • 话题

音乐

  • 音乐
  • 专辑
  • 点赞
  • 评论
  • 收藏

问答

  • 概述
  • 话题
  • 问题
  • 评论
  • 回答
  • 回答 · 打赏
  • 回答 · 围观
  • 用户 · 关注问题
  • 用户 · 喜欢回答
  • 用户 · 收藏回答
  • 用户 · 申请精选
  • 排行榜
  • 举报
  • 问答部分积分相关新增接口

资讯

  • 概述
  • 分类
  • 投稿
  • 获取
  • 评论
  • 喜欢
  • 打赏
  • 置顶
  • 收藏
  • 排行榜
  • 举报
  • 资讯部分积分相关新增接口

圈子

  • 概述
  • 分类
  • 圈子
  • 圈子 · 管理
  • 圈子 · 举报
  • 圈子 · 成员
  • 帖子
  • 帖子 · 评论
  • 帖子 · 喜欢
  • 帖子 · 收藏
  • 帖子 · 打赏
  • 帖子 · 置顶
  • 圈子部分积分相关新增接口
Edit

帖子

  • 圈子帖子列表
  • 圈子帖子详情
  • 圈子帖子创建
  • 圈子帖子更新
  • 圈子帖子删除
  • 我的帖子列表
  • 全部帖子列表包含搜索

圈子帖子列表

GET /groups/:group/posts

响应

status 200

参数说明

名称类型说明
typestring默认:latest_post, latest_post 最新帖子,latest_reply最新回复
limitinteger默认 15 ,数据返回条数 默认为15
offsetinteger默认 0 ,数据偏移量,传递之前通过接口获取的总数。
excellentany可选,不传递,表示获取全部帖子,传递 1 表示获取精华帖子。
[
    {
        "id": 88,
        "group_id": 1,
        "user_id": 1,
        "title": "内容标题",
        "summary": "帖子介绍",
        "likes_count": 0,
        "comments_count": 0,
        "views_count": 0,
        "liked":true,
        "collected":true,
        "created_at": "2017-11-28 07:12:20",
        "updated_at": "2017-11-28 07:12:20",
        "excellent_at": "2018-08-22T06:27:15Z", // 如果存在,则表示精华
        "images": [
            {
                "id": 113,
                "size": "397x246"
            },
            {
                "id": 115,
                "size": "397x246"
            }
        ],
        "user": {
            "id": 1,
            "name": "admin",
            "bio": null,
            "sex": 2,
            "location": "四川省 巴中市 南江县",
            "created_at": "2017-10-23 01:17:34",
            "updated_at": "2017-11-15 07:36:17",
            "avatar": "http://thinksns-plus.dev/api/v2/users/1/avatar",
            "bg": null,
            "verified": {
                "type": "user",
                "icon": "http://thinksns-plus.dev/storage/certifications/000/000/0us/er.png",
                "description": "1111"
            },
            "extra": {
                "user_id": 1,
                "likes_count": 5,
                "comments_count": 3,
                "followers_count": 0,
                "followings_count": 6,
                "updated_at": "2017-11-27 07:25:04",
                "feeds_count": 8,
                "questions_count": 2,
                "answers_count": 0,
                "checkin_count": 7,
                "last_checkin_count": 1
            }
        }
    }
]

返回参数说明

名称类型说明
gourp_idint所属圈子
user_idint发布者
titlestring标题
summarystring列表专用字段,概述,简短内容
likes_countint喜欢数量统计
comments_countint评论数量统计
views_countint查看数量统计
collectedbool是否收藏true or false
likedbool是否点赞true or false
imagesarray附件

圈子帖子详情

GET /groups/:group/posts/:post

响应

status 200
{
    "id": 81,
    "group_id": 1,
    "user_id": 1,
    "title": "这是帖11",
    "body": "这是帖子",
    "summary": "",
    "likes_count": 0,
    "comments_count": 0,
    "views_count": 0,
    "created_at": "2017-11-28 06:46:02",
    "updated_at": "2017-11-28 07:16:46",
    "excellent_at": "2018-08-22T06:27:15Z", // 如果存在,则表示精华
    "liked": false,
    "collected": false,
    "reward_amount": 0,
    "reward_number": 0,
    "group": {
        "id": 1,
        "name": "哈哈哈",
        "user_id": 1,
        "category_id": 1,
        "location": null,
        "longitude": null,
        "latitude": null,
        "geo_hash": null,
        "allow_feed": 0,
        "mode": "public",
        "money": 0,
        "summary": "简介\n",
        "notice": "这是公告",
        "users_count": 1,
        "posts_count": 47,
        "audit": 1,
        "created_at": null,
        "updated_at": "2017-11-28 07:12:20"
    },
    "user": {
        "id": 1,
        "name": "admin",
        "bio": null,
        "sex": 2,
        "location": "四川省 巴中市 南江县",
        "created_at": "2017-10-23 01:17:34",
        "updated_at": "2017-11-15 07:36:17",
        "avatar": "http://thinksns-plus.dev/api/v2/users/1/avatar",
        "bg": null,
        "verified": {
            "type": "user",
            "icon": "http://thinksns-plus.dev/storage/certifications/000/000/0us/er.png",
            "description": "1111"
        },
        "extra": {
            "user_id": 1,
            "likes_count": 5,
            "comments_count": 3,
            "followers_count": 0,
            "followings_count": 6,
            "updated_at": "2017-11-27 07:25:04",
            "feeds_count": 8,
            "questions_count": 2,
            "answers_count": 0,
            "checkin_count": 7,
            "last_checkin_count": 1
        }
    }
}

返回参数说明

名称类型说明
gourp_idint所属圈子
user_idint发布者
titlestring标题
bodystringmarkdown 内容
summarystring列表专用字段,概述,简短内容
likes_countint喜欢数量统计
comments_countint评论数量统计
views_countint查看数量统计
reward_amountint打赏金额统计
reward_numberint打赏人数统计
collectedbool是否收藏true or false
likedbool是否点赞true or false

圈子帖子创建

参数说明

POST /groups/:group/posts
名称类型说明
titleint必须 帖子标题
bodyint必须 帖子内容
summarystring必须 允许为空 列表专用字段,概述,简短内容
imagesarray文件id,例如[1,2,3],当summay为空时必须传
sync_feedint同步至动态,同步需要传sync_feed = 1
feed_fromint设备标示 同步动态需要传 1:pc 2:h5 3:ios 4:android 5:其他

响应

status 201
{
    "message": "操作成功",
    "post": {
        "title": "这是帖11",
        "body": "这是帖子",
        "summary": "12321321",
        "user_id": 1,
        "group_id": 1,
        "updated_at": "2017-11-28 09:45:17",
        "created_at": "2017-11-28 09:45:17",
        "id": 121
    }
}

圈子帖子更新

参数说明

PUT /groups/:group/posts/:post
名称类型说明
titleint必须 帖子标题
bodyint必须 帖子内容
summarystring必须 允许为空 列表专用字段,概述,简短内容
imagesarray文件id,例如[1,2,3],当summay为空时必须传
sync_feedint同步至动态,同步需要传sync_feed = 1
feed_fromint设备标示 同步动态需要传 1:pc 2:h5 3:ios 4:android 5:其他

响应

status 201
{
    "message": "操作成功",
    "post": {
        "title": "这是帖11",
        "body": "这是帖子",
        "summary": "12321321",
        "user_id": 1,
        "group_id": 1,
        "updated_at": "2017-11-28 09:45:17",
        "created_at": "2017-11-28 09:45:17",
        "id": 121
    }
}

圈子帖子删除

DELETE /groups/:group/posts/:post

响应

status 204 No Content

我的帖子列表

GET /user-group-posts

参数说明

名称类型说明
typestring默认:1 , 1-发布的 2- 已置顶 3-置顶待审
limitinteger默认 15 ,数据返回条数 默认为15
offsetinteger默认 0 ,数据偏移量,传递之前通过接口获取的总数。

响应

status 200

全部帖子列表包含搜索

GET /group-posts

参数说明

名称类型说明
keywordstring搜索关键词,模糊匹配圈子名称
group_idinteger获取某个圈子下面的全部帖子
limitinteger默认 15 ,数据返回条数 默认为15
offsetinteger默认 0 ,数据偏移量,传递之前通过接口获取的总数。

响应

status 200

批量获取帖子简单数据

GET /group/simple-posts

请求查询参数:

名称类型描述
idstring需要获取的帖子 ID, 多个使用半角 , 进行分割

响应:

Status: 200 OK
[
    {
        "id": 1,              // 帖子 ID
        "group_id": 1,        // 所属圈子 ID
        "title": "帖子标题",   // 帖子标题
        "summary": "帖子内容", // 帖子列表语言内容数据
        "image": 1,           // 图片 ID
    }
]

设置帖子精华

帖子取消精华

PUT /api/v2/group/posts/:postId/toggle-excellent

变量:

| 变量 | 描述 | | postId | 帖子 ID。|

响应:

Status: 204 No Content

预览帖子列表接口

这个接口用于用户未加入圈子时展示

GET group/groups/:groupId/preview-posts

变量:

变量描述
groupId圈子 ID

响应:

Status: 200 OK
[
    {
        "id": 1,                                // 帖子 ID
        "group_id": 1,                          // 所属圈子 ID
        "user_id": 1,                           // 帖子发布者
        "title": "haha",                        // 帖子标题
        "summary": "1",                         // 列表描述内容
        "likes_count": 0,                       // 点赞量
        "comments_count": 0,                    // 帖子评论量
        "views_count": 0,                       // 帖子阅读量
        "created_at": "2018-08-22T06:27:15Z",   // 帖子发布时间
        "excellent_at": "2018-08-22T06:27:15Z", // 如果存在,则表示精华
        "images": [
            {
                "id": 1,
                "size": "160x160"
            }
        ],
        "comments": []                           // 参考评论资源返回(服用的代码,批量获取评论接口返回结构)
    }
]
← 圈子 · 成员帖子 · 评论 →
  • 圈子帖子列表
    • 响应
    • 参数说明
    • 返回参数说明
  • 圈子帖子详情
    • 响应
    • 返回参数说明
  • 圈子帖子创建
    • 参数说明
    • 响应
  • 圈子帖子更新
    • 参数说明
    • 响应
  • 圈子帖子删除
    • 响应
  • 我的帖子列表
    • 参数说明
    • 响应
  • 全部帖子列表包含搜索
    • 参数说明
    • 响应
  • 批量获取帖子简单数据
  • 设置帖子精华
  • 帖子取消精华
  • 预览帖子列表接口
Plus (ThinkSNS+)
More
GitHubStar
Copyright © 2019 Chengdu ZhiYiChuangXiang Technology Co., Ltd. All rights reserved.