Creating Requests
All requests to the ShareMyPlaylists.com REST API must use the GET method. It is important to note that a simple level of authentication is implemented within the API. To show this we will use the following example URL, which returns the 10 most recently submitted playlists:
http://sharemyplaylists.com/api/v2?method=smp.playlists.getList&page=1&per_page=10&orderby=created&orderby_direction=DESC
All requests must contain two additional parameters; your public_key & a signature. Your public_key is given to you when you sign up for API access. The signature parameter is created by connecting your public key, private key and a current timestamp into a single sring and then performing a sha256 hash on that value. For instance, in PHP this would look like:
<?php
$public_key = 'mypublickey123';
$private_key = 'myprivatekey123';
$timestamp = time();
$signature = hash('sha256', $public_key.$private_key.$timestamp);
?>
The URL will now look like the following example, where mypublickey123 is replaced with your actual public_key value and the signature has been populated:
http://sharemyplaylists.com/api/v2?method=smp.playlists.getList&page=1&per_page=10&orderby=created&orderby_direction=DESC&public_key=mypublickey123&signature=adf57e3b74bf768b1362196404fc84d5eb4ed518