Hi all,
I am new to using the Twitch API and I am trying to get the game analytics data for our games. Currently trying to implement this in R. I keep getting access denied when trying the request for game analytics and I am not sure what I am doing wrong.
First thing I did was making an registering an app as an analytical tool and got an app token via the following request (I am mostly using httr R package and RStudio’s terminal):
token <- POST(“https://id.twitch.tv/oauth2/token?client_id=&client_secret=&grant_type=client_credentials&scope=analytics:read:games”)
I got this response:
Date: 2018-09-20 11:00
Status: 200
Content-Type: application/json
Size: 93 B
{“access_token”:“somecharacterstring”,“expires_in”:4706070,“token_type”:“bearer”}
Then i sent the request with:
curl -H “Authorization: Bearer somecharacterstring”-X GET https://api.twitch.tv/helix/analytics/games
I tried also with
curl -H “Authorization: OAuth somecharacterstring”-X GET https://api.twitch.tv/helix/analytics/games
In both cases I keep getting error:
curl: (6) Could not resolve host: GET
{“error”:“Unauthorized”,“status”:401,“message”:“Must provide a valid Client-ID or OAuth token”}
I am sorry if the formatting looks off, but I have not found any options for code snippets.
Thanks in advance for your input!