如何使用Graph API在Facebook POST.to属性中标记用户/页面?没有涉及PHP或Javascript,只有纯HTTP POST请求

问题描述:

我知道使用PHP或JavaScript API可以轻松得多。但是,在这种情况下,我们在后端使用restFB API向图形API发送HTTP POST请求。

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.

要求是在将页面发布到粉丝页面墙壁时能够标记/提及Facebook粉丝专页或Facebook用户。

The requirement is to be able to tag/mention facebook fan pages or facebook users when publishing a post to fan page wall.

根据Facebook Graph API - > Post
http:/ /developers.facebook.com/docs/reference/api/post/

According to Facebook Graph API -> Post http://developers.facebook.com/docs/reference/api/post/

字段:至
说明:此帖中提及或定位的个人资料
返回:在数据中包含一个对象数组,每个对象都有用户的名称和Facebook id

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

假设通过指定to ={name = id =}应该启用标记。

Supposedly, by specifying to = "{name=,id=}" should enable tagging.

但似乎不起作用。

curl -F'access_token = YOUR_ACCESS_TOKEN'-F'to = FRIEND_FB_ID' https://graph.facebook.com/PAGE_ID/feed (或/照片,您可以标记照片或在Facebook的帖子中提及人物)

curl -F 'access_token=YOUR_ACCESS_TOKEN' -F 'to=FRIEND_FB_ID' https://graph.facebook.com/PAGE_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?

非常感谢

OffBySom是正确的,这不是当前通过图表api可用。我已经测试了许多方法/格式,您不能通过Facebook图形api POST标记用户,页面等。

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.

根据用户是否可以手动启动您的分享,您应该检查 http://www.facebook.com/connect/prompt_feed。 php OffBySome描述的格式在那里工作... Checkout @ [151618362580:1:DJ List] 。这会在POST中标记页面 http://facebook.com/thedjlist 。我没有尝试过用户,组等。

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.

此方法不包含页面Feed中的POST。

This method does not include the POST in the Page's feed.