api:forum topics
Table of Contents
- 01. Record field format
- 02. Associated attributes
- 03. Nomenclature
- 04. Index
- 05. Show
- 06. Create
- 07. Update
- 08. Delete
- 09. Undelete
- 10. Mark all as read
- 11. See also
- 12. External links
The following includes the details of how to interface with the forum topic records through the API.
Record field format
| Name | Type | Details |
|---|---|---|
id | integer | >0 |
title | string | |
category_id | integer | [0,1,2] |
response_count | integer | |
min_level | integer | Corresponds to the level of user (API:Users). |
is_deleted | boolean | |
is_sticky | boolean | |
is_locked | boolean | |
creator_id | integer | >0 |
updater_id | integer | >0 |
created_at | timestamp | |
updated_at | timestamp |
Category ID
| Value | Description |
|---|---|
| 0 | General |
| 1 | Tags |
| 2 | Bugs & features |
Associated attributes
| Name | Type | Number | Availability | Details |
|---|---|---|---|---|
creator | user | single | required | User that created the forum topic. |
updater | user | single | required | User that last updated the forum topic. |
original_post | forum post | single | required | The first forum post of a forum 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
Index
| HTTP Method | GET |
| Base URL | /forum_topics.json |
| Type | read request |
| Description | The default order is updated at descending. |
Search attributes
All of the following are standard attributes with all of their available formats and qualifiers.
- Number syntax
idcategory_idresponse_countcreated_atupdated_at- Text syntax
title- User syntax
creatorupdater- Boolean syntax
is_deletedis_stickyis_locked- Chaining syntax
forum_postsbulk_update_requeststag_aliasestag_implications
Special search parameters
title_matches- Case-insensitive wildcard searching on the title text field.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).is_deleted- Unless this value is present, deleted forum_topics are hidden.
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.post_count- Orders by post count.
The order can also be changed to ID descending by using sequential pagination.
Show
| HTTP Method | GET |
| Base URL | /forum_topics/$id.json |
| Type | read request |
| Description | $id is the forum topic ID. |
Create
| HTTP Method | POST |
| Base URL | /forum_topics.json |
| Type | write request |
Create parameters
- Required:
titlecategory_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+
- Optional
min_level- Can be: 0, 40, 50is_stickyis_lockedis_deleted
Update
| HTTP Method | PUT/PATCH |
| Base URL | /forum_topics/$id.json |
| Type | write request |
| Description | $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
| HTTP Method | DELETE |
| Base URL | /forum_topics/$id.json |
| Type | write request |
| Description | $id is the forum topic ID.Restricted to Moderator+. |
Note: This action can also be accomplished using the update forum topic action by setting is_deleted to true.
Undelete
| HTTP Method | POST |
| Base URL | /forum_topics/$id/undelete.json |
| Type | write request |
| Description | $id is the forum topic ID.Restricted to moderator+. |
Note: This action can also be accomplished using the update forum topic action by setting is_deleted to false.
Mark all as read
Marks every topic as being read.
| HTTP Method | POST |
| Base URL | /forum_topics/mark_all_as_read.json |
| Type | write request |
