Instagram订阅-无法访问回调URL [英] Instagram subscription - Unable to reach callback URL
问题描述
尝试订阅Instagram时遇到问题.我已经创建了一个可处理POST和GET的功能servlet,如Instagram 指令所示.
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.
尝试时:
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
返回
{"meta":{"error_type":"APISubscriptionError","code":400,"error_message":"Unable to reach callback URL \"http:\/\/54.77.253.34\/instagram\/InstagramServlet\"."}}
但是, servlet 似乎可以通过浏览器访问,并且在我尝试
However, the servlet seems to be accessible through the browser and when I try
http://54.77.253.34/instagram/InstagramServlet?hub.challenge=somethinghere
它似乎正确返回了hub.challenge
它.
关于为什么的任何想法?非常感谢!
Any ideas as to why? Many thanks!
推荐答案
Although I have not found the answer to this, I found an alternative way to achieve a subscription, through the Instagram API console.
您需要输入
- 在查询中, verify_token , client_id , client_secret
- 在正文中,类似以下内容(或与您的订阅相当的内容):
aspect=media;callback_url=http://54.77.253.34/instagram/InstagramServlet;object=location;object_id=18945195;
- 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;
我的tomcat日志中有hub.challenge=****
,因此确认已进行订阅.
I got the hub.challenge=****
in my tomcat logs and therefore confirmed that the subscription was made.
仍然,不知道为什么它不能通过curl
工作.
Still, no idea as to why it is not working through the curl
.
这篇关于Instagram订阅-无法访问回调URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!