Users

This section of the API handles retrieval of news data. All requests must be authenticated as covered in the introduction.

smp.news.getList

The following URL will get 2 news articles, ordered by the date it was published.

http://playlists.net/api/v2?method=smp.news.getList&page=1&per_page=2

It will return an array of results similar to the following.

{
"status":"ok",
"news":[
    {
        "id":"1286",
        "title":"RIP CLAUDE NOBS by soundofus.com ",
        "slug":"rip-claude-nobs-by-soundofuscom-1",
        "review":"From Miles Davis to Ray Charles to Prince, some of the biggest and best acts in the history of music have played the Montreux jazz festival. And it''s all thanks to Claude Nobs. \r\n\r\nThe founder of the event died last week, and SMP user soundofus.com has put together this fitting playlist tribute, which features almost five hours of acts that have took to the famous stage in Switzerland. This year's festival, in July, is sure to be a special one. \r\n",
        "review_formatted":"From Miles Davis to Ray Charles to Prince, some of the biggest and best acts in the history of music have played the Montreux jazz festival. And it''s all thanks to Claude Nobs. 
\r\n
\r\nThe founder of the event died last week, and SMP user soundofus.com has put together this fitting playlist tribute, which features almost five hours of acts that have took to the famous stage in Switzerland. This year's festival, in July, is sure to be a special one.
\r\n", "playlist_uri":"spotify:user:ga8:playlist:77ygPpbySUmjwzHg0QRmr2", "album_uri":"", "rating":"6", "created":"2013-01-12 22:08:01", "created_formatted":"12\/01\/2013", "uri":"http:\/\/playlists.net\/rip-claude-nobs-by-soundofuscom-1", "playlist":{ "id":"155254", "title":"RIP CLAUDE NOBS by soundofus.com", "playcount":"17", "created":"2013-01-12 10:52:58", "created_formatted":"12\/01\/2013", "uri":"http:\/\/playlists.net\/rip-claude-nobs-by-soundofuscom", "description":"Claude Nobs (February 4, 1936 – January 10, 2013) was the founder and general manager of the famous Montreux Jazz Festival in Switzerland.
\r\n
\r\nHere is a selection of live tracks avaiable on Spotify., as a tribute to his fantastic work.", "description_featured":"", "playlist_uri":"spotify:user:ga8:playlist:77ygPpbySUmjwzHg0QRmr2", "slug":"rip-claude-nobs-by-soundofuscom", "total_tracks":"34", "duration":"", "duration_formatted":false, "image":"https:\/\/s3.amazonaws.com\/smpv2-playlists-image-large\/155254.jpg", "image_l":"https:\/\/s3.amazonaws.com\/smpv2-playlists-image-large\/155254.jpg", "image_m":"https:\/\/s3.amazonaws.com\/smpv2-playlists-image-medium\/155254.jpg", "image_s":"https:\/\/s3.amazonaws.com\/smpv2-playlists-image-small\/155254.jpg" } }, { "id":"1285", "title":"Defected Playlist: Ibiza Classics ", "slug":"defected-playlist-ibiza-classics-1", "review":"Picture the scene: the sun's high above the clear blue sea; the beach is littered with beautiful, bronzed hedonists; you're dancing in your swimwear, an ice cold vodka limon in your hand. What are you listening to? \r\n\r\nClassic tracks, Ibizan institutions, Balearic bangers by artists such as Paul Johnson, Masters at Work, Dennis Ferrer, Sebo K, Armand Van Helden, Silicone Soul, Deep Dish and many, many more. We can but dream. A great weekend playlist, regardless. ", "review_formatted":"Picture the scene: the sun's high above the clear blue sea; the beach is littered with beautiful, bronzed hedonists; you're dancing in your swimwear, an ice cold vodka limon in your hand. What are you listening to?
\r\n
\r\nClassic tracks, Ibizan institutions, Balearic bangers by artists such as Paul Johnson, Masters at Work, Dennis Ferrer, Sebo K, Armand Van Helden, Silicone Soul, Deep Dish and many, many more. We can but dream. A great weekend playlist, regardless. ", "playlist_uri":"spotify:user:1134897026:playlist:37r2cMQuBZf4cFkjHbcdxr", "album_uri":"", "rating":"9", "created":"2013-01-11 21:47:46", "created_formatted":"11\/01\/2013", "uri":"http:\/\/playlists.net\/defected-playlist-ibiza-classics-1", "playlist":{ "id":"155163", "title":"Defected Playlist: Ibiza Classics", "playcount":"65", "created":"2013-01-11 15:14:24", "created_formatted":"11\/01\/2013", "uri":"http:\/\/playlists.net\/defected-playlist-ibiza-classics", "description":"An official Defected In The House Ibiza Classics playlist. ", "description_featured":"An official Defected In The House Ibiza Classics playlist.", "playlist_uri":"spotify:user:1134897026:playlist:37r2cMQuBZf4cFkjHbcdxr", "slug":"defected-playlist-ibiza-classics", "total_tracks":"86", "duration":"", "duration_formatted":false, "image":"https:\/\/s3.amazonaws.com\/smpv2-playlists-image-large\/155163.jpg", "image_l":"https:\/\/s3.amazonaws.com\/smpv2-playlists-image-large\/155163.jpg", "image_m":"https:\/\/s3.amazonaws.com\/smpv2-playlists-image-medium\/155163.jpg", "image_s":"https:\/\/s3.amazonaws.com\/smpv2-playlists-image-small\/155163.jpg" } } ], "page":1, "per_page":"2", "total_records":216 }

PHP SDK

require_once "ShareMyPlaylists.php";

$public = "{your_public_key}";
$private = "{your_private_key}";

$smp = new ShareMyPlaylists_Api($public, $private);

$parameters = array(
	"page" => 1,
	"per_page" => 2
);

$get_list = $smp->api("news.getList", $parameters);

$news = $get_list["news"];

foreach( $news as $news_item )
{
	print "".$news_item["title"]."<br />";
}