首页 文章

Instagram API实时照片更新无法正常工作

提问于
浏览
3

我正在使用Instagram的实时图片网址(http://instagram.com/developer/realtime/),我可以成功订阅,因为它返回此详细信息:

Array
(
    [meta] => Array
        (
            [code] => 200
        )

    [data] => Array
        (
            [object] => user
            [object_id] => 
            [aspect] => media
            [callback_url] => http://example.com/instagram/
            [type] => subscription
            [id] => 123456
        )

)

但是当用户上传新照片时,我的回调网址上没有发送任何更新 . 这是我的回调网址上的代码:

mail("myemail@gmail.com","im here","I entered here"); #check if it really does enter here    
if(isset($_GET['hub_challenge']))
{
    echo $_GET['hub_challenge'];
}
else
{
    #It should enter here if user uploads a new photo
    $data = file_get_contents('php://input');
    $data = json_decode($data);
    ...some of my codes...brevity...
}

我注意到我没有收到更新,因为您可以在我的代码中看到,每次我的回调网址上发生某些事情时,它都会向我发送电子邮件 . 所以我没有收到任何电子邮件,即使我已经检查了我的垃圾邮件文件夹 .

Instagram实时照片更新API真的下降了吗?或者我需要做些什么?

对你的帮助表示感谢!谢谢! :)

1 回答

  • 1

    有必要通过授权APIinstagram或遵循授权应用程序文档中指定的链接

    https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code

    之后,POST请求开始进入回调URL

相关问题