views:

272

answers:

2

I tried:

$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);

It has returned me:

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

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?

+2  A: 

Change the url to

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

tags is not a compatible method! use photo to retrieve the specified data

Take a look at!

http://developers.facebook.com/docs/reference/api/photo for tagging users in photos.

RobertPitt
Sorry but in your link there is nothing about tagging someone. I don't need to retrieve the data but to post it.
FR6
+1  A: 

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

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.

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.

peterjwest