无法访问从instagram标签搜索API返回的媒体对象

时间:2019-01-21 07:47:02

标签: java android facebook-graph-api instagram-graph-api

我正在尝试从instagram标签搜索api获取媒体,我正在正确获取响应,但无法访问媒体对象。它说

   "Unsupported get request. Object with ID '18001051678085904' does not 
     exist, cannot be loaded due to missing permissions, or does not support 
     this operation. Please read the Graph API documentation at 
    https://developers.facebook.com/docs/graph-api",
    "type": "GraphMethodException",

这就是我查询18001051678085904?fields=id,media_type,media_url的方式,其中18001051678085904是我从instagram标签搜索api的响应中获取的媒体对象,我还具有公共内容访问权限和instagram基础知识

2 个答案:

答案 0 :(得分:2)

您需要2个ID才能正常工作。

  1. 标签ID
  2. 页面ID(facebook图:instagram企业帐户ID)

图查询浏览器:

v3.1 / hashtag_id / recent_media?fields = id,标题,like_count,media_type,media_url,永久链接,comments_count&user_id = page_id

要命中的网址:https://graph.facebook.com/v3.1/hashtag_id/recent_media?access_token=access_token&fields=id,caption,like_count,media_type,media_url,permalink,comments_count&user_id=page_id;

请注意,您可以搜索last_media或top_media

让我知道它是否可以解决问题。

答案 1 :(得分:0)

要添加到Nitin Tokas答案中,您可以通过标签搜索请求的字段是

/top_media?user_id=#####&fields=id,caption,comments_count,like_count,media_type,media_url,permalink

(请参阅https://developers.facebook.com/docs/instagram-api/reference/hashtag/top-media

尝试访问其他字段(如用户名或时间戳记)会使请求失败,并

  

“消息”:“(#100)请阅读支持字段的文档”

实际上,尝试分别访问每个结果媒体都会失败,

  

“ message”:“不支持的get请求。ID为###的对象不   存在,由于缺少权限而无法加载,或者不存在   支持此操作”

相关问题