api:forum topics
The following includes the details of how to interface with the forum topic records through the API.
Record field format
- id: integer, > 0
- creator_id: integer, > 0
- updater_id: integer, > 0
- title: string
- category_id: integer, includes [0,1,2]
- response_count: integer
- min_level: integer
- is_deleted: boolean
- is_sticky: boolean
- is_locked: boolean
- created_at: timestamp
- updated_at: timestamp
Associated attributes
- creator - The user that created the topic.
- updater - The user that last updated the topic.
- original_post - The first forum post on a topic.
Nomenclature
- Plural form: "forum_topics"
- Used in the URL pathname
- Singular form: "forum_topic"
- Used for write parameters (Help:API Write Requests)
- Versions: none
Actions
These are the various actions that can be done with forum topic records.
Index
The base URL is GET /forum_topics.json
Search attributes
All of the following are standard attributes with all of their available formats and qualifiers.
- Number syntax
id
category_id
response_count
created_at
updated_at
- Text syntax
title
- User syntax
creator
updater
- Boolean syntax
is_deleted
is_sticky
is_locked
Special search parameters
-
title_matches
- Case-insensitive wildcard searching on the title text field. -
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). -
order
- Sets the order of results. -
sticky
- Shows sticky topics first, sorted by updated at second. -
post_count
- Orders by post count.
Note: The default order is updated at descending.
Show
The base URL is GET /forum_topics/$id.json where $id is the forum topic ID.
Create
The base URL is POST /forum_topics.json
Create parameters
- Required:
title
-
category_id
- Can be: 0, 1, 2. - 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+
-
min_level
- Can be: 0, 40, 50 is_sticky
is_locked
is_deleted
Update
The base URL is PUT /forum_topics/$id.json where $id is the forum topic ID.
Update parameters
Accepts the same parameters as the create forum topic action. All parameters are optional. Besides those, it also accepts the following additional optional parameters.
-
original_post_attributes][id]
- The ID of the the first post on a topic. - Is a hash value, so the final parameter format is
forum_topic[original_post_attributes][id]
- This parameter is required if the original post's body is being updated as well.
Delete
The base URL is DELETE /forum_topics/$id.json where $id is the forum topic ID.
Note: This action can also be accomplished using the update forum topic action by setting is_deleted
to true.
Undelete
The base URL is POST /forum_topics/$id/undelete.json where $id is the forum topic ID.
Note: This action can also be accomplished using the update forum topic action by setting is_deleted
to false.
Mark all as read
The base URL is POST /forum_topics/mark_all_as_read.json
Marks every topic as being read.