问题
I'm Getting 400 bad request
as a response:
{"meta":{"error_type":"APIInvalidParametersError","code":400,"error_message":"invalid parameters-check the max\/min-timestamps, if you supplied them"}}
while my request seem to be fine:
https://api.instagram.com/v1/media/search?q=demonstration&lat=30.0444&lng=31.2357&distance=1000&min_timestamp=1383253200000&max_timestamp=1385758800000&access_token=9xxx4
specifying timestamps with a range of a month, is that an issue?
P.S. Using JQuery 1.9.1
Thanks,
回答1:
Just remove the last three 0s in your timestamp and it will work, I just tested this and it works
your timestamp is in miliseconds, it should be in seconds, you have to do time/1000.
https://api.instagram.com/v1/media/search?q=demonstration&lat=30.0444&lng=31.2357&distance=1000&min_timestamp=1383253200&max_timestamp=1385758800&access_token=9xxx4
Here is a implementation I have done for this API with timestamp change: http://www.gramfeed.com/instagram/map
(I dont think there is a 7 day limit, i can go back 30+ days before and get results)
回答2:
From the docs:
The time span must not exceed 7 days.
Don't forget that a Unix timestamp is seconds since the epoch. So in JS you'd do:
Math.round(new Date.getTime() / 1000 );
来源:https://stackoverflow.com/questions/21091543/ajax-call-to-instagram-get-media-search-timestamp-issue