[PHP] GET user email

Hey guys!
I saw this Example Response on github with the
Authenticated, required scope: user_read request.

   {
  "type": "user",
  "name": "test_user1",
  "created_at": "2011-06-03T17:49:19Z",
  "updated_at": "2012-06-18T17:19:57Z",
  "_links": {
    "self": "https://api.twitch.tv/kraken/users/test_user1"
  },
  "logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_user1-profile_image-62e8318af864d6d7-300x300.jpeg",
  "_id": 22761313,
  "display_name": "test_user1",
  "email": "asdf@asdf.com",
  "partnered": true,
  "bio": "test bio woo I'm a test user"
}

I’m able to get my oauth code and request some info with :
https://api.twitch.tv/kraken?oauth_token=OAUTH
And I get this :

{"_links":{"user":"https://api.twitch.tv/kraken/user","channel":"https://api.twitch.tv/kraken/channel","search":"https://api.twitch.tv/kraken/search","streams":"https://api.twitch.tv/kraken/streams/******","ingests":"https://api.twitch.tv/kraken/ingests","teams":"https://api.twitch.tv/kraken/teams","users":"https://api.twitch.tv/kraken/users/******","channels":"https://api.twitch.tv/kraken/channels/******","chat":"https://api.twitch.tv/kraken/chat/******"},"token":{"valid":true,"authorization":{"scopes":["user_read"],"created_at":"2014-12-06T22:42:24.48719Z","updated_at":"2014-12-07T03:38:44.843441Z"},"user_name":"******"}}

The question is, how do I request the Authenticated, required scope: user_read info with php curl so I can get the email adres. There is no info on the net about getting this done with php, so I hope you can help me!

Thank you

You made a request to the token checking endpoint you need to make a request with the OAuth token you have to the user end point

https://api.twitch.tv/kraken/user?oauth_token=OAUTH

Here is a link to the user end point docs.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.