How to post a comment using Facebook API - facebook

I'm trying to post a comment to my facebook using facebook API.
I'm trying to send this request:
https://graph.facebook.com/{post id}/comments/?access_token={token}&message=hello
This return to me list of comments but doesn't post the message I sent.
What should I do to post my message?
Thanks.

Update
As of April 24,2018, the publish_actions permission has been removed. Please see the Breaking Changes Changelog for more details. To provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.

You should make a POST request and make sure you have all the permissions required to publish. Docs here.

Related

How to post a page review via facebook api

I can only use POST page-id/ratings with paramater : rating:value
I can only rating page without review.
Anyone can help me, please.
This is not possible, the endpoint is GET only.
See the linked documentation from the earlier comment:
How to post a page review via facebook api
https://developers.facebook.com/docs/graph-api/reference/page/ratings

Post is missing after posting through Facebook graph api

I use Facebook graph api for posting status on wall with "me/feed".
I get a success response with ID but I don't see the post on my wall
and while I open facebook.com/ID I get "Sorry, this page isn't available".
What could be the reason for that?
You have to take the permission for "publish_actions" from access tokens. Documentation link for Permissions Later You may hav to use a Publish action. Documentation link for Publishing Actions
The user was connected with fan page user.

Sharing links posted to a wall via an app

I've created an app which enables business to post links to their Facebook wall as the business (have proper business auth tokens, etc.).
However the links posted via the app do not have a share link, only comments and like. When a link is posted through the Facebook UI to the business wall it does contain a share link along with comments and like.
What am I missing to enable the link posted via my app to have a share link?
I am currently issuing a POST request to the following URL to create the posts:
https://graph.facebook.com/[profileId]/feed?message=[message]&link=[link]&...
this is a reported bug and have not been fixed yet. have a look (http://developers.facebook.com/bugs/307556529334653)
I think you will need publish_stream permission for that and publish what they write. IMO Facebooks makes difference between feed and stream. Just my thoughts :)
that's the standard procedure when you have a user post via app. I don't think there's a way to have users post as themselves, as far as links are concerned. What you can do is have them post a status update and that one will be seen as posted by the user (no app information).
There's no other procedure I am aware of that can do that. I hope this helps

Can I post a comment on a status programmatically?

I've been reading up on the new documentation, and I've found out how to post a status as a user, and how to read a status and all it's comments, but I haven't found a way yet to post a comment. My goal is to have the backend of my application mirror exactly the interaction on Facebook, such that if a user (whose access token we have) comments on a post in our iOS app's custom UI, our server can update the mirrored post on Facebook by adding the comment as that user. It's sounds like it's possible from what I've read, but I can't figure out exactly how to do it from the documentation. Can someone explain more clearly how to post comments, and what access privileges I need to do so?
You need to have publish_stream permissions from the user and then you just issue an HTTP POST to https://graph.facebook.com/postID/comments?access_token=... with a "message" post parameter equal to the comment you want to post. Its documented here under the section titled "comments".

How do I post a link to the feed of a page via the Facebook Graph API *as* the page?

I'm working on a plugin for a Wordpress blog that posts a link to every article published to a Facebook Page associated with the blog.
I'm using the Graph API and I have authenticated myself, for the time being, via OAuth.
I can successfully post a message to the page using curl via a POST request to https://graph.facebook.com/mypageid/feed with e.g. message = "This is a test" and it published the message.
The problem is that the message is "from" my user account. I'm an admin on this test page, and when I go to Facebook and post an update from the web, the link comes "from" my page. That's how I'd like this to be set up, because it looks silly if all the shared links are coming from a user account.
Is there a way to authenticate myself as a page? Or is there an alternate way to POST to a page feed that doesn't end up being interpreted as a comment from a user?
Thanks for any thoughts or suggestions.
To post as the Page, you need to get an access token for the page by getting an access token for an admin of the Page with the "manage_pages" and "publish_stream" permissions. Then, using that access token, hit https://graph.facebook.com/me/accounts?access_token=THE_ACCESS_TOKEN. You'll get a JSON output of all the Pages that user admins and in there you'll see an access token for each Page. If you use one of those access tokens to POST your message, you will be doing so as the Page. The process is outlined in the documentation here (sorry, it's kind of buried).
Ah, it's a bug.
you need to use enable_profile_selector
http://developers.facebook.com/docs/reference/javascript/FB.login
Please have a look at the comments by "Nam Thai" on this thread: http://www.takwing.idv.hk/tech/fb_dev/faq/graphapi/graph_27.html. This solved the problem for me.