当我试图向媒体发表评论时,它只返回访问令牌所有者用户评论,而没有其他用户评论 .
查询:
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限制?
1 回答
在沙盒模式下是,它将仅从沙箱授权用户返回媒体,如果您添加已注释到沙箱的用户,则该注释将显示在API响应中 .
https://www.instagram.com/developer/sandbox/