I’m preparing my own web application for upcoming update Twitch Helix
Is it possible to use token OAuth and Refresh token for one user (administrator) to get information about other Twitch channels? Will this work after upcoming updating ?
Here are two examples from Guzzle:
-
Webhook
$client = new Client();
$result = $client->post(‘https://api.twitch.tv/helix/webhooks/hub’, [
‘http_errors’ => false,
‘headers’ => [
‘Authorization’ => 'Bearer '. $user->token,
‘Client-ID’ => ‘CLIENT ID’,
],
‘form_params’ => [
‘hub.mode’ => ‘subscribe’,
‘hub.topic’ => ‘https://api.twitch.tv/helix/streams?user_id=’. $user->account_id,
‘hub.callback’ => ‘/hub/’. $user->id,
‘hub.lease_seconds’ => ‘864000’,
‘hub.secret’ => ‘secret’,
]
]);
$response = json_decode($result->getBody()); -
Checking online for multiple users
$client = new Client();
$result = $client->get(‘https://api.twitch.tv/helix/streams?user_id=504826660?user_id=504826660&user_id=96204429’, [
‘http_errors’ => false,
‘headers’ => [
‘Authorization’ => 'Bearer '. $user->token,
‘Client-ID’ => ‘CLIENT ID’,
]
]);
$response = json_decode($result->getBody());
Today everything is working even without indication Client_id