api - 为什么 Instagram API 会忽略我请求的 min_id 参数?

标签 api instagram

我正在向 users/media/recent 提出请求GET端点,但它忽略了我的 min_id范围。我的最终请求如下所示(替换为您自己的 access_token 以进行测试):

https://api.instagram.com/v1/users/self/media/recent/?access_token=xxxxxxxx.xxx92d6.6584xxxxxe4d03a3cf2xxxcdb7da&min_id=1162106936627841123_10443137



结果返回,但min_id被忽略,所有帖子都从最近的帖子返回。

如何让 Instragram API 使用我的 min_id参数考虑?

最佳答案

不幸的是,通过第一手经验,Instagram API 只会将最近的媒体返回给您,无论是什么min_id是。解决方法是查找并仅使用 max_id取而代之的是媒体。您可能希望将其保存到一个数组中,以便以后使用时只需将 max_id 拉出即可。 :

$.ajax({
        type: "GET",
           //min_id endpoint does not work for instagram API 
           //as it will always return the most recent photos. 
           //Using the max_id and going backward is the only workaround. 
           //Therefore accessing the max_id from the array that was saved earlier
        url: "https://api.instagram.com/v1/users/"+ instagram_id +"/media/recent/?access_token=" + token + "&count=" + count +"&max_id=" + pageArray[currentPage-2], 
        dataType: "jsonp",
        jsonp: "callback",
        success: function(obj) {
          //do something        
        },
        error: function() {
          //do something
        }
    });

另一种方式是使用min_id的组合和 max_id为您提供一系列媒体。但是,它似乎排除或不显示min_id 的媒体。和 max_id .这意味着只有 min_id 之间的媒体和 max_id被退回给你。

关于api - 为什么 Instagram API 会忽略我请求的 min_id 参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37596076/

相关文章:

javascript - 在ReactJS中使用axios GET作为axios POST

instagram - 无法从 Instagram 登录获取电子邮件 ID

ios - Swift/Instagram API - 如何使用 Instagram App 进行授权

c# - 控制台应用程序中的 Instasharp

amazon-web-services - Angular AWS APP中的ERR_CERT_COMMON_NAME_INVALID

json - 需要帮助在 SWIFT 中解析 wikipedia json api

java - 实现公共(public) API

api - 错误 401 未经授权连接 Marvel API

api - 现在有没有办法在不使用访问 token 的情况下获取 instagram 提要(06/2016)?

api - Instagram 删除了标签订阅,重新订阅时,即使响应成功,它也会消失