如何使用 Facebook Graph API 在照片中标记用户? [英] How can I tag a user in a photo using the Facebook Graph API?

查看:28
本文介绍了如何使用 Facebook Graph API 在照片中标记用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过了:

$args = array(
  'access_token' => $access_token,
  'id' => $uid
);

$url = "https://graph.facebook.com/{$idPhoto}/tags";

$ch = curl_init();
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);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$data = curl_exec($ch);

它返回了我:

{"error":{"type":"QueryParseException","message":"Unknown path components: /tags"}}

这似乎不可能,因为它不在 Facebook 文档中:

It does not seem possible because its not in the Facebook documentation:

http://developers.facebook.com/docs/api#publishing

有人可以向我确认不能在最近上传的照片中标记用户吗?

Can someone confirm me that it's not possible to tag a user in a recently uploaded photo?

推荐答案

目前没有使用 Facebook Graph API 设置标签的机制.

There is no current mechanism to set tags with the Facebook Graph API.

您可以将 photos.addTag 与旧的 REST API 一起使用您应该可以在这里下载:http://pearhub.org/get/facebook-0.1.0.tgz.如果有人有更好的链接,我将不胜感激.

You can use photos.addTag with the old REST API which you should be able to download here: http://pearhub.org/get/facebook-0.1.0.tgz. If anyone has a better link, I would appreciate it.

查看来自 Facebook 开发人员的这篇文章 http://developers.facebook.com/blog/post/371 新 API 似乎永远不会支持设置标签让用户进行标记".这对于想要集成标记的应用(如我的)来说是不幸的.

Looking at this article from the Facebook developers http://developers.facebook.com/blog/post/371 it seems likely that the new API will never support setting tags "let the users do the tagging". This is unfortunate for apps (like mine) that want to integrate tagging.

这篇关于如何使用 Facebook Graph API 在照片中标记用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆