查询主题接口[单条]

  • 接口说明: 查询主题接口[单条]
  • 接口地址: /api/threads/{id}
  • 请求方式: GET

请求参数

参数名称类型是否必须描述
includestring关联数据

include 可关联的数据

关联名称模型类型是否默认描述
userusersobject主题作者
firstPostpostsobject首帖
threadVideothread-videoobject视频
firstPost.imagesattachmentsarray首贴图片
firstPost.attachmentsattachmentsarray首贴附件
postspostsarray回复列表
posts.userusersobject回复的作者
posts.threadthreadsobject回复所在的主题即当前主题
posts.imagesattachmentsarray回复的图片
user.groupsgroupsobject用户所在群组
categorycategoriesobject主题分类
firstPost.likedUsersusersarray点赞首贴的用户
posts.likedUsersusersarray点赞回复的用户
rewardedUsersusersarray打赏主题的用户
paidUsersusersarray付费主题的已购用户
firstPost.mentionUsersusersarray主题@用户
posts.mentionUsersusersarray回复@用户
user.groups.permissionWithoutCategoriespermissionarray查询用户除了分类的权限列表
questionquestionobject查询问答信息
question.beUserquestionobject查询被提问人用户信息
question.imagesquestionarray查询回答的图片内容
onlookersusersarray查询围观人

请求示例

返回说明

  • 成功,http 状态码: 200
  • 失败,http 状态码: 404

返回结果

关联数据模型字段释义参见请参见相应文档

参数名称类型出现要求描述
dataobject基础数据
typestring数据类型
idint数据 id
attributesobject数据属性
typeint文章类型(0 普通 1 长文 2 视频)
titlestring长文主题标题
pricefloat长文主题主题价格
attachment_pricefloat附件价格
viewCountint查看数
postCountint帖子数
paidCountint付费数
rewardedCountint打赏数
createdAtdatetime创建时间
updatedAtdatetime修改时间
deletedAtdatetime在回收站时删除时间
isApprovedbool是否合法(0/1/2)
0 不合法
1 正常
2 忽略
isStickybool是否置顶
isEssencebool是否加精
isFavoritebool已收藏时是否收藏
isSitebool是否推荐到站点信息页
paidbool付费主题是否付费
isPaidAttachmentbool付费附件附件是否付费
canViewPostsbool是否有权查看详情
canReplybool是否有权回复
canApprovebool是否有权审核
canStickybool是否有权置顶
canEssencebool是否有权加精
canDeletebool是否有权永久删除
canHidebool是否有权放入回收站
canFavoritebool是否有权收藏
relationshipsobject关联关系
thread-video. statusint视频状态 0:转码中 1 转码完成 2 转码失败
thread-video. reasonstring转码失败原因
thread-video. file_namestring视频文件名称
thread-video. file_idstring媒体文件唯一标识
thread-video. media_urlstring媒体播放地址
thread-video. cover_urlstring媒体封面地址
includedobject关联数据
question_answer.be_user_idint回答人的用户ID
question_answer.contentstring回答的内容
question_answer.content_htmlstring回答的html 内容
question_answer.ipstring回答人的IP
question_answer.portint回答人的端口
question_answer.pricefloat问答单价
question_answer.onlooker_unit_pricefloat围观单价
question_answer.onlooker_pricefloat围观总价格
question_answer.onlooker_numberint围观总人数
question_answer.is_onlookerbool是否允许围观 true允许 false不允许
question_answer.is_answerint是否已回答 0未回答 1已回答 2已过期
question_answer.expired_atstring问答过期时间

返回示例

  1. {
  2. "data": {
  3. "type": "threads",
  4. "id": "25",
  5. "attributes": {
  6. "type": 2,
  7. "title": "",
  8. "price": "0.00",
  9. "attachment_price": "0.00",
  10. "viewCount": 1,
  11. "postCount": 1,
  12. "createdAt": "2020-03-10T16:31:54+08:00",
  13. "updatedAt": "2020-03-10T16:31:54+08:00",
  14. "isApproved": 1,
  15. "isSticky": false,
  16. "isEssence": false,
  17. "canViewPosts": true,
  18. "canReply": false,
  19. "canApprove": false,
  20. "canSticky": false,
  21. "canEssence": false,
  22. "canDelete": false,
  23. "canHide": false,
  24. "canFavorite": false
  25. },
  26. "relationships": {
  27. "user": {
  28. "data": {
  29. "type": "users",
  30. "id": "3"
  31. }
  32. },
  33. "firstPost": {
  34. "data": {
  35. "type": "posts",
  36. "id": "23"
  37. }
  38. },
  39. "threadVideo": {
  40. "data": {
  41. "type": "thread-video",
  42. "id": "18"
  43. }
  44. },
  45. "posts": {
  46. "data": []
  47. }
  48. }
  49. },
  50. "included": [
  51. {
  52. "type": "users",
  53. "id": "3",
  54. "attributes": {
  55. "id": 3,
  56. "username": "username",
  57. "avatarUrl": "",
  58. "threadCount": 19,
  59. "followCount": 0,
  60. "fansCount": 0,
  61. "follow": null,
  62. "status": 0,
  63. "loginAt": "2020-03-10T11:20:42+08:00",
  64. "joinedAt": "2020-03-09T16:39:28+08:00",
  65. "expiredAt": null,
  66. "createdAt": "2020-03-09T16:39:28+08:00",
  67. "updatedAt": "2020-03-10T17:03:44+08:00",
  68. "canEdit": false,
  69. "canDelete": false,
  70. "registerReason": "",
  71. "banReason": ""
  72. }
  73. },
  74. {
  75. "type": "posts",
  76. "id": "23",
  77. "attributes": {
  78. "replyUserId": null,
  79. "content": "abc",
  80. "contentHtml": "abc",
  81. "replyCount": 0,
  82. "likeCount": 0,
  83. "createdAt": "2020-03-10T16:31:54+08:00",
  84. "updatedAt": "2020-03-10T16:31:54+08:00",
  85. "isFirst": true,
  86. "isApproved": 1,
  87. "canEdit": false,
  88. "canApprove": false,
  89. "canDelete": false,
  90. "canHide": false,
  91. "canLike": false
  92. },
  93. "relationships": {
  94. "images": {
  95. "data": []
  96. },
  97. "attachments": {
  98. "data": []
  99. }
  100. }
  101. },
  102. {
  103. "type": "thread-video",
  104. "id": "18",
  105. "attributes": {
  106. "id": 18,
  107. "user_id": 3,
  108. "thread_id": 25,
  109. "status": 1,
  110. "reason": "source file err: file info lack width, height or color space",
  111. "file_name": "666",
  112. "file_id": "666",
  113. "media_url": "url",
  114. "cover_url": "url",
  115. "updated_at": "2020-03-10T18:26:31+08:00",
  116. "created_at": "2020-03-10T16:31:54+08:00"
  117. }
  118. }
  119. ]
  120. }