Last active
January 12, 2016 05:52
-
-
Save anehkumar/527d7da72120634b8baa to your computer and use it in GitHub Desktop.
Get Access token from Instagram using code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$handle = curl_init("https://api.instagram.com/oauth/access_token"); | |
curl_setopt($handle, CURLOPT_POST, true); | |
curl_setopt($handle, CURLOPT_POSTFIELDS, array( | |
"client_id" => "<your_client_id>", | |
"client_secret" => "<your_secret>", | |
"grant_type" => "authorization_code", | |
"redirect_uri" => "http://localhost:8080/instagram/", | |
"code" => "3c4e17fe802844099e24a3df4e659f6e", | |
)); | |
curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1); | |
$output = curl_exec($handle); | |
curl_close($handle); | |
echo "<pre>"; | |
print_r($output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment