Danbooru
Login Posts Comments Notes Artists Tags Pools Wiki Forum More ยป
Listing Upload Hot Changes Help
A list of tags to help categorize this search. Space delimited.

Search

  • Help
guro
scat
furry -rating:g

Tags

Options

Related

  • Deleted
  • Random
  • History
  • Discussions
  • Count
  • Posts Wiki Search »
  • Size
    • Small
    • Medium
    • Large
    • Huge
    • Huge
    • Gigantic
    • Absurd
    • Show scores
  • Edit

    Table of Contents
    • 01. Record field format
    • 02. Associated attributes
    • 03. Index
    • 04. Show
    • 05. Create
    • 06. Update
    • 07. Delete
    • 08. Undelete
    • 09. Mark all as read
    • 10. See also
    • 11. External links

    The following includes the details of how to interface with the forum topic records through the API.

    01 Record field format


    NameTypeDetails
    idinteger>0
    titlestring
    category_idinteger[0,1,2]
    response_countinteger
    min_levelintegerCorresponds to the level of user (API:Users).
    is_deletedboolean
    is_stickyboolean
    is_lockedboolean
    creator_idinteger>0
    updater_idinteger>0
    created_attimestamp
    updated_attimestamp
    Category ID
    ValueDescription
    0General
    1Tags
    2Bugs & features
    Min level

    Min level is an integer when stored in the database, but is used and presented by Danbooru as an enum. Unrestricted access, i.e. a min level of 0, is "None". Every other ID is the user level, with it's name being the titlecase version of that level's name. For example, a min level for Gold members is 30, and is presented to the user as "Gold".

    02 Associated attributes


    The following is the list of relations that can be included in the API results (see Help:Common URL parameters for more info):

    NameTypeNumberAvailabilityDetails
    creatorusersinglerequiredUser that created the forum topic.
    updaterusersinglerequiredUser that last updated the forum topic.
    original_postforum postsinglerequiredThe first forum post of a forum topic.

    03 Index


    Returns multiple forum topic records.

    HTTP MethodGET
    Base URL/forum_topics.json
    Typeread request
    DescriptionThe default order is updated at descending.
    Search attributes

    Search parameters take the following format (see Help:Common URL parameters for more info):

    search[FIELD]=VALUE

    The following are the base fields along with their associated type. Check the syntax pages for all of the available variations.

    • Number syntax
      • id
      • response_count
      • created_at
      • updated_at
    • Text syntax
      • title
    • Enum syntax
      • category
        • Due to issue #6158, "Bugs & Features" is not searchable when using the search field category.
        • Use category_id and the value of 2 instead.
      • min_level
    • User syntax
      • creator
      • updater
    • Boolean syntax
      • is_deleted
      • is_sticky
      • is_locked
    • Chaining syntax
      • forum_posts
      • bulk_update_requests
      • tag_aliases
      • tag_implications
    Special search parameters

    The following are additional search fields.

    • status - The status of an attached BUR. Can be: pending, approved, rejected.
    • is_private - Shows topics that have a min level set or not (Help:Boolean syntax).
    • is_read - Shows topics that have been read by the user or not (Help:Boolean syntax).
    Search order

    Using the search parameter order with one of the following values changes the order of the results.

    • sticky - Shows sticky topics first, sorted by updated at second.
    • id - Orders by ID desc.
    • custom - Help:Common URL parameters
      • In order to use this order, search[id] must also be set with a list of comma-separated IDs.

    04 Show


    Returns a single forum topic record.

    HTTP MethodGET
    Base URL/forum_topics/$id.json
    Typeread request
    Description$id is the forum topic ID.

    05 Create


    Creates a single forum topic record.

    HTTP MethodPOST
    Base URL/forum_topics.json
    Typewrite request
    Create parameters

    Forum topic parameters take the following format (see Help:API Write Requests for more info):

    forum_topic[FIELD]=VALUE
    • Required:
      • title
      • category_id - Can be: 0, 1, 2.
      • category
        • Alternate to category_id.
        • Can be
    • Optional
      • original_post_attributes[body] - DText that will be used to create a forum post entry at the same time.
        • Is a hash value, so the final parameter format is forum_topic[original_post_attributes][body]
    Restricted to Moderator+
    • Optional
      • min_level - Can be: 0, 40, 50
      • is_sticky
      • is_locked

    06 Update


    Updates a single forum topic record.

    HTTP MethodPUT/PATCH
    Base URL/forum_topics/$id.json
    Typewrite request
    Description$id is the forum topic ID.
    Update parameters

    Accepts the same parameters as the Create action. All parameters are optional.

    Original post attributes

    Besides those, the Update action also accepts the following additional optional parameters. These can be used to update the opening post of a forum topic if the user is capable of doing that (original poster or Moderator+).

    • original_post_attributes[id] - The ID of the the first post on a topic.
    • original_post_attributes[body] - The body of the first post on a topic.

    The final format of these parameters look like the following:

    forum_topic[original_post_attributes][id]=VALUE

    The id parameter is required if updating the opening post, and it must match the actual ID of the opening post, i.e. it is not changeable.

    07 Delete


    Deletes a single forum topic record.

    HTTP MethodDELETE
    Base URL/forum_topics/$id.json
    Typewrite request
    Description$id is the forum topic ID.
    Restricted to Moderator+.

    08 Undelete


    Undeletes a single forum topic record.

    HTTP MethodPOST
    Base URL/forum_topics/$id/undelete.json
    Typewrite request
    Description$id is the forum topic ID.
    Restricted to moderator+.

    09 Mark all as read


    Marks every topic as being read.

    HTTP MethodPOST
    Base URL/forum_topics/mark_all_as_read.json
    Typewrite request

    10 See also


    • Help:Common URL Parameters
    • Help:API

    11 External links


    Controllerhttps://github.com/danbooru/danbooru/blob/master/app/controllers/forum_topics_controller.rb
    Modelhttps://github.com/danbooru/danbooru/blob/master/app/models/forum_topic.rb
    Policyhttps://github.com/danbooru/danbooru/blob/master/app/policies/forum_topic_policy.rb

    View wiki

    No posts found.

    1
    Terms / Privacy / Upgrade / Contact /