Miyuu's Image Board

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
[/ul]


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

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]

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]

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]

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

[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]

Search attributes

All of the following are standard attributes with all of their available formats and qualifiers.

••
id

••
category_id

••
response_count

••
created_at

••
updated_at
••
title
••
creator

••
updater
••
is_deleted

••
is_sticky

••
is_locked
••
forum_posts

••
bulk_update_requests

••
tag_aliases

••
tag_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

[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]

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]

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+

  • Optional
••
min_level
- Can be: 0, 40, 50
••
is_sticky

••
is_locked

••
is_deleted

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]

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.

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.

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.

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]

See also

[table]

[tbody]

[tr]

[td]Controller[/td]

[td][/td]

[td][/td]

[/tr]

[tr]

[td]Model[/td]

[td][/td]

[/tr]

[tr]

[td]Policy[/td]

[td][/td]

[/tr]

[/tbody]

[/table]