首页 > 解决方案 > 想问下instagram接口怎么实现

问题描述

https://developers.facebook.com/docs/instagram-api/guides/business-discovery

“https://graph.facebook.com/v3.2/17841405309211844?fields=business_discovery.username(bluebottle){followers_count,media_count,media{comments_count,like_count}}&access_token={access-token}”

这是给出的请求示例,但是,我仍然不知道如何编写这个请求?

我写了这样一个请求并得到了正确的结果

String url = "https://graph.facebook.com/v10.0/"
            +iguserid+"?" +
            "fields=business_discovery.username(bluebottle)" +
            ",followers_count,media_count,media" +
            "&access_token=" + accent_token;

{"media_count":3,"followers_count":5,"media":{"data":[{"id":"1111111"},{"id":"1111111"},{"id":"1111111"}],"paging":{"cursors":{"before":"ssssssENleDdyb2V2LUNsWUNVWHplOVJWalJ0VlczNHo4ekZAfdEEzdEphRW1KRG5aaWVwRTMwaVJKSmZA4Rjh3eEs1Q21ZARVVFY0VKssss","after":"sssssxacVdndEdHZAWxJRGFHNkZAoNWY4NzVkY2toWUV2c3hEazRQN0k1dlo2Uk11TkRuOVh0WVJzZAHlnektVdl9XSksssss"}}},"id":"1111111","business_discovery":{"id":"1111111"}}

我没有以这种方式得到结果

String url = "https://graph.facebook.com/v10.0/"
            +iguserid+"?" +
            "fields=business_discovery.username(bluebottle)" +
            ",followers_count,media_count,media,comments_count,like_count" +
            "&access_token=" + accent_token;

{"error":{"code":100,"message":"(#100) Tried accessing nonexisting field (comments_count) on node type (IGUser)","type":"OAuthException","fbtrace_id":"A6MeWCgzqzJSHnj9d7EoY75"}}

标签: instagram

解决方案


推荐阅读