Facebook publish_action permission not working for posting

ertugrul.ozturk picture ertugrul.ozturk · Nov 10, 2011 · Viewed 45.8k times · Source

Currently i can post news feed updates using objectids of some of my web pages to facebook users who have liked those pages.

Now i'm trying to test the new open graph and custom actions to do the same; posting updates to users who made a specific action on my web site. But even though i get publish_actions permission with my app, and using my facebook account and some dummy test user accounts for my app (i know that until timeline is released, only devs and test users can use said permission), when i try to post i get this error message: "{"error":{"message":"(#200) Requires extended permission: publish_actions","type":"OAuthException"}}".

I also changed my app type to Games so i can properly get publish_actions permission from auth dialog.

Any ideas that can help me with this? Or do i just have to wait until timeline is released before i can test new open graph posting properly?

Edit: request sent contains these parameters;

to: https://graph.facebook.com/feed
["access_token": "given access token", 
"message": "post message", 
"caption": "post caption", 
"picture":"picture url", 
"link": "link to post", 
"description": "post description", 
"ids": "object ids separated by commas"]

Edit2: I ask for permissions via Add to timeline button:

<fb:add-to-timeline show-faces="true" mode="button" perms="offline_access,publish_actions,publish_stream"></fb:add-to-timeline>

Answer

TLK picture TLK · Dec 16, 2011

I suspect you are not correctly asking for the permission. This drove me crazy for hours. Even though I was correctly asking for permission and it appeared to authenticate, in reality the permission was not being granted because I had not setup the application correctly for open graph.

When asking for publish_actions, Facebook shows a preview screen of what sort of aggregations your app will create on their timeline.

In other words, if the preview isn't working, Facebook won't ask for the permission so you're asking in vain. Facebook doesn't make this clear in the docs, but everything needs to be perfectly setup with your app on Facebook to get this to work right.

  1. Enable Enhanced Auth Dialong in the advanced settings of the app
  2. Make sure you have at least one action and one object set up in the open graph section
  3. For each action you must have an aggregation set up.

If you do not do all of these steps, there can be no preview and so Facebook won't ask for permission no matter what.