0

I'm trying to use the Facebook Graph API to update a news feed post made on behalf of a user with a comment made by the same user. The user has granted me publish_actions, publish_stream and read_stream permissions and extended permissions.

I can do it by passing message and access_token only in the api explorer. When I try that on my server I get the following error:

{ error: 
   { message: '(#100) Invalid fbid.',
     type: 'OAuthException',
     code: 100 } }

This old question suggested that offline_access is needed to make this work.

http://facebook.stackoverflow.com/questions/4877847/publishing-comments-on-my-facebook-app-profil

Now offline_access is deprecated and not an option for new apps, is it possible to publish comments on a user's news feed as suggested by the documentation?

gustafc
  • 28,465
  • 7
  • 73
  • 99
asparagino
  • 603
  • 6
  • 12

2 Answers2

1

"publish_stream", "read_stream" permissions is enough for comment on user's feed. I've been using it this way and it works. plz note that graph api explorer allocates all permissions by default, you need to be able to test with your facebook appid

btw. if you are using web based apps, social plugins are much simpler and cleaner way https://developers.facebook.com/docs/reference/plugins/comments/

Yilmaz Guleryuz
  • 9,313
  • 3
  • 32
  • 43
  • Are you sure you can add a comment on a post within a user's feed, not just make a post to a user's feed? – asparagino Apr 25 '12 at 23:44
  • yes as per facebook docs and my previous apps. see; https://developers.facebook.com/docs/authentication/permissions/ the part about publish_stream – Yilmaz Guleryuz Apr 26 '12 at 09:04
  • I'm aware of the documentation and I know it *should* work. I can do it from a JS API call, but can't do it with a server API call - I get the error above. Thanks for answering though - please could you just check off the following for me: 1. Are you definitey doing this on the server, and not with a JS API call. 2. Have you enabled the "Remove offline_access permission" migration on your app... and does that make any difference? 3. Are you sure you're doing this in apps and for users without the offline_access permission. – asparagino Apr 26 '12 at 17:44
  • Ok - this does work. I had a bug in my code, so thanks for pointing me in the right direction. – asparagino Apr 26 '12 at 23:31
  • sounds very good! i was planning to write sample code later today, looks like you don't need any more :) – Yilmaz Guleryuz Apr 27 '12 at 07:51
0

Also, make sure you have checked out the latest documentaion on the API. (At the moment of writing it was at https://developers.facebook.com/docs/facebook-login/permissions/v2.0).

It looks like publish_stream was deprecated. In my project I had to change it to manage_notifications. But it depends on what you are trying to do, so double check with the docs.

Nikita R.
  • 7,245
  • 3
  • 51
  • 62