Rafael Oliveira
Rafael Oliveira

Reputation: 2923

Tag user on fan page photo

Using GRAPH API, how can I tag myself on a fanpage photo (page that allows anyone to tag)?

Docs says you only need:

I tried it but facebook responds with an 500: Oauth Exception, An unknown error has occurred.

Tagging myself or friend in user photos works OK, but tagging on pages photos causes the error.

https://developers.facebook.com/docs/reference/api/photo/

Related bug, filled by me: https://developers.facebook.com/bugs/261936030593730

Upvotes: 2

Views: 717

Answers (2)

Jashwant
Jashwant

Reputation: 28995

When you publish photo through fan page and wanted to tag friends in it, you need page access_token instead of user access_token. You are using user's access_token so the error

500: Oauth Exception, An unknown error has occurred.

Quoting fb docs from here

To perform the following operations as a Page, and not the current user, you must use the Page's access token, not the user access token commonly used for reading Graph API objects. This access token can be retrieved by issuing an HTTP GET to /USER_ID/accounts with the manage_pages permission. This will return a list of Pages (including application profile Pages) to which the user has administrative access, along with access_tokens for those Pages. Alternatively, you can get a page access token for a single, specific, page by issuing an HTTP GET to /PAGE_ID?fields=access_token with the manage_pages permission, as described above. Publishing to a Page also requires the publish_stream permission, unless otherwise noted.

Upvotes: 0

C3roe
C3roe

Reputation: 96241

Have you checked that the page has the option

Tagging Ability: [X] People can tag photos posted by {page}

set in it’s settings under Manage Permissions …?

Upvotes: 1

Related Questions