Strict Standards: Declaration of base_page::setOutput() should be compatible with base::setOutput() in /data/premium-dev/application/controllers/base/base_page.php on line 8

Strict Standards: Declaration of base_page::printErrorAndExit() should be compatible with base::printErrorAndExit() in /data/premium-dev/application/controllers/base/base_page.php on line 8
Musicshake API for developers - mp3

mp3

Get the MP3 URL for HTTP song download.

Parameters

  • api_key - developer key
  • song_id - the song ID obtained from the songlist method
  • callback (optional) - callback function for a JSONP request

Request Example

http://developers.musicshake.com/api/mp3?api_key=YOUR_API_KEY&song_id=661

Response Example

{"url":"http:\/\/d21fekboy1ymzq.cloudfront.net\/audioswap\/490\/948\/8d0cb38f-7e9d-43a0-b47a-06be793f8d34.mp3"}

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-staging.musicshake.com/api/mp3?api_key=YOUR_API_KEY&song_id=661";
	
	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
{
	trace(o.url);
}