milindsingh / php-discogs-api-example

Example implementation for php-discogs-api and OAuth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OAuth example php-discogs-api

This repository is a quick example of how to obtain an OAuth token and how to make use of the protected endpoints from the Discogs API.

Installation

Clone this repository and install the dependencies:

$ composer install

Add your consumer key and secret in $consumerKey and $consumerSecret.

For the sake of simplicity we're using the PHP internal webserver (quick and easy):

$ cd web
$ php -S localhost:8000

Now open your favorite browser and visit http://localhost:8000

How it works

As soon as you open the site, you'll be redirect to Discogs. After authorizing you'll be redirected to the site and now you have a OAuth token and secret with which you'll be able to access the protected endpoints.

This example is just some quick hacking together but I think it's enough to get you started.

About

Example implementation for php-discogs-api and OAuth


Languages

Language:PHP 100.0%