问题
I have a Facebook Page created for my service here. The name of the page is Rowz.
There are some posts on the page by users who have tagged the Page in posts on their own walls. Those posts show up on the Rowz Page timeline. In the Graph API for Page there is a field 'tagged' which I assumed would get me these posts but the same doesn't work.
Is there a way to fetch those posts that have tagged Rowz in them?
回答1:
According to the documentation for page object in graph API, tagged
connection gets you the required result:
name:
tagged
description: The photos, videos, and posts in which thePage
has been tagged.
permission: any validaccess_token
or useraccess_token
.
returns: a heterogeneousarray
ofPhoto
,Video
orPost
objects.
You can test it here using graph API explorer (using the page ID mentioned in the question): https://developers.facebook.com/tools/explorer/?method=GET&path=265813166783408%2Ftagged
It works fine for me.
You may also consider using FQL for it. Query stream_tag table using a query something like this:
SELECT post_id,actor_id FROM stream_tag WHERE target_id=265813166783408
After this, you can iterate over post_id
and query stream
table for message
field.
来源:https://stackoverflow.com/questions/8741144/posts-that-have-tagged-my-page-dont-show-up-with-api-call