2017-06-20 43 views
0

我正在使用Facebook图形API来获取我的留言板并将这些结果处理到我的数据库中。我已经能够让所有的工作都能正常工作,除非用户用图像发表评论时,该图像网址不会出现在我的结果中,我无法弄清楚我错过了什么。下面的图片指向注释中有图片的评论,但未列出。Facebook图表api数组结果缺少评论图片

这里是在PHP我GET调用

file_get_contents("https://graph.facebook.com/$get_facebook/feed?access_token=$facebook_accesstoken&client_id=$facebook_appid&client_secret=$facebook_appsecret&metadata=1&fields=id,status_type,created_time,from,message,comments,picture,link,icon,parent"); 

有谁知道这是为什么图像的URL没有在我的结果显示?

图片在评论看到

enter image description here

无图像

facebook api graph missing picture in comment

+0

_“有人知道为什么图像url没有显示在我的结果中吗?” - - 因为你忽略了要求...?您需要询问评论的“附件”子字段。 – CBroe

+0

是的,我想出来了,我做出了答案 –

回答

0

我结束了,让做一个圆滑的方式计算出来图形API结果通过一次调用来调用Graph API,并获得我需要的所有结果。我给这里

Get (Identify) Replies to Comments Using the Graph API

答案随着使用Graph API调用,你可以做到这一切在一杆这样赋予所有意见的feed部分,每发表回复以及所有图片与每个评论/回复相关联。

https://graph.facebook.com/$get_facebook/feed?access_token=$facebook_accesstoken&client_id=$facebook_appid&client_secret=$facebook_appsecret&metadata=1&fields=id,status_type,created_time,from,message,comments{comments{attachment,from,id,message},from,id,message,attachment},picture,link,icon