Advertisement
EurenikZ

Twitch API: access_token bekommen

May 24th, 2020 (edited)
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2. $client_id = 'XXX'; // Aus PHP-Script vom Bot entnehmen
  3. $client_secret = 'XXX'; // Aus KeePass entnehmen
  4.  
  5. $post = [
  6.     'client_id' => $client_id,
  7.     'client_secret' => $client_secret,
  8.     'grant_type' => 'client_credentials',
  9. ];
  10.  
  11. $ch = curl_init('https://id.twitch.tv/oauth2/token');
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  13. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  14. $response = curl_exec($ch);
  15. curl_close($ch);
  16.  
  17. echo $response;
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement