Hi
I try to get an authorization_code with https://api.twitch.tv/kraken/oauth2/token with correct params but it return JSON code with status 404, it is normal ? I have try with /helix and /api but issue is same…
People know a solution with my issue ?
3ventic
December 18, 2017, 6:05am
2
1 Like
Yes, i have already make the same request before but now i have always 404 response code…
I try with some system but currently the result is same, 404 response code
Any people can confirm i can get access_token with curl in php ?
3ventic
December 18, 2017, 8:15am
6
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.twitch.tv/kraken/oauth2/token');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'client_id' => $CLID,
'client_secret' => $SECRET,
'grant_type' => 'authorization_code',
'redirect_uri' => $REDIRECT_URI,
'code' => $_GET['code']
]));
$output = curl_exec($ch);
curl_close($ch);
$oauth = json_decode($output, true);
// $oauth['access_token'] is user's oauth token
is what works for me
1 Like
It’s curious i have no value in oauth I don’t understand what is your php version ?
Curious i’m with php 7.0.26 I have no result… Do you have an alternative code with php ?
On execution, the value $oauth = null if i print or var_dump it
Solution find ! Thank you for your help I’m just too tired I think xP I have forget to define the right redirect_uri x)
1 Like
system
Closed
January 17, 2018, 8:57am
12
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.