Miyuu's Image Board

api:artists

Table of Contents


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

[td]string[/td]

[td]tag format[/td]

[/tr]

[tr]

[td]
group_name
[/td]

[td]string[/td]

[td][/td]

[/tr]

[tr]

[td]
other_names
[/td]

[td]array[/td]

[td]strings[/td]

[/tr]

[tr]

[td]
is_banned
[/td]

[td]boolean[/td]

[td][/td]

[/tr]

[tr]

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


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]

members
[/td]

[td]artist[/td]

[td]multiple[/td]

[td]optional[/td]

[td][/td]

[/tr]

[tr]

[td]
urls
[/td]

[td]artist url[/td]

[td]multiple[/td]

[td]optional[/td]

[td][/td]

[/tr]

[tr]

[td]
wiki_page
[/td]

[td]wiki page[/td]

[td]single[/td]

[td]optional[/td]

[td][/td]

[/tr]

[tr]

[td]
tag_alias
[/td]

[td]tag alias[/td]

[td]single[/td]

[td]optional[/td]

[td][/td]

[/tr]

[tr]

[td]
tag
[/td]

[td]tag[/td]

[td]single[/td]

[td]optional[/td]

[td][/td]

[/tr]

[/tbody]

[/table]


Nomenclature

  • Plural form: "artists"
•• Used in the URL pathname
  • Singular form: "artist"
•• 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]

/artists.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]read request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]The default order is ID descending.[/td]

[/tr]

[/tbody]

[/table]



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

••
id

••
created_at

••
updated_at
••
name

••
group_name
••
is_deleted

••
is_banned
••
other_names


  • any_other_name_like
    - Search for artists that have an other name matching this value. Supports wildcards.
  • any_name_matches 
    - Search for artists that have a matching name, group name, or other name. Supports wildcards and regexes.
  • url_matches
    - Search for artists with a matching URL.
•• Does a regex match when the query starts and ends with a forward slash "/".
••• Regexes must follow the Ruby's format.
•• Does a wildcard match when there are asterisks "*" present.
•• Uses the artist URL finder when the value is prefaced by
http://
or
https://

••• This does a recursive search on URLs stripping the pathname one level at a time to search for matches.
••• It will keep searching until it finds an exact match or 10 similar entries.
•• Otherwise it does a wildcard search with wildcard placed at the start and end.
  • any_name_or_url_matches
    - Searches for the artist by name or URL.
•• Does a URL search if the value is prefaced by
http://
or
https://

•• Does a name search otherwise.
  • order
    - Sets the order of the results.
••
name

••
updated_at

••
post_count


Show


[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]GET[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/artists/$id.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]read request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the artist ID.[/td]

[/tr]

[/tbody]

[/table]


Create


[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]POST[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/artists.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[/tbody]

[/table]


Create parameters

  • Required:
••
name
- The artist tag name.
••• Must be tag format (API:tags).
  • Optional
••
group_name
- The name of the group this artist belongs to.
••
other_names
- List of alternative names for this artist.
••• Space delimited. Replace spaces within names with underscores.
••
url_string
- List of URLs associated with this artist
••• Whitespace or newline delimited.
••
is_deleted
- Set the artist entry as deleted or not.


Update


[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]PUT/PATCH[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/artists/$id.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the artist ID.[/td]

[/tr]

[/tbody]

[/table]


Update parameters


Accepts the "same parameters":[#dtext-create-parameters] as the "create artist 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]

/artists/$id.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the artist ID.[/td]

[/tr]

[/tbody]

[/table]


Note: The action can be accomplished using the "update artist action":[#dtext-update] by setting

is_deleted
to true.


Banned


[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]GET[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/artists/banned.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]read request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]Redirects to the "index artist action":[#dtext-index] with
is_banned
set to true.[/td]

[/tr]

[/tbody]

[/table]


Revert


[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]PUT[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

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

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the artist ID.[/td]

[/tr]

[/tbody]

[/table]


Revert parameters

  • Required:
•• version_id - The artist version ID to revert to.


Ban


[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]PUT[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/artists/$id/ban.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the artist ID.

Restricted to Admins only (Help:Users)[/td]

[/tr]

[/tbody]

[/table]


Unban


[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]PUT[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td]

/artists/$id/unban.json
[/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]
$id
is the artist ID.

Restricted to Admins only (Help:Users)[/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]