Instagram API. “Unable to reach callback url”

对着背影说爱祢 提交于 2019-12-10 14:17:57

问题


Ok guys so here is the setup. I am developing a site for a festival and need to use the Instragram API. The client would like to automatically load pictures from Instagram that use a certain hashtag. No problem here, the instagram API supports this function and many more.

But when I try to make a subscription (via a cURL Post Operation) I get an error response that my callback-url is unreachable. But it is reachable. I can surf to it via the browser no problem.

My cURL operation looks like this:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, count($postData));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
$result = curl_exec($ch);       
curl_close($ch);    

and this is the response I get after executing the post operation above:

{"meta":{"error_type":"APISubscriptionError","code":400,"error_message":"Unable to reach callback URL \"...myUrl...\"."}}

Any instagram guru's online that know what I'm doing wrong?

Note: I've tried to subscribe in both my callback-url file/api aswell as in an apart php file.


回答1:


If you're using your home computer to develop it make sure the callback url you provided to instagram's servers can be reached (from their side)

You may have a firewall on your computer (make sure you allow incoming connections)
Or try running your code on a remote server (if you're not already)



来源:https://stackoverflow.com/questions/9839959/instagram-api-unable-to-reach-callback-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!