api:artists
Table of Contents
* 01. "Record field format":#dtext-record* 02. "Associated attributes":#dtext-associations
* 03. "Index":#dtext-index
* 04. "Show":#dtext-show
* 05. "Create":#dtext-create
* 06. "Update":#dtext-update
* 07. "Delete":#dtext-delete
* 08. "Banned":#dtext-banned
* 09. "Revert":#dtext-revert
* 10. "See also":#dtext-see-also
* 11. "External links":#dtext-external-links
The following includes the details of how to interface with the artist 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]
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]
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]
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]
h4#nomenclature. Nomenclature
* Plural form: "artists"
** Used in the URL pathname
* Singular form: "artist"
** Used for write parameters (Help:API Write Requests)
* Versions: API:Artist versions
h4#index. 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]
h5#search-attributes. Search attributes
All of the following are standard attributes with all of their available formats and qualifiers.
* Number syntax
**
id**
created_at**
updated_at* Text syntax
**
name**
group_name* Boolean syntax
**
is_deleted**
is_banned* Array syntax
**
other_names
h5#special-search-parameters. Special search parameters
*
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
h4#show. 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]
h4#create. 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]
h5#create-parameters. 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.
h4#update. 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]
h5#update-parameters. Update parameters
Accepts the "same parameters":[#dtext-create-parameters] as the "create artist action":[#dtext-create]. All parameters are optional.
h4#delete. 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.
h4#banned. 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]
h4#revert. 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]
h5#revert-parameters. Revert parameters
* Required:
** version_id - The artist version ID to revert to.
h4#ban. 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]
h4#ban. 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]
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]