[关闭]
@fuyb1986 2016-05-09T07:31:02.000000Z 字数 1483 阅读 606

活动接口文档 -- 获取帖子下的回帖或单个回帖

好热闹 活动


获取活动里的帖子列表


只有加入活动的用户才能看到回帖
接口有 5 分钟的缓存

Method and URL Structure

Method Resource URL NOTE
GET /activity/${page}/${topic_id}/posts/ 每页 10 条

Request Parameters

Name Description Required Default
username 用户名 YES
password 密码 YES

cURL Example

  1. # ID 为 1395 的帖子里所有回帖的第 3 页
  2. $ curl http://www.haorenao.cn/activity/3/1395/posts/?username=18012345678&password=123456

JSON Response

Name Description NOTE
ret 标识是否成功。 @Depracted
reason 失败原因 @Depracted
status[1] Status Code
message Failure Message
posts 回帖 Post
  1. {
  2. "ret": "ok",
  3. "reason": "",
  4. "status": 0,
  5. "message": "",
  6. "posts": [{
  7. "id": 1,
  8. "username": "1234567890",
  9. "nickname": "\u5c0f\u4e8c",
  10. "content": "What you need to do is decide when and how those token objects should be",
  11. "create_time": "2016-04-01 15:23:11",
  12. "pictures":["resource.haorenao.cn/pic1.jpg",],
  13. }...],
  14. }

获取单个帖子


只有加入活动的用户才能看到回帖
接口有 5 分钟的缓存

Method and URL Structure

Method Resource URL
GET /activity/${post_id}/post/

Request Parameters

Name Description Required Default
username 用户名 YES
password 密码 YES

cURL Example

  1. # ID 为 2373 的回帖
  2. $ curl http://www.haorenao.cn/activity/2373/post/username=180123456&password=123456

JSON Response

Name Description NOTE
ret 标识是否成功。 @Depracted
reason 失败原因 @Depracted
status Status Code
message Failure Message
post 回帖

Post

Name Description NOTE
id Post ID
username 用户名
nickname 昵称
content 内容
create_time 回帖时间
  1. {
  2. "ret": "ok",
  3. "reason": "",
  4. "status": 0,
  5. "message": "",
  6. "post": {
  7. "id": 2373,
  8. "username": "12345678",
  9. "create_time": "2016-04-01 15:23:11",
  10. "nickname": "\u5c0f\u4e8c",
  11. "content": "What you need to users? Or only when they specifically request one?",
  12. "pictures":["resource.haorenao.cn/pic1.jpg",],
  13. },
  14. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注