4

是否可以通过localhost的 API获取INSTAGRAM用户详细信息?

因为我试图从 localhost 执行此操作但无法获取信息。单击登录 url 后,它将我重定向到INSTAGRAM,并在成功登录并授权应用程序后,它使用代码在我的回调 URL 中正确重定向我。但是,当我尝试使用访问令牌获取信息(cURL)时,它会返回 null。

但是相同的代码可以在现场完美运行。

4

4 回答 4

6

确保将Curl 选项CURLOPT_SSL_VERIFYPEER 设置为 false。在您的代码中找到 Curl 请求并添加或编辑如下所示的选项:

$ch = curl_init();
...
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  <<-- Add this line
于 2013-07-31T05:24:23.087 回答
1

最终我解决了这个问题。现在我可以连接到Instagram了。

我使用Ian Luckraft 的 CodeIgniter Instagram 库。在配置文件中,我只是更改

$config['instagram_ssl_verify'] = FALSE;

默认情况下是TRUE.

于 2013-06-06T09:41:47.810 回答
-1

对的,这是可能的。
您可以尝试使用由 Galen Grover
https://github.com/galen/PHP-Instagram-API制作的 Instagram api 包装器 我的作品很好

于 2013-05-03T12:28:52.490 回答
-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
  ));
于 2015-02-28T09:44:48.543 回答