[GH-ISSUE #85] "No token provided" error #45

Closed
opened 2026-02-27 19:25:45 +03:00 by kerem · 4 comments
Owner

Originally created by @hakhagmon on GitHub (Jun 1, 2017).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/85

`PHP Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: No token provided in spoty\vendor\jwilsson\spotify-web-api-php\src\Request.php:39

Stack trace:
#0 spoty\vendor\jwilsson\spotify-web-api-php\src\Request.php(240): SpotifyWebAPI\Request->parseBody(Object(stdClass), 401)

#1 spoty\vendor\jwilsson\spotify-web-api-php\src\Request.php(108): SpotifyWebAPI\Request->send('GET', 'https://api.spo...', 'offset=0', Array)

#2 spoty\vendor\jwilsson\spotify-web-api-php\src\SpotifyWebAPI.php(561): SpotifyWebAPI\Request->api('GET', '/v1/artists/0rd...', Array, Array)

#3 spoty\spotycount.php(32): SpotifyWebAPI\SpotifyWebAPI->getArtistAlbums('0rdOduCP1sLQHOM...', Array)`

¯ \ _ (ツ) _ / ¯

Originally created by @hakhagmon on GitHub (Jun 1, 2017). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/85 `PHP Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: No token provided in spoty\vendor\jwilsson\spotify-web-api-php\src\Request.php:39 Stack trace: #0 spoty\vendor\jwilsson\spotify-web-api-php\src\Request.php(240): SpotifyWebAPI\Request->parseBody(Object(stdClass), 401) #1 spoty\vendor\jwilsson\spotify-web-api-php\src\Request.php(108): SpotifyWebAPI\Request->send('GET', 'https://api.spo...', 'offset=0', Array) #2 spoty\vendor\jwilsson\spotify-web-api-php\src\SpotifyWebAPI.php(561): SpotifyWebAPI\Request->api('GET', '/v1/artists/0rd...', Array, Array) #3 spoty\spotycount.php(32): SpotifyWebAPI\SpotifyWebAPI->getArtistAlbums('0rdOduCP1sLQHOM...', Array)` ¯ \ _ (ツ) _ / ¯
kerem 2026-02-27 19:25:45 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jwilsson commented on GitHub (Jun 1, 2017):

This sounds it's related to Spotify's change on May 29th where they started requiring access tokens for all requests (see this blog post).

I'm guessing you're not requesting any user information so the Client Credentials Flow should be enough for your use case.

<!-- gh-comment-id:305515757 --> @jwilsson commented on GitHub (Jun 1, 2017): This sounds it's related to Spotify's change on May 29th where they started requiring access tokens for all requests ([see this blog post](https://developer.spotify.com/news-stories/2017/01/27/removing-unauthenticated-calls-to-the-web-api/)). I'm guessing you're not requesting any user information so the [Client Credentials Flow](https://github.com/jwilsson/spotify-web-api-php/blob/master/docs/examples/access-token-with-client-credentials-flow.md) should be enough for your use case.
Author
Owner

@jwilsson commented on GitHub (Jun 1, 2017):

Sorry, I messed up the link to the blog post. Here's the correct one: https://developer.spotify.com/news-stories/2017/01/27/removing-unauthenticated-calls-to-the-web-api/

<!-- gh-comment-id:305609942 --> @jwilsson commented on GitHub (Jun 1, 2017): Sorry, I messed up the link to the blog post. Here's the correct one: https://developer.spotify.com/news-stories/2017/01/27/removing-unauthenticated-calls-to-the-web-api/
Author
Owner

@hakhagmon commented on GitHub (Jun 1, 2017):

thx!
Added this and everything turned out well

<!-- gh-comment-id:305631122 --> @hakhagmon commented on GitHub (Jun 1, 2017): thx! [Added this and everything turned out well](https://github.com/jwilsson/spotify-web-api-php/blob/master/docs/examples/access-token-with-client-credentials-flow.md)
Author
Owner

@jwilsson commented on GitHub (Jun 2, 2017):

Great, glad to hear it worked out!

<!-- gh-comment-id:305695733 --> @jwilsson commented on GitHub (Jun 2, 2017): Great, glad to hear it worked out!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#45
No description provided.