moods

Get the list of all available moods.

Parameters

  • api_key - developer key
  • callback (optional) - callback function name for a JSONP request

Request Example

http://developers.musicshake.com/api/moods?api_key=YOUR_API_KEY

Response Example

[
	{"mood_id":"1","mood_name":"Cloudy"},
	{"mood_id":"2","mood_name":"Hopeful"},
	{"mood_id":"3","mood_name":"Fresh"},
	{"mood_id":"4","mood_name":"Dramatic"},
	{"mood_id":"5","mood_name":"Anticipation"},
	{"mood_id":"6","mood_name":"Calm"},
	{"mood_id":"7","mood_name":"Comfort"},
	{"mood_id":"8","mood_name":"Romantic"},
	{"mood_id":"9","mood_name":"Holiday"},
	{"mood_id":"10","mood_name":"Melancholy"},
	{"mood_id":"11","mood_name":"Warm"},
	{"mood_id":"12","mood_name":"Gentle"},
	{"mood_id":"13","mood_name":"Energetic"},
	{"mood_id":"14","mood_name":"Freedom"},
	{"mood_id":"15","mood_name":"Leisurely"},
	{"mood_id":"16","mood_name":"Lonesome"},
	{"mood_id":"17","mood_name":"Wedding"},
	{"mood_id":"18","mood_name":"Sad"},
	{"mood_id":"19","mood_name":"Passionate"}
]

ActionScript Example

import com.adobe.serialization.json.JSON;
import flash.net.URLLoader;
import flash.events.Event;
import flash.events.IOErrorEvent;

private function loadCategories():void
{
	var requestURL:String = "http://developers.musicshake.com/api/moods?api_key=YOUR_API_KEY";
	
	var ul:URLLoader = new URLLoader();
	ul.addEventListener(IOErrorEvent.IO_ERROR, onURLLoaderError);
	ul.addEventListener(Event.COMPLETE, onURLLoaderComplete);
	
	try {
		ul.load(new URLRequest(requestURL));
	} catch (error:SecurityError) {
	}
}

private function onURLLoaderError(error:Error):void
{
}

private function onURLLoaderComplete(event:Event):void
{
	var o:Object = JSON.decode(event.target.data);
	
	for each (var mood:Object in o.moods) {
		trace("id="+mood.mood_id + ", name="+mood.mood_name);
	}
}