【发布时间】:2016-01-31 08:52:16
【问题描述】:
当我尝试让 cmets 访问媒体时,它只返回访问令牌所有者用户的评论,而没有其他用户 cmets。
查询:
https://api.instagram.com/v1/media/"+mediaId+"/comments?access_token="+token
所以最终查询看起来像:
https://api.instagram.com/v1/media/1162251688307718037_1824437940/comments?access_token=token
答案:
`{"meta":{"code":200},"data":[{"created_time":"1453069290","text":"comment_text_here","from":{"username":"username","profile_picture":"profile_picture","id":"user_id","full_name":"full_name"},"id":"1164752089812694405"}]}'
获取媒体ID:
https://api.instagram.com/v1/users/self/media/recent/?access_token="+token+"&count=30
获取媒体id列表
JSONObject json = new JSONObject(comments);
JSONArray data = json.getJSONArray("data");
if (data.length()>0) {
for (int i = 0; i < data.length(); i++) {
JSONObject obj = (JSONObject) data.get(i);
list.add(obj.getString("id"));
//System.out.println(obj.getString("id"));
}
}
我的错误在哪里,或者是沙盒应用程序的 api instagram 限制?
【问题讨论】:
标签: java instagram instagram-api