12

My application has obtained publish_stream permissions for a Facebook user.

I'd like to allow the user to post comments for a target URL directly from my mobile application, rather than opening up an embedded browser that then shows the Comment Box plugin. That is, the user doesn't necessarily want to post the link to their feed -- rather they want to participate in any Facebook comment discussion that surrounds that URL.

Naturally, I can read the comments for any URL via the Graph API (eg: a techcrunch article) but I do not know how, or if I can add comments to an arbitrary URL programmatically.

Would love to hear any other suggestions or workarounds as well. My hope is to piggy back on Facebook comments to allow my users to have a conversation surrounding URLs of interest to them. If at all possible, I'd also prefer to use Facebook, though I can see using Disqus or similar services would be another possibility.

genesis
  • 50,477
  • 20
  • 96
  • 125
kbs
  • 505
  • 5
  • 8

2 Answers2

9

Use graph api, demo comments here

make POST to

http://graph.facebook.com/comments/?ids=http://techcrunch.com/2011/07/22/big-surprise-the-ipad-trumps-android-tablets-at-the-office/

with field message and value "yourmessage"

genesis
  • 50,477
  • 20
  • 96
  • 125
  • this is not working for me, it returns { "error": { "type": "Exception", "message": "Unknown identifier, " } } – fceruti Sep 01 '11 at 07:54
  • @fceruti: it does for me. Try it in their explorer – genesis Sep 01 '11 at 07:54
  • cool, the problem was that at least once you need to render the comments on the webpage. However, I still have one question: ¿How can I post this comment on the facebook wall (if the user chooses to)? – fceruti Sep 01 '11 at 19:01
  • @fceruti: Just change ?ids to current id of post wall – genesis Sep 01 '11 at 19:02
  • 2
    I've tried this in the graph explorer and it doesn't work with a POST request, only a GET. Indeed the documentation only mentions the ability to pull comments from a url, not post to that url: http://developers.facebook.com/docs/reference/plugins/comments/ did FB change their policy? – ambertch Oct 24 '11 at 22:17
  • 1
    Doesn't work for me neither. Does it still work for you who got it working earlier? – Stefan Dec 05 '11 at 22:55
  • Currently I'm getting this: "message": "(#100) Comments may not be added to a comment plugin", "type": "OAuthException", "code": 100 – b1r3k Jul 25 '13 at 20:01
1

I genuine Facebook API bug. Cannot comment via Graph API on Comments Plugin (Probably try Legacy API)

Graph API

R.daneel.olivaw
  • 2,681
  • 21
  • 31
rjdthegreat
  • 204
  • 3
  • 10