You are on page 1of 3

Doc for the currently used API. Let me know if I have missed something.

URL: /app/playlist.php
Required parameters: access_code - the access code to the individual client apikey - the API Key (2036d6ab91fd21da5d39128da4273ee027bb80ac) client_id - the client ID, from the hop_client table. Optional parameters nolibrary - if specified, the response will not contain the library. Can be used if the app wish to keep a cache of the playlist A 1000-songs playlist is typically 100k (15k if the gzip content-encoding is supported) It would be relevant, in future development, to find a way not to request it every time. Response (JSON) { "status": "success" or "failure" , "list": [ { "songTitle" : "The song title" , "artistName" : "The artist" , "genre" : "The genre" (may be omitted) , "requestedBy" : "The full name of the user who requested it. Can be empty" , "requestedByImage" : "The URL of the image of the user who requested it. Can be empty or invalid (user-supplied)" , "songId" : Positive signed integer (0 to 2147483647). Song unique identifier. Used to request the image for this song. Independed from the client. } ] , "currentSong": { (same as individual list entries above) } , "library": [ { (same as individual list entries above, plus...) , "fileId" : Positive signed integer (0 to 2147483647), independant from the songId. Represents a single file for a client, dependent to client_id. Used to request this entry from this client in request-song.php , "status" : "active" or "now" (playing) or "next" (next to play) or "requested" (will play soon) or "recent" (played in the last 30 minutes) } ]

, "lastPlaylistUpdate" : "2012-11-01 11:10:40" (last time the playlist was changed for this client. song status change does not modify this field) , "imageurl" : "http:\/\/anuragramdasan.com\/images\/?apikey=%apikey%&song_id=%songId%&size=%size% " - the URL to use to request any song image. Replace %apikey% with the API key, %songId% with the song_id and %size% by either 0 (original size) or 200 (200-pixels-width resized image) }

URL: /app/request-song.php
Required parameters: apikey - the API Key client_id - the client ID, from the hop_client table. requested_by - the User ID requesting that song file_id - the file ID from the playlist library. Response (JSON) { 'status' : 'success' or 'failure' , 'message' : empty when success. when failure, can be 'usernotfound' or 'songnotfound' or 'exists' (already in req list) or 'recent' (played in the last 30 min) , 'fileId' : file id , 'requestedBy' : requested_by }

URL: /app/clientlist.php
Required parameters: none. Response (JSON) { "statuscode": STATUS_SUCCESS or STATUS_INTERNAL_SERVER_ERROR , "clients": [ { "client_id" : client id (positive signed integer) , "client_name" : client name , 'online' : boolean , 'place' : street address , 'location' : city ); } ] }

Only ONLINE clients within 10kms range are listed. An online client is one for which the winamp plugin gave sign of life in the last 5 minutes

You might also like