Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. $payload = '{
  2.  "client_id": "'.OAUTH2_CLIENT_ID.'",
  3.  "client_secret": "'.OAUTH2_CLIENT_SECRET.'",
  4.  "grant_type": "authorization_code",
  5.  "code": "'.$code.'",
  6.  "redirect_url": "'.$redirect.'",
  7.  "scope": "identify guilds"
  8. }';
  9.    
  10. $curl = curl_init();
  11. curl_setopt($curl, CURLOPT_URL, $token_url);
  12. curl_setopt($curl, CURLOPT_POST, 1);
  13. curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
  14. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  15. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  16. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  17. curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(json_decode($payload)));
  18. $api_ruser = curl_exec($curl);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement