Getting Admin Creator of comment using Facebook Graph API - facebook

Using Access token has privilege manage_pages. I can get admin creator (admin_creator field) of any post in a page I'm admin in, but how can I get comment admin creator ?

You must make a request to the facebook api like this: {post-id}?fields=message_tags,from inside message_tags you will get an array with the userid creators of every comment of the current post.
Hope it´s not too late...

Related

How to get Facebook User ID that likes/comments a post of a page

I have a facebook page and i can get list of comments in a facebook page post using page access token. But i cannot get the facebook user id of that comment.
How can i archive that?
I already trying with
{comment-id}/comments?fields=message,from{id}
I'm using facebook graph API version 3.2
Regards,
You can send a private reply to the user and when that user will reply to that message then you can have the userId. Only this is the process which can provide you with userId.
https://graph.facebook.com/v2.11/${commentId}/private_replies?access_token=${accessToken}

get user info from facebook page visitor post [duplicate]

I have a Facebook comment and I would like to get the user ID of the author of the comment. I am able to get this information when the comment is posted on the page that I own with this query:
https://graph.facebook.com/v2.11/comment_id?fields=from&access_token=access_token
However, the same does not work when I am accessing a comment that is not posted on my own page, the from field is never returned. Is it possible to get the author of a comment that is posted on a different page?
Is it possible to get the author of a comment that is posted on a different page?
No, that information is not available to you any more.
https://developers.facebook.com/docs/graph-api/changelog/version2.11#gapi-90-pages:
/page/* — User information will not be included in GET responses for any objects owned by (on) a Page unless the request is made with a Page access token. This affects all nodes and edges that return data for objects owned by a Page.
If you are using a development account you cannot get the from user details of a user who comments on your posts. You can however create test users from your developer account, login with the test account, comment and retrieve their from details.

Facebook Graph API Comment Doesn't Return From

I have a Facebook comment and I would like to get the user ID of the author of the comment. I am able to get this information when the comment is posted on the page that I own with this query:
https://graph.facebook.com/v2.11/comment_id?fields=from&access_token=access_token
However, the same does not work when I am accessing a comment that is not posted on my own page, the from field is never returned. Is it possible to get the author of a comment that is posted on a different page?
Is it possible to get the author of a comment that is posted on a different page?
No, that information is not available to you any more.
https://developers.facebook.com/docs/graph-api/changelog/version2.11#gapi-90-pages:
/page/* — User information will not be included in GET responses for any objects owned by (on) a Page unless the request is made with a Page access token. This affects all nodes and edges that return data for objects owned by a Page.
If you are using a development account you cannot get the from user details of a user who comments on your posts. You can however create test users from your developer account, login with the test account, comment and retrieve their from details.

Assign admin role for facebook page over FaceBookGraph API

I have facebook page and I am admin of that page. Now I want to assign admin role to some one from my friend list using Graph API.
In docs i found how i can list admins of one pege ussing accounts parametar, but i can't found how i can add some one to be page admin.
Thank you in advance.
Nope, Its not possible.
Just think about it. If its allowed, then wouldn't any fb app start taking over your pages?
Also, If you want to manage fb page, then you can easily do that via their API, it allows everything one can do if they were an actual admin of the page.
Example: Status Update, Wall Post, Photo Upload, Events Management (Create/Invite), Comment, Like, Insights, etc. What else you need?
If you POST to the graph /{pageID}/admins?access_token={Page_access_token}&owner_email={some user emai} then you get this response from the server: "error": {
"message": "(#100) Your app does not have the permissions to modify admins",
"type": "OAuthException",
"code": 100
So if they say that my app does not have the permission to modify admins it is logic that some apps may have the permission, tome tokens. The problem is that the required permission code is not public on the API documentation.
I was able to add an admin via Graph API using Koala library for Ruby like this;
#page_api.put_connections('your page id' , 'roles', {'admin_id' => 'user id from your friend list'})

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.