跳到主要内容

列出社区的帖子

GET/v1/communities/{id}/posts

返回社区的帖子,支持排序和筛选,或返回与搜索匹配的帖子。

请求

Shell
curl -g "https://api.nogitsu.com/v1/communities/{id}/posts"

参数

  • id

    路径必填

    条目的 ID,为 UUID。

    文本

  • sort

    查询可选

    结果的排序方式。

    文本

    允许的值hotnewtoprising

    默认值:hot

  • period

    查询可选

    最佳排序的时间范围。

    文本

    允许的值dayweekmonthyearall

    默认值:week

  • cursor

    查询可选

    上一页的 nextCursor 值。读取第一页时省略。

    文本

  • limit

    查询可选

    每页返回的条目数。

    整数

    1 到 25默认值:25

  • flairId

    查询可选

    仅限带有此标签的帖子。

    文本 (uuid)

  • filter

    查询可选

    media 表示图片帖,units 表示关于某一话的帖子。

    文本

    允许的值mediaunits
  • q

    查询可选

    要搜索的文本。

    文本

响应

请求成功时返回 200 和以下 JSON:

  • items对象 列表
    • id文本 (uuid)
    • slug文本
    • community对象
      • id文本 (uuid)
      • slug文本
      • language文本
      • kind文本
        允许的值workboarduser
      • name文本
      • iconUrl文本 (uri)可为 null
      • theme文本
        允许的值violetblueskycyanemeraldgreenyellowamberrosepink
      • isSampletrue 或 false
    • author对象可为 null
      • username文本
      • displayName文本
      • avatarUrl文本 (uri)可为 null
    • authorFlair文本可为 null
    • kind文本
      允许的值textlinkimagepoll
    • title文本可为 null
    • excerpt文本可为 null
    • flair对象可为 null
      • id文本 (uuid)
      • label文本
      • tone文本
        允许的值neutralaccentsuccesswarningdangervioletblueskycyanemeraldgreenyellowamberrosepink
    • spoiler对象可为 null
      • workTitle文本可为 null
      • unitNumber数字可为 null

        至少 0

    • work对象可为 null
      • id文本 (uuid)
      • title文本
      • medium文本
        允许的值animedonghuaanimationmangamanhwamanhuawebtoon
      • slug文本
      • unitNumber数字可为 null

        至少 0

    • isAdulttrue 或 false
    • isPinnedtrue 或 false
    • isLockedtrue 或 false
    • score整数可为 null

      -9007199254740991 到 9007199254740991

    • commentCount整数

      0 到 9007199254740991

    • reactions对象 列表
      • kind文本
        允许的值lovelaughwowsadclapfirethinkangrypartycry
      • count整数

        0 到 9007199254740991

    • link对象可为 null
      • url文本 (uri)
      • host文本
      • title文本可为 null
      • description文本可为 null
      • image对象可为 null
        • url文本 (uri)
        • width整数

          0 到 9007199254740991

        • height整数

          0 到 9007199254740991

        • alt文本可为 null
        • variantWidths整数 列表

          0 到 9007199254740991

      • isPendingtrue 或 false
    • images对象 列表
      • url文本 (uri)
      • width整数

        0 到 9007199254740991

      • height整数

        0 到 9007199254740991

      • alt文本可为 null
      • variantWidths整数 列表

        0 到 9007199254740991

    • poll对象可为 null
      • options对象 列表
        • id文本 (uuid)
        • label文本
        • voteCount整数可为 null

          0 到 9007199254740991

      • totalVotes整数

        0 到 9007199254740991

      • closesAt文本 (date-time)
      • isClosedtrue 或 false
      • allowsMultipletrue 或 false
    • createdAt文本 (date-time)
    • editedAt文本 (date-time)可为 null
  • nextCursor文本可为 null

错误

与所有操作一样,此操作在参数无效时可能返回 400,找不到内容时返回 404,请求过多时返回 429。所有错误的结构都相同。

了解错误