Skip to content

Catch additional prams in user details response - #3

Open
imaimai86 wants to merge 1 commit into
jonjomckay:developfrom
imaimai86:patch-3
Open

Catch additional prams in user details response#3
imaimai86 wants to merge 1 commit into
jonjomckay:developfrom
imaimai86:patch-3

Conversation

@imaimai86

@imaimai86 imaimai86 commented Oct 9, 2017

Copy link
Copy Markdown
Contributor

When the access token has more scope of access, the user details endpoint will return additional data than catch in the function userDetails.
Additional params includes following

  • birthdate
  • country
  • followers
  • product

Also we can use these details to check if the user has premium account.

Response of user details request when access token has more scopes including following

  • user-read-private
  • user-read-birthdate
  • user-read-email

stdClass object {
birthdate => (string) 1984-03-23
country => (string) GB
display_name => null
email => (string) xxx@xxx.com
external_urls => stdClass object {
spotify => (string) https://open.spotify.com/user/xxx
}
followers => stdClass object {
href => null
total => (int) 0
}
href => (string) https://api.spotify.com/v1/users/xxx
id => (string) xxx
images => array(1) (
[0] => stdClass object {
height => null
url => (string) https://profile-images.scdn.co/images/userprofile/default/xxx
width => null
}
)
product => (string) premium
type => (string) user
uri => (string) spotify:user:xxx
}

When the access token has more scope of access, the user details endpoint will return additional data than catch in the function userDetails. Also we can use these details to check if the user has premium account.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant