4

Is it possible to get INSTAGRAM user details through API from localhost ?

Because I am trying to doing this from localhost but unable to fetch the information. After click the login url it redirect me to the INSTAGRAM and after successfully login and authorize the apps it redirect me properly in my callback URL with code. But when I am trying to fetch the info (cURL) using access token then it return null.

But same code run perfectly in live.

Trissa Panda
  • 73
  • 1
  • 1
  • 7

4 Answers4

5

Make sure the Curl option CURLOPT_SSL_VERIFYPEER is set to false. Find the Curl request in your code and add or edit an option that will look something like this:

$ch = curl_init();
...
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  <<-- Add this line
Jeff S.
  • 1,201
  • 1
  • 14
  • 17
1

Ultimately I resolved the problem. now I am able to connect to Instagram.

I use the CodeIgniter Instagram Library by Ian Luckraft. In config file I just change the

$config['instagram_ssl_verify'] = FALSE;

By default it was TRUE.

sica07
  • 4,896
  • 8
  • 35
  • 54
Trissa Panda
  • 73
  • 1
  • 1
  • 7
-1

Yes it is possible.
You can try using Instagram api wrapper which is made by Galen Grover
https://github.com/galen/PHP-Instagram-API Mine's works just fine

Willy Pt
  • 1,795
  • 12
  • 20
-1
in instagram .config.php in your localhost 
you must  set 'apiCallback' =>

to  'http://localhost/instagram/instagram/'


folder of your success.php


<?php
// Setup class
  $instagram = new Instagram(array(
    'apiKey'      => '',
    'apiSecret'   => '',
    'a
?>piCallback' => 'http://localhost/instagram/instagram/' // must point to success.php
  ));
Saltern
  • 1,305
  • 2
  • 16
  • 42