1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
$clientId = 'qqqxxx';
$redirectUrl = 'aaayyy';
$url = 'https://instagram.com/oauth/authorize/?client_id=' . $clientId . '&redirect_uri=' . $redirectUrl . '&response_type=token';
$userCredentials = array(
'username' => 'xxx',
'password' => 'yyy'
);
$userCredentials = http_build_query($userCredentials);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $userCredentials);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION,1);
$result = curl_exec($curl);
var_dump($result); |
Partager