API4 XML
Lets go through come calls and examples that you can do for each XML method.
Remember that Binary data methods will not return xml; just the file/data you have requested.
Non-Data Methods
handshake
This is the function that handles verifying a new handshake Takes a timestamp, auth key, and username.
Input | Type | Description | Optional |
---|---|---|---|
'auth' | string | $passphrase (Timestamp . Password SHA hash) OR (API Key) | NO |
'user' | string | $username (Required if login/password authentication) | YES |
'timestamp' | integer | UNIXTIME() (Timestamp used in seed of password hash. Required if login/password authentication) | YES |
'version' | string | $version (API Version that the application understands) | YES |
ping
This can be called without being authenticated, it is useful for determining if what the status of the server is, and what version it is running/compatible with
Input | Type | Description | Optional |
---|---|---|---|
'auth' | string | (Session ID) returns version information and extends the session if passed | YES |
'version' | string | $version (API Version that the application understands) | YES |
goodbye
Destroy a session using the auth parameter.
Input | Type | Description | Optional |
---|---|---|---|
'auth' | string | (Session ID) destroys the session if it exists | NO |
url_to_song
This takes a url and returns the song object in question
Input | Type | Description | Optional |
---|---|---|---|
'url' | string | Full Ampache URL from server, translates back into a song XML | NO |
Data Methods
advanced_search
Changes to text searches
- 'is not' has been added shifting values down the list. 0=contains, 1=does not contain, 2=starts with, 3=ends with 4=is, 5=is not, 6=sounds like, 7=does not sound like
- rule_1['name'] is depreciated. Instead of rule_1['name'] use rule_1['title'] (I have put a temp workaround into the search rules to alleviate this change for any existing apps)
Using advanced_search
Perform an advanced search given passed rules. This works in a similar way to the web/UI search pages. You can pass multiple rules as well as joins to create in depth search results
Rules must be sent in groups of 3 using an int (starting from 1) to designate which rules are combined. Use operator ('and'|'or') to choose whether to join or separate each rule when searching.
Refer to the Advanced Search page for details about creating searches.
- INPUTS
- ampache_url = (string)
- ampache_API = (string)
- operator = (string) 'and'|'or' (whether to match one rule or all)
- rules = (array) = [[
rule_1
,rule_1_operator
,rule_1_input
], [rule_2
,rule_2_operator
,rule_2_input
], [etc]] - type = (string)
song
,album
,artist
,playlist
,label
,user
,video
- random = (integer)
0
,1
(random order of results; default to 0) - offset = (integer)
- limit' = (integer)
SONG
ARTIST
ALBUM
albums
This returns albums based on the provided search filters
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
'exact' | boolean | if true filter is exact rather then fuzzy | NO |
'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | YES | |
'include' | string | albums , songs (include child objects in the response) | YES |
album
This returns a single album based on the UID provided
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Album, returns album XML | NO |
'include' | array | Array specified using GET convention, can contain songs and will include the corresponding XML nested in the album XML | NO |
album_songs
This returns the songs of a specified album
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Album, returns song XML | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
artists
This takes a collection of inputs and returns artist objects.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
'exact' | boolean | if true filter is exact rather then fuzzy | YES |
'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
'include' | string | albums , songs (include child objects in the response) | YES |
artist
This returns a single artist based on the UID of said artist
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of Artist, returns artist XML | NO |
'include' | array | Array specified using GET convention, can contain albums or songs and will include the corresponding XML nested in the artist XML | NO |
artist_albums
This returns the albums of an artist
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Artist, returns Album XML | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
artist_songs
This returns the songs of the specified artist
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Artist, returns Song XML | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
catalogs
- NEW in 4.2.0
This searches the catalogs and returns... catalogs
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | music , clip , tvshow , movie , personal_video , podcast (Catalog type) | YES |
catalog
- NEW in 4.2.0
Return catalog by UID
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Catalog | NO |
catalog_action
Kick off a catalog update or clean for the selected catalog
Input | Type | Description | Optional |
---|---|---|---|
'task' | string | add_to_catalog , clean_catalog | NO |
'catalog' | integer | $catalog_id | NO |
catalog_file
- NEW in 4.2.0
Perform actions on local catalog files. Single file versions of catalog add, clean, verify and remove (delete) Make sure you remember to urlencode those file names!
Input | Type | Description | Optional |
---|---|---|---|
'file' | string | FULL path to local file | NO |
'task' | string | add , clean , verify , remove | NO |
'catalog' | integer | $catalog_id | NO |
flag
This flags a library item as a favorite
- Setting flag to true (1) will set the flag
- Setting flag to false (0) will remove the flag
Input | Type | Description | Optional |
---|---|---|---|
'type' | string | song , album , artist , playlist , podcast , podcast_episode , video , tvshow , tvshow_season | NO |
'id' | integer | $object_id | NO |
'flag' | boolean | 0 , 1 | NO |
followers
This gets a user's followers
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | Username of the user for who to get followers list | NO |
following
This get the user list followed by a user
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | (Username of the user for who to get following list | NO |
friends_timeline
This get current user friends timeline
Input | Type | Description | Optional |
---|---|---|---|
'limit' | integer | Maximum number of results to return | YES |
'since' | integer | UNIXTIME() | NO |
get_indexes
This takes a collection of inputs and returns ID + name for the object type
Input | Type | Description | Optional |
---|---|---|---|
'type' | string | song , album , artist , playlist | NO |
'filter' | string | YES | |
'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum results for the chosen type | YES |
'hide_search' | integer | 0 , 1 (if true do not include searches/smartlists in the result) | YES |
SONGS
ARTIST
ALBUM
PLAYLIST
get_similar
- NEW in 4.2.0
Return similar artist id's or similar song ids compared to the input filter
Input | Type | Description | Optional |
---|---|---|---|
'type' | string | song , artist | NO |
'filter' | integer | artist id or song id | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
last_shouts
This get the latest posted shouts
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | Username of the user for who to get latest shouts | YES |
'limit' | integer | Maximum number of results to return | YES |
licenses
- NEW in 4.2.0
This returns the licenses based on the specified filter
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
'exact' | boolean | if true filter is exact rather then fuzzy | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
license
- NEW in 4.2.0
This returns a single license based on UID
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of license, returns license XML | NO |
license_songs
- NEW in 4.2.0
This returns a list of songs based on the filter ID
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of license, returns song XML | NO |
playlists
This returns playlists based on the specified filter
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
'exact' | boolean | if true filter is exact rather then fuzzy | YES |
'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
'hide_search' | integer | 0 , 1 (if true do not include searches/smartlists in the result) | YES |
'show_dupes' | integer | 0 , 1 (if true if true ignore 'api_hide_dupe_searches' setting) | YES |
playlist
This returns a single playlist
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of playlist, returns playlist XML | NO |
playlist_songs
This returns the songs for a playlist
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of Playlist, returns song XML | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
playlist_create
This create a new playlist and return it
Input | Type | Description | Optional |
---|---|---|---|
'name' | string | Playlist name | NO |
'type' | string | public , private (Playlist type) | YES |
playlist_edit
This modifies name and type of a playlist Previously name and type were mandatory while filter wasn't. this has been reversed.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of Playlist | NO |
'name' | string | Playlist name | YES |
'type' | string | public , private (Playlist type) | YES |
'items' | string | comma-separated song_id's (replace existing items with a new object_id) | YES |
'tracks' | string | comma-separated playlisttrack numbers matched to items in order | YES |
playlist_delete
This deletes a playlist
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of Playlist | NO |
playlist_add_song
This adds a song to a playlist. setting check=1 will not add duplicates to the playlist
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Playlist | NO |
'song' | integer | UID of song to add to playlist | NO |
'check' | boolean | 0 , 1 Whether to check and ignore duplicates (default = 0) | YES |
playlist_remove_song
This remove a song from a playlist. Previous versions required 'track' instead of 'song'.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of Playlist | NO |
'song' | integer | UID of song to remove from playlist | YES |
'track' | integer | Track number to remove from playlist | YES |
playlist_generate
Get a list of song XML, indexes or id's based on some simple search criteria 'recent' will search for tracks played after 'Popular Threshold' days 'forgotten' will search for tracks played before 'Popular Threshold' days 'unplayed' added in 400002 for searching unplayed tracks
Input | Type | Description | Optional |
---|---|---|---|
'mode' | string | recent , forgotten , unplayed , random (default = 'random') | YES |
'filter' | string | string LIKE matched to song title | YES |
'album' | integer | $album_id | YES |
'artist' | integer | $artist_id | YES |
'flag' | integer | 0 , 1 (get flagged songs only. default = 0) | YES |
'format' | string | song , index , id (default = 'song') | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
SONG
INDEX
ID
podcasts
- NEW in 4.2.0
Get information about podcasts
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
'include' | string | episodes (include podcast_episodes in the response) | YES |
podcast
- NEW in 4.2.0
Get the podcast from it's id.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of podcast, returns podcast XML | NO |
'include' | string | episodes (include podcast_episodes in the response) | YES |
podcast_create
- NEW in 4.2.0
Create a podcast that can be used by anyone to stream media. Takes the url and catalog parameters.
Input | Type | Description | Optional |
---|---|---|---|
'url' | string | rss url for podcast | NO |
'catalog' | string | podcast catalog | NO |
podcast_edit
- NEW in 4.2.0
Update the description and/or expiration date for an existing podcast. Takes the podcast id to update with optional description and expires parameters.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Alpha-numeric search term | NO |
'feed' | string | feed rss xml url | YES |
'title' | string | title string | YES |
'website' | string | source website url | YES |
'description' | string | YES | |
'generator' | string | YES | |
'copyright' | string | YES |
podcast_delete
- NEW in 4.2.0
Delete an existing podcast.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of podcast to delete | NO |
podcast_episodes
- NEW in 4.2.0
This returns the episodes for a podcast
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of podcast | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
podcast_episode
- NEW in 4.2.0
Get the podcast_episode from it's id.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | podcast_episode ID number | NO |
podcast_episode_delete
- NEW in 4.2.0
Delete an existing podcast_episode.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of podcast_episode to delete | NO |
rate
This rates a library item
Input | Type | Description | Optional |
---|---|---|---|
'type' | string | song , album , artist , playlist , podcast , podcast_episode , video , tvshow , tvshow_season | NO |
'id' | string | library item id | NO |
'rating' | integer | rating between 0-5 | NO |
record_play
Take a song_id and update the object_count and user_activity table with a play. This allows other sources to record play history to ampache
NOTE Ampache 4.3.0
- 'user' has been made optional
- 'user' can be the user id (e.g 20) or the username (e.g generic_user)
- 'date' has also been added as an optional parameter
Input | Type | Description | Optional |
---|---|---|---|
'id' | integer | $object_id | NO |
'user' | integer/string | $user_id OR $username | YES |
'client' | string | $agent | YES |
'date' | string | UNIXTIME() | YES |
scrobble
Search for a song using text info and then record a play if found. This allows other sources to record play history to ampache
Input | Type | Description | Optional |
---|---|---|---|
'song' | string | $song_name | NO |
'artist' | string | $artist_name | NO |
'album' | string | $album_name | NO |
'songmbid' | string | $song_mbid | YES |
'artistmbid' | string | $artist_mbid | YES |
'albummbid' | string | $album_mbid | YES |
'date' | integer | UNIXTIME() | YES |
'client' | string | $agent | YES |
search_songs
This searches the songs and returns... songs
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for Name returns share XML | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
shares
- NEW in 4.2.0
This searches the shares and returns... shares
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for Song Title, Artist Name, Album Name, Genre Name returns song XML | YES |
'exact' | integer | 0 , 1 boolean to match the exact filter string | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
share
- NEW in 4.2.0
Return shares by UID
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Share, returns song XML | NO |
share_create
- NEW in 4.2.0
Create a public url that can be used by anyone to stream media. Takes the file id with optional description and expires parameters.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | UID of object you are sharing | NO |
'type' | string | object_type | NO |
'description' | string | description (will be filled for you if empty) | YES |
'expires' | integer | days to keep active | YES |
share_edit
- NEW in 4.2.0
Update the description and/or expiration date for an existing share. Takes the share id to update with optional description and expires parameters.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Alpha-numeric search term | NO |
'stream' | boolean | 0 , 1 | YES |
'download' | boolean | 0 , 1 | YES |
'expires' | integer | number of whole days before expiry | YES |
'description' | string | update description | YES |
share_delete
- NEW in 4.2.0
Delete an existing share.
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Share to delete | NO |
songs
Returns songs based on the specified filter
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | NO |
'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
'exact' | boolean | if true filter is exact rather then fuzzy | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
song
returns a single song
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of Song, returns song XML | NO |
stats
Get some items based on some simple search types and filters.
This method has partial backwards compatibility with older api versions but should be updated to follow the current input values.
(Changed in 400001 filter
added)
Input | Type | Description | Optional |
---|---|---|---|
'type' | string | song , album , artist | NO |
'filter' | string | newest , highest , frequent , recent , forgotten , flagged , random | NO |
'user_id' | integer | YES | |
'username' | string | YES | |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
SONG
ARTIST
ALBUM
tags
This returns the tags (Genres) based on the specified filter
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
'exact' | boolean | if true filter is exact rather then fuzzy | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
tag
This returns a single tag based on UID
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of tag, returns tag XML | NO |
tag_artists
This returns the artists associated with the tag in question as defined by the UID
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of tag, returns artist XML | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
tag_albums
This returns the albums associated with the tag in question
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of tag, returns album XML | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
tag_songs
returns the songs for this tag
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of tag, returns song XML | NO |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
timeline
This gets a user's timeline
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | Username of the user for whom to get the timeline | NO |
'limit' | integer | Maximum number of results to return | YES |
'since' | integer | UNIXTIME() | YES |
toggle_follow
This follow/unfollow a user
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | Username of the user to follow/unfollow | NO |
update_art
Updates a single album, artist, song running the gather_art process Doesn't overwrite existing art by default.
Input | Type | Description | Optional |
---|---|---|---|
'id' | integer | $object_id | NO |
'type' | string | song , podcast | NO |
'overwrite' | boolean | 0 , 1 | YES |
update_artist_info
Update artist information and fetch similar artists from last.fm Make sure lastfm_API_key is set in your configuration file
Input | Type | Description | Optional |
---|---|---|---|
'id' | integer | $artist_id | NO |
update_from_tags
Update a single album, artist, song from the tag data
Input | Type | Description | Optional |
---|---|---|---|
'type' | string | song , artist , album | NO |
'id' | integer | $artist_id, $album_id, $song_id | NO |
update_podcast
Sync and download new podcast episodes
Input | Type | Description | Optional |
---|---|---|---|
'id' | integer | $object_id | NO |
user
This gets a user's public information
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | Username of the user for who to get details | NO |
user_create
Create a new user. (Requires the username, password and email.)
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | $username | NO |
'password' | string | hash('sha256', $password) | NO |
'email' | string | e.g.user@gmail.com | NO |
'fullname' | string | YES | |
'disable' | boolean | 0 , 1 | YES |
user_update
Update an existing user.
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | $username | NO |
'password' | string | hash('sha256', $password) | YES |
'email' | string | e.g.user@gmail.com | YES |
'fullname' | string | YES | |
'website' | string | YES | |
'state' | string | YES | |
'city' | string | YES | |
'disable' | boolean | 0 , 1 | YES |
'maxbitrate' | string | YES |
user_delete
Delete an existing user.
Input | Type | Description | Optional |
---|---|---|---|
'username' | string | NO |
videos
This returns video objects!
Input | Type | Description | Optional |
---|---|---|---|
'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | NO |
'exact' | boolean | if true filter is exact rather then fuzzy | YES |
'offset' | integer | Return results starting from this index position | YES |
'limit' | integer | Maximum number of results to return | YES |
video
This returns a single video
Input | Type | Description | Optional |
---|---|---|---|
'filter' | integer | UID of video, returns video XML | NO |
Binary Data Methods
stream
Streams a given media file. Takes the file id in parameter with optional max bit rate, file format, time offset, size and estimate content length option.
Input | Type | Description | Optional |
---|---|---|---|
'id' | integer | $object_id | NO |
'type' | string | song , podcast | NO |
'bitrate' | integer | max bitrate for transcoding in bytes (e.g 192000=192Kb) | YES |
'format' | string | mp3 , ogg , raw , etc (raw returns the original format) | YES |
'offset' | integer | time offset in seconds | YES |
'length' | boolean | 0 , 1 | YES |
download
Downloads a given media file. set format=raw to download the full file
Input | Type | Description | Optional |
---|---|---|---|
'id' | integer | $object_id | NO |
'type' | string | song , podcast | NO |
'format' | string | mp3 , ogg , raw , etc (raw returns the original format) | YES |
get_art
Get an art image.
Input | Type | Description | Optional |
---|---|---|---|
'id' | integer | $object_id | NO |
'type' | string | song , artist , album , playlist , search , podcast | NO |
Control Methods
localplay
This is for controlling localplay
Input | Type | Description | Optional |
---|---|---|---|
'command' | string | next , prev , stop , play , pause , add , volume_up , volume_down , volume_mute , delete_all , skip , status | NO |
'oid' | integer | $object_id | YES |
'type' | string | song , video , podcast_episode , channel , broadcast , democratic , live_stream | YES |
'clear' | boolean | 0 , 1 (Clear the current playlist before adding) | YES |
- return
<root>
<localplay>
<command>
<next>|<prev>|<stop>|<play>|<pause>|<add>|<volume_up>|<volume_down>|<volume_mute>|<delete_all>|<skip>|<status>
</command>
</localplay>
</root>
- throws
<root><error></root>
democratic
This is for controlling democratic play
- ACTION
- method
- vote
- oid (Unique ID of the element you want to vote on)
- type (Type of object, only song is currently accepted so this is optional)
- devote
- oid (Unique ID of the element you want to vote on)
- type (Type of object, only song is currently accepted so this is optional)
- playlist (Returns an array of song items with an additional <vote>[VOTE COUNT]</vote> element)
- play (Returns the URL for playing democratic play)
- vote
- method
Input | Type | Description | Optional |
---|---|---|---|
'oid' | integer | NO | |
'method' | string | NO | |
'action' | string | NO |
TBC
All XML Documents that have a <tag></tag>
element may have 0 or more tag elements associated with them. Each tag element has an attribute "count" that indicates the number of people who have specified this tag.
Artists XML Document. ID's are Ampache's unique Identifier for the artist.
<root>
<artist id="12039">
<name>Metallica</name>
<albums># of Albums</albums>
<songs># of Songs</songs>
<tag id="2481" count="2">Rock & Roll</tag>
<tag id="2482" count="1">Rock</tag>
<tag id="2483" count="1">Roll</tag>
<preciserating>3</preciserating>
<rating>2.9</rating>
</artist>
<artist id="129348">
<name>AC/DC</name>
<albums># of Albums</albums>
<songs># of Songs</songs>
<tag id="2481" count="2">Rock & Roll</tag>
<tag id="2482" count="2">Rock</tag>
<tag id="2483" count="1">Roll</tag>
<preciserating>3</preciserating>
<rating>2.9</rating>
</artist>
</root>
Album XML Document. ID's are Ampache's unique identifier for the album and artist associated.
<root>
<album id="2910">
<name>Back in Black</name>
<artist id="129348">AC/DC</artist>
<year>1984</year>
<tracks>12</tracks>
<disk>1</disk>
<tag id="2481" count="2">Rock & Roll</tag>
<tag id="2482" count="1">Rock</tag>
<tag id="2483" count="1">Roll</tag>
<art>http://localhost/image.php?id=129348</art>
<preciserating>3</preciserating>
<rating>2.9</rating>
</album>
</root>
Single Song XML document, includes references to its parent objects.
<root>
<song id="3180">
<title>Hells Bells</title>
<artist id="129348">AC/DC</artist>
<album id="2910">Back in Black</album>
<tag id="2481" count="3">Rock & Roll</tag>
<tag id="2482" count="1">Rock</tag>
<tag id="2483" count="1">Roll</tag>
<track>4</track>
<time>234</time>
<url>http://localhost/play/index.php?oid=123908...</url>
<size>Song Filesize in Bytes</size>
<art>http://localhost/image.php?id=129348</art>
<preciserating>3</preciserating>
<rating>2.9</rating>
</song>
</root>
Tag XML Document, includes counts for it's child objects
<root>
<tag id="2481">
<name>Rock & Roll</name>
<albums>84</albums>
<artists>29</artists>
<songs>239</songs>
<video>13</video>
<playlist>2</playlist>
<stream>6</stream>
</tag>
</root>
Playlist XML Document, includes counts for it's child objects
<root>
<playlist id="1234">
<name>The Good Stuff</name>
<owner>Karl Vollmer</owner>
<items>50</items>
<tag id="2481" count="2">Rock & Roll</tag>
<tag id="2482" count="2">Rock</tag>
<tag id="2483" count="1">Roll</tag>
<type>Public</type>
</playlist>
</root>
Video XML Document -- Attention UIDs for video elements are non-unique against song.id
<root>
<video id="1234">
<title>Futurama Bender's Big Score</title>
<mime>video/avi</mime>
<resolution>720x288</resolution>
<size>Video Filesize in Bytes</size>
<tag id="12131" count="3">Futurama</tag>
<tag id="32411" count="1">Movie</tag>
<url>http://localhost/play/index.php?oid=123908...</url>
</video>
</root>