如何检索通过 Facebook 的图 api 上传的图像的 URL
我已使用以下代码成功将图像上传到用户的相册:
$ch = curl_init();
$url = 'https://graph.facebook.com/'.$uid.'/photos?access_token='.$token;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$data = curl_exec($ch);
谁能告诉我如何检索该图像的公共链接?
I've successfully uploaded an image to user's album using the following code:
$ch = curl_init();
$url = 'https://graph.facebook.com/'.$uid.'/photos?access_token='.$token;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$data = curl_exec($ch);
can anyone tell me how I would then retrieve the public link to that image?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有更多的 FQL 经验,但是看起来这可能有效:
https://graph.facebook.com/me /picture
文档位于“connections”下
http://developers.facebook.com /docs/reference/api/user
如果您选择使用 FQL:
http:// /developers.facebook.com/docs/reference/fql/
http:// Developers.facebook.com/docs/reference/fql/profile
I have more experience FQL however, it looks like this might work:
https://graph.facebook.com/me/picture
Documentation is under "connections"
http://developers.facebook.com/docs/reference/api/user
If you choose to use FQL:
http://developers.facebook.com/docs/reference/fql/
http://developers.facebook.com/docs/reference/fql/profile
照片上传成功返回上传图片的id。使用该 ID 请求有关图片的扩展信息 (graph.facebook.com/[photoid]?access_token=...)
Succesful photo upload returns id for the uploaded picture. Use that id to request extended info about the picture (graph.facebook.com/[photoid]?access_token=...)