问题
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