dev-master
9999999-devAllows to swap tokens with the Spotify API
MIT
The Development Requires
by Renan GEHAN
by Timothe PEARCE
1.0.4
1.0.4.0Allows to swap tokens with the Spotify API
MIT
The Development Requires
by Renan GEHAN
by Timothe PEARCE
Wallogit.com
2017 © Pedro Peláez
Allows to swap tokens with the Spotify API
Simply require it with composer
composer require emphaz/spotify-token-swap-php, (*1)
Only curl is required for the module to work., (*2)
<?php
use emphaz\SpotifyTokenSwapper\SpotifyTokenSwapper;
$tokenSwapper = new SpotifyTokenSwapper([
'client_id' => '5865db6d15f808d916b77bed10993c2e',
'secret' => '7f5e0e0041afbf6bcda64352f84f121f',
'callback_url' => 'my-super-callback://callback'
]);
// If we received a token from some SDK, or other service
if(isset($_POST['code']))
{
$data = $tokenSwapper->swapAuthCode($_POST['code']);
var_dump($data);
/*
Outputs:
(
[access_token] => RANDOM_ACCESS_TOKEN
[token_type] => Bearer
[expires_in] => 3600
[refresh_token] => RANDOM_REFRESH_TOKEN
[scope] => user-follow-read user-read-email user-read-private
)
*/
}
Allows to swap tokens with the Spotify API
MIT
Allows to swap tokens with the Spotify API
MIT