How to tag user/page in Facebook POST.to property using Graph API? No PHP or Javascript involved, only plain HTTP POST Request
I am aware that using PHP or javascript API, it can be much easier. However, in this case, we are using restFB API at the back end to send HTTP POST request to graph API.
The requirement is to be able to tag/mention facebook fan pages or facebook users when publishing a post to fan page wall.
According to Facebook Graph API -> Post http://developers.facebook.com/docs/reference/api/post/
Field: to Description: Profiles mentioned or targeted in this post Returns: Contains in data an array of objects, each with the name and Facebook id of the user
Supposedly, by specifying to = "{name=,id=}" should enable tagging.
But it does not seem to work.
curl -F 'access_token=YOUR_ACCESS_TOKEN' -F 'to=FRIEND_FB_ID' https://graph.facebook.com/PAGE开发者_JS百科_ID/feed (or /photos, as you can tag either photo or mention people in your facebook post)
Can someone please give an example as the one above that works?
Thanks a lot
OffBySom is correct, this is not currently available via the graph api. I've tested numerous methods/formats and you cannot tag a User, Page, etc via a Facebook graph api POST at this time.
Depending on whether or not the user can manually initiate your share, you should checkout http://www.facebook.com/connect/prompt_feed.php The format as described by OffBySome works there...Checkout @[151618362580:1:The DJ List]
. This tags the Page http://facebook.com/thedjlist in the POST. I've not tried with User, Group, etc.
This method does not include the POST in the Page's feed.
You need to submit your App for approval before you can tag other Pages when posting through Facebook's API.
Here's the link:
Feature Review For Page Mentioning
How to Submit for Login Review Guide
This is not currently available in the Facebook graph api but it has been requested here. This guy has published the undocumented format of @[{user_id}:1:{name}]
but I don't know that it still works and it doesn't actually notify the user like the Facebook website does.
精彩评论