JolitaGrazyte / discogs-api

A simple Discogs Api Wrapper that uses Guzzle7.
MIT License
10 stars 6 forks source link

Fatal error: Uncaught TypeError: Argument 1 passed to Jolita\DiscogsApi\DiscogsApi::__construct() #2

Closed pierre-dickinson closed 6 years ago

pierre-dickinson commented 6 years ago

Hi, i try to use your package but i get this error Fatal error: Uncaught TypeError: Argument 1 passed to Jolita\DiscogsApi\DiscogsApi::__construct() must be an instance of GuzzleHttp\Client, string given

here is my code

$discogs = new DiscogsApi('MYCONSUMERKEY', 'MYCONSUMERSECRET', 'myuseragentname/0.1 +https://app.myapp.local');

//get artist with id 1
$artist = $discogs->artist('1');

please add some examples to connect correctly with discogs api.

Thanks for your help

pierre-dickinson commented 6 years ago

Nevermind, i have manage to connect my app to the api like this $client = new \GuzzleHttp\Client(); $res = $client->request('GET', 'https://api.discogs.com');

$discogs = new DiscogsApi($client, 'mytoken', 'myappName/0.1 +https://app.myappname.org');

i had a 403 error with this kind of url extension : https://app.myappname.local

it would be awesome if you could enrich your examples in the readme file ;-)