[GH-ISSUE #192] getMyTop() don't work! #129

Closed
opened 2026-02-27 19:26:12 +03:00 by kerem · 2 comments
Owner

Originally created by @Eredasu on GitHub (May 10, 2020).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/192

Hi! Like the title says, $api->getMyTop($type) don't really want to work. When I use it, i got an error on the sendRequest() !

error

Maybe the problem just come from me, but I'm pretty new with PHP so don't be rude ! I'm dropping my code too, if maybe I make a big mistake there. Thank's you!

code

Originally created by @Eredasu on GitHub (May 10, 2020). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/192 Hi! Like the title says, $api->getMyTop($type) don't really want to work. When I use it, i got an error on the sendRequest() ! ![error](https://user-images.githubusercontent.com/32577573/81497122-b536dd00-92bc-11ea-9b5b-94037ab3475d.png) Maybe the problem just come from me, but I'm pretty new with PHP so don't be rude ! I'm dropping my code too, if maybe I make a big mistake there. Thank's you! ![code](https://user-images.githubusercontent.com/32577573/81497231-6a699500-92bd-11ea-96b0-06d98fe5d6ad.png)
kerem 2026-02-27 19:26:12 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jwilsson commented on GitHub (May 10, 2020):

Hey!
The code looks good! However, you seem to have missed the user-top-read scope. Add it to the scope array and it should work.

$options = [
        'scope' => [
            'user-read-email',
            'user-top-read',
        ],
    ];
<!-- gh-comment-id:626318171 --> @jwilsson commented on GitHub (May 10, 2020): Hey! The code looks good! However, you seem to have missed the `user-top-read` scope. Add it to the `scope` array and it should work. ```php $options = [ 'scope' => [ 'user-read-email', 'user-top-read', ], ]; ```
Author
Owner

@Eredasu commented on GitHub (May 10, 2020):

Yeah that's it! Thank's a lot!

<!-- gh-comment-id:626340871 --> @Eredasu commented on GitHub (May 10, 2020): Yeah that's it! Thank's a lot!
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#129
No description provided.