Instagram subscription - Unable to reach callback URL [duplicate]

两盒软妹~` 提交于 2019-12-09 01:17:08

问题


I am having problems when trying to make a subscription to Instagram. I have created a functional servlet which handles the POST and GET as indicated at the Instagram instructions.

When trying it:

curl -F 'client_id=XXXXXX' -F 'client_secret=YYYYYY' -F 'object=location' -F 'aspect=media' -F 'object_id=18945195' -F 'verify_token=12345' -F 'callback_url=http://54.77.253.34/instagram/InstagramServlet'      https://api.instagram.com/v1/subscriptions

it returns

{"meta":{"error_type":"APISubscriptionError","code":400,"error_message":"Unable to reach callback URL \"http:\/\/54.77.253.34\/instagram\/InstagramServlet\"."}}

However, the servlet seems to be accessible through the browser and when I try

http://54.77.253.34/instagram/InstagramServlet?hub.challenge=somethinghere

it seems to be returning the hub.challenge it correctly.

Any ideas as to why? Many thanks!


回答1:


Although I have not found the answer to this, I found an alternative way to achieve a subscription, through the Instagram API console.

You need to put

  • In the Query the verify_token, client_id, client_secret
  • In the Body, inside the Text something like this (or the equivalent for your subscription): aspect=media;callback_url=http://54.77.253.34/instagram/InstagramServlet;object=location;object_id=18945195;

I got the hub.challenge=**** in my tomcat logs and therefore confirmed that the subscription was made.

Still, no idea as to why it is not working through the curl.



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

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