Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/drsounds/spotify-web-api-wrapper-php

PHP wrapper for the Spotify web API
https://github.com/drsounds/spotify-web-api-wrapper-php

Last synced: 6 days ago
JSON representation

PHP wrapper for the Spotify web API

Awesome Lists containing this project

README

        

spotify-web-api-wrapper-php
===========================

PHP wrapper for the Spotify web API

Work in progress.

# Getting started

Let say you have an php site in this folder,

Place the Spotify.php in your vendor, and create a basic api connection header

spotify.inc.php



Then create a login page, login.php

startAuthorization($scope);
$spotifyApi->startAuthorization();
?>

Let say you created a callback.php in the same directory as the login.php, just create a callback.php there (assume the pages we create can be reached at http://localhost/)

requestToken();
// Store the refresh token and access token in your database
$access_token = $token['access_token'];
$refresh_token = $token['refresh_token'];
// Then 'install' the token into the class instance
$spotifyApi->authorize($token['access_token']);
?>