api:forum_topics
Table of Contents
* 01. "Record field format":#dtext-record* 02. "Associated attributes":#dtext-associations
* 03. "Nomenclature":#dtext-nomenclature
* 04. "Index":#dtext-index
* 05. "Show":#dtext-show
* 06. "Create":#dtext-create
* 07. "Update":#dtext-update
* 08. "Delete":#dtext-delete
* 09. "Undelete":#dtext-undelete
* 10. "Mark all as read":#dtext-mark-all-as-read
* 11. "See also":#dtext-see-also
* 12. "External links":#dtext-external-links
The following includes the details of how to interface with the forum topic records through the API.
h4#record. Record field format
[table]
[thead]
[tr]
[th]Name[/th]
[th]Type[/th]
[th]Details[/th]
[/tr]
[/thead]
[tbody]
[tr]
[td]
id[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
title[/td][td]string[/td]
[td][/td]
[/tr]
[tr]
[td]
category_id[/td][td]integer[/td]
[td][0,1,2][/td]
[/tr]
[tr]
[td]
response_count[/td][td]integer[/td]
[td][/td]
[/tr]
[tr]
[td]
min_level[/td][td]integer[/td]
[td]Corresponds to the level of user (API:Users).[/td]
[/tr]
[tr]
[td]
is_deleted[/td][td]boolean[/td]
[td][/td]
[/tr]
[tr]
[td]
is_sticky[/td][td]boolean[/td]
[td][/td]
[/tr]
[tr]
[td]
is_locked[/td][td]boolean[/td]
[td][/td]
[/tr]
[tr]
[td]
creator_id[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
updater_id[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
created_at[/td][td]timestamp[/td]
[td][/td]
[/tr]
[tr]
[td]
updated_at[/td][td]timestamp[/td]
[td][/td]
[/tr]
[/tbody]
[/table]
h5#category-id. Category ID
[table]
[thead]
[tr]
[th]Value[/th]
[th]Description[/th]
[/tr]
[/thead]
[tbody]
[tr]
[td]0[/td]
[td]General[/td]
[/tr]
[tr]
[td]1[/td]
[td]Tags[/td]
[/tr]
[tr]
[td]2[/td]
[td]Bugs & features[/td]
[/tr]
[/tbody]
[/table]
h4#associations. Associated attributes
[table]
[thead]
[tr]
[th]Name[/th]
[th]Type[/th]
[th]Number[/th]
[th]Availability[/th]
[th]Details[/th]
[/tr]
[/thead]
[tbody]
[tr]
[td]
creator[/td][td]user[/td]
[td]single[/td]
[td]required[/td]
[td]User that created the forum topic.[/td]
[/tr]
[tr]
[td]
updater[/td][td]user[/td]
[td]single[/td]
[td]required[/td]
[td]User that last updated the forum topic.[/td]
[/tr]
[tr]
[td]
original_post[/td][td]forum post[/td]
[td]single[/td]
[td]required[/td]
[td]The first forum post of a forum topic.[/td]
[/tr]
[/tbody]
[/table]
h4#Nomenclature. Nomenclature
* Plural form: "forum_topics"
** Used in the URL pathname
* Singular form: "forum_topic"
** Used for write parameters (Help:API Write Requests)
* Versions: none
h4#index. Index
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]GET[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/forum_topics.json[/td][/tr]
[tr]
[td]Type[/td]
[td]read request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]The default order is updated at descending.[/td]
[/tr]
[/tbody]
[/table]
h5#search-attributes. 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* Chaining syntax
**
forum_posts**
bulk_update_requests**
tag_aliases**
tag_implications
h5#special-search-parameters. 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.
h5#search-order. 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.
h4#show. Show
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]GET[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/forum_topics/$id.json[/td][/tr]
[tr]
[td]Type[/td]
[td]read request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]
$id is the forum topic ID.[/td][/tr]
[/tbody]
[/table]
h4#create. Create
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]POST[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/forum_topics.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[/tbody]
[/table]
h5#create-parameters. 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]
h6.Restricted to Moderator+
* Optional
**
min_level - Can be: 0, 40, 50**
is_sticky**
is_locked**
is_deleted
h4#update. Update
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]PUT/PATCH[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/forum_topics/$id.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]
$id is the forum topic ID.[/td][/tr]
[/tbody]
[/table]
h5#update-parameters. Update parameters
Accepts the "same parameters":[#dtext-create-parameters] as the "create forum topic action":[#dtext-create]. 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.
h4#delete. Delete
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]DELETE[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/forum_topics/$id.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]
$id is the forum topic ID.Restricted to Moderator+.[/td]
[/tr]
[/tbody]
[/table]
Note: This action can also be accomplished using the "update forum topic action":[#dtext-update] by setting
is_deleted to true.
h4#undelete. Undelete
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]POST[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/forum_topics/$id/undelete.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]
$id is the forum topic ID.Restricted to moderator+.[/td]
[/tr]
[/tbody]
[/table]
Note: This action can also be accomplished using the "update forum topic action":[#dtext-update] by setting
is_deleted to false.
h4#mark-all-as-read. Mark all as read
Marks every topic as being read.
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]POST[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/forum_topics/mark_all_as_read.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[/tbody]
[/table]
h4#see-also. See also
* Help:Common URL Parameters
* Help:API
h4#external-links. External links
[table]
[tbody]
[tr]
[td]Controller[/td]
[td]
[td][/td]
[/tr]
[tr]
[td]Model[/td]
[td]
[/tr]
[tr]
[td]Policy[/td]
[td]
[/tr]
[/tbody]
[/table]