Ido
Ido

Reputation: 420

How to retrieve all actions that were published by the current user

is it possible to get the list of actions that were published into current user's timeline? For example, all the read actions (news.reads) that were published through my app into the user's timeline.

I know how to publish built-in read actions with the Graph API, but not how to get all the actions someone has already published. The idea is to create a list of all actions the current user has ever published, and then let him decide which of the actions he would like to remove from his timeline.

Upvotes: 0

Views: 195

Answers (1)

Matthew Johnston
Matthew Johnston

Reputation: 4439

For built-in actions, you can retrieve all listens, reads and watches (and games activity), with the appropriate Open Graph Permission. You do this with a simple Graph API call, such as:

https://graph.facebook.com/me/news.reads?access_token=USERACCESSTOKEN

See more here: https://developers.facebook.com/docs/opengraph/actions/builtin/

For custom actions, an app can only retrieve any action that it has published. In this case, the user_actions:APP_NAMESPACE Permission must be requested from the User, and then the Graph API call will be something like:

https://graph.facebook.com/me/mycookingapp:eat?access_token=USERACCESSTOKEN (where mycookingapp is the app namespace, and eat is the custom action).

You can see what the Graph API call to read all of a particular custom action type is for your app by going to the Open Graph section of your app's App Dashboard and clicking on 'Get Code' beside the relevant action type.

Upvotes: 1

Related Questions