Miyuu's Image Board

api:wiki_pages

Table of Contents

•01. Record field format
•02. Derived field format
•03. Associated attributes
•04. Index
•05. Show
•06. Create
•07. Update
•08. Delete
•09. Revert
•10. See also
[/ul]


The following includes the details of how to interface with the wiki page 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]
body
[/td]

[td]string[/td]

[td][/td]

[/tr]

[tr]

[td]
other_names
[/td]

[td]array[/td]

[td]strings[/td]

[/tr]

[tr]

[td]
is_deleted
[/td]

[td]boolean[/td]

[td][/td]

[/tr]

[tr]

[td]
locked
[/td]

[td]boolean[/td]

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

Derived field format

These are values which are not part of the actual record, but instead are derived from calculations and record lookups on the fly.


[table]

[thead]

[tr]

[th]Name[/th]

[th]Type[/th]

[th]Details[/th]

[th]Notes[/th]

[/tr]

[/thead]

[tbody]

[tr]

[td]

category_name
[/td]

[td]string[/td]

[td][0,1,3,4,5,null][/td]

[td]It is the
category
of the "associated tag":[#dtext-associations] if it exists, otherwise it is null.[/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]

tag
[/td]

[td]tag[/td]

[td]single[/td]

[td]optional[/td]

[td][/td]

[/tr]

[tr]

[td]
artist
[/td]

[td]artist[/td]

[td]single[/td]

[td]optional[/td]

[td][/td]

[/tr]

[tr]

[td]
dtext_links
[/td]

[td]dtext link[/td]

[td]multiple[/td]

[td]optional[/td]

[td][/td]

[/tr]

[/tbody]

[/table]

Nomenclature

  • Plural form: "wiki_pages"
•• Used in the URL pathname
  • Singular form: "wiki_page"
•• Used for write parameters (Help:API Write Requests)

Index

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]GET[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/wiki_pages.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

••
created_at

••
updated_at
••
title

••
body
••
other_names
••
is_deleted

••
is_locked
••
tag

••
artist

••
dtext_links

Special search parameters

  • body_matches
    - Case-insensitive wildcard searching on the body text field.
  • title_normalize
    - Normalized case-insensitive wildcard searching on the title text field.
  • other_names_match
    - Case-insensitive wildcard search on any of the other names.
  • linked_to
    - All wiki pages that link to the given wiki title.
  • not_linked_to
    - All wiki pages that do not link to the given wiki title.
  • hide_deleted
    - Hides all deleted wikis (boolean syntax).
•• Shortcut for
search[is_deleted]=false
  • other_names_present
    - Shows wikis based on the presence of other names (boolean syntax).
•• Shortcut for
search[other_name_count]=>0
(TRUE) and
search[other_name_count]=0
(FALSE)
  • order
    - Sets the order of results.
••
title
- Alphabetical order on the title.
••
post_count
- Orders by post count.

Show

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]GET[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/wiki_pages/$id.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]read request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the wiki page ID or title.[/td]

[/tr]

[/tbody]

[/table]

Create

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]POST[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/wiki_pages.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[/tbody]

[/table]

Create parameters

  • Required:
••
title
  • Optional
••
body

••
other_names
- Uses URL array parameter format.
••
other_names_string
- Space delimited list of post IDs.
••
is_deleted

••
is_locked

Update

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]PUT/PATCH[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/wiki_pages/$id.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the wiki page ID or title.[/td]

[/tr]

[/tbody]

[/table]

Update parameters

Accepts the "same parameters":[#dtext-create-parameters] as the "create wiki page action":[#dtext-create]. All parameters are optional.

Delete

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]DELETE[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/wiki_pages/$id.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the wiki page ID or title.[/td]

[/tr]

[/tbody]

[/table]


Note: This action can also be accomplished using the "update wiki page action":[#dtext-update] by setting

is_deleted
to true.

Revert

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]PUT[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/wiki_pages/$id/revert.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the wiki page ID or title.[/td]

[/tr]

[/tbody]

[/table]

Revert parameters

  • Required:
•• version_id - The wiki page version ID to revert to.

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]