0
votes

I'm trying to tag a user (having its userid), with a Graph request made to a picture just uploaded to a Page Gallery.

Permissions I use in the app are: @"read_stream", @"offline_access", @"publish_stream", @"manage_pages",@"photo_upload",@"user_photos" and with a access_token to the session got from page_it?fields=access_token item (that works for picture upload in gallery).

And I use them to upload the photo to a Gallery on a Fan Page successfully.

When I try to tag the user with a graph request in the form:

POST to picture_id/tags with param: "to"->userid I get only facebookErrDomain error 10000 as if permissions are not right.

From API Documentation seems that only user_photos and publish_stream are required and no mention to page-galleries photo is made.

I'm quite clueless about this issue.

1

1 Answers

0
votes

It's possible. You need to collect the page's specific token by placing a call to /me/accounts. And then tag the photo using page's access token. Once you get that, you can tag the photo using it's Graph Object Id and user id whom you are tagging.

if (accessToken) {
    var data = {
        "access_token": accessToken,
        to:userId,
        x:x,
        y:y
    }
    FB.api("/" + photoId+"/tags/"+userId , 'post', data, function(response) {
        //here is the response
    });
}

Hope it helps. The key is the access token that is specific to that page :)