Skip to content

Node.js based forum software built for the modern web

4.7 KB
Raw Blame
get:
  tags:
    - categories
  summary: Get a single category
  description: This route retrieves a single category's data, along with its children and the topics created inside of the category.
  parameters:
    - name: category_id
      in: path
      required: true
      schema:
        type: string
      example: 1
    - name: slug
      description: This parameter is not required. If omitted, the request will be automatically redirected with the proper category slug.
      in: path
      required: true
      schema:
        type: string
      example: test
    - name: topic_index
      description: This parameter is not required. If omitted, the request will presume that you want the first post. The API response is largely unaffected by this parameter, it is used client-side (to send the user to the requested post), and changes the meta/link tags in the server-side generated HTML.
      in: path
      required: true
      schema:
        type: string
      example: 1
  responses:
    "200":
      description: ""
      content:
        application/json:
          schema:
            allOf:
              - $ref: ../../components/schemas/CategoryObject.yaml#/CategoryObject
              - type: object
                properties:
                  tagWhitelist:
                    type: array
                    items:
                      type: string
                  unread:
                    type: boolean
                    description: True if category or it's children have unread topics
                  unread-class:
                    type: string
                  children:
                    type: array
                    items:
                      $ref: ../../components/schemas/CategoryObject.yaml#/CategoryObject
                  topics:
                    type: array
                    items:
                      $ref: ../../components/schemas/TopicObject.yaml#/TopicObject
                  nextStart:
                    type: number
                  isWatched:
                    type: boolean
                  isTracked:
                    type: boolean
                  isNotWatched:
                    type: boolean
                  isIgnored:
                    type: boolean
                  hasFollowers:
                    type: boolean
                    nullable: true
                  title:
                    type: string
                  selectCategoryLabel:
                    type: string
                    description: Label to use for the category selector
                  privileges:
                    type: object
                    properties:
                      topics:create:
                        type: boolean
                      topics:read:
                        type: boolean
                      topics:tag:
                        type: boolean
                      topics:schedule:
                        type: boolean
                      read:
                        type: boolean
                      posts:view_deleted:
                        type: boolean
                      cid:
                        type: string
                      uid:
                        type: number
                        description: A user identifier
                      editable:
                        type: boolean
                      view_deleted:
                        type: boolean
                      isAdminOrMod:
                        type: boolean
                  showSelect:
                    type: boolean
                  showTopicTools:
                    type: boolean
                  topicIndex:
                    type: number
                  rssFeedUrl:
                    type: string
                  feeds:disableRSS:
                    type: number
                  reputation:disabled:
                    type: number
                  selectedTag:
                    type: object
                    properties:
                      label:
                        type: string
                    nullable: true
                  selectedTags:
                    type: array
                    items:
                      type: string
                  sortOptionLabel:
                    type: string
                  handleFull:
                    type: string
                    description: |
                      The full webfinger addressable handle for the category.
                      This property is only present if the category privileges allow it to be accessed by the "fediverse" pseudo-user.
              - $ref: ../../components/schemas/Pagination.yaml#/Pagination
              - $ref: ../../components/schemas/Breadcrumbs.yaml#/Breadcrumbs
              - $ref: ../../components/schemas/CommonProps.yaml#/CommonProps