How can I unpublish/delete a comment of an Facebook Ad? - facebook-graph-api

I need a solution where I can unpublish/delete comments on Facebook Ads. There are paid tools which have this feature, like this one:
https://www.agorapulse.com/blog/comments-facebook-dark-unpublished-posts
"Finding and responding to these comments was a major headache, so we
went digging on Facebook’s API and found a solution to include all
comments made on dark/Unpublished posts and we included them in our
unified Facebook Inbox."
With the normal command endpoint I can't get the commands for ads.
How I can access and manage the commands, which API endpoints I need?

There are a few endpoints you'll most likely be interested in:
1) Your ads are connected to a page, so you'll need to get data for your Page. See https://developers.facebook.com/docs/pages/managing for reference.
2) Your page contains the posts. See the section titled "Getting Page Posts" in the link from step 1.
3) The posts contain comments. Using the id of the post, make the appropriate API calls to get its posts. See https://developers.facebook.com/docs/graph-api/reference/v2.9/object/comments/ for reference.
4) Once you find the comment you want to delete, make the appropriate DELETE call on it. See graph-api/reference/v2.9/comment/ for reference.

Related

Replicate a Facebook page and all its content

I would like to achieve the following:
GET all posts from a page and their related content (attachments, likes, visibility, tags, shares, comments, creation time...)
POST all that content in a new page
Assuming that I am admin of both pages.
I know that it's pretty straight forward to loop over the feed of a page and get all the posts' information. However, I'm not so sure about the POST part:
I guess that Facebook doesn't allow to "clone" people's
like/shares/comments below each post, on their behalf?
Considering that I will delete the first page, will all attachments disappear from Facebook's servers as well?
You cannot post in behalf of another user. And you cannot get all information you need with the Graph API.
What about renaming the page? If you like to delete the first page and clone it before, it looks like a rebranding or something ...

How to know if a comment on a page post is hidden in Graph API

We are looking for a way to find out, if a comment is hidden on a story on a page feed. We are using the Graph API to get the comments: [story_id]/comments with an Admin Access Token. Facebook tells us if we can delete the comment. However, there is no "is_hidden" flag or something.
Is there any other way to find out if the comment is hidden/marked as spam?
Thanks!
I'm PHP Developer, we have also used Facebook Graph API many times.
As per my expertise, I think we cannot fetch/identify only hidden/spam comments.
But yes you can get the comments for only particular user if you want.
For example:
1.) Get id of a fanpage with public graph data: http://graph.facebook.com/cocacola - thumsup has 507267189335315.
2.) Get ThumsUp's "like plugin" iframe display directly with some modified params: http://www.facebook.com/plugins/fan.php?connections=100&id=40796308305
3.) Now check the page sources, there are a lot of fans with links to their profiles, where you can find their profile ids or nicknames
4.) If you are interested only in profile ids use the graph api again - it will give you profile id directly
I hope you will find my answer appropriate.
If you are getting some other solution, please share
Thanks,
Shreyas
By now, finding out if a comment is hidden can be achieved via the is_hidden flag.
More detailed answer on a similar question
Facbook API docs for comment endpoint

Can we get People Talking About This for a post?

Is there a way to get the "People Talking About This" statistic for a specific post on a Facebook Page ? The Insights API doesn't say it's possible. ( post_storytellers doesn't exist )
'People Talking About This' aggregates various interactions into a single metric including:
liking a Page
posting to a Page’s Wall
liking, commenting on or sharing a Page post (or other content on a page, like photos, videos or albums)
answering a Question posted
RSVPing to an event
mentioning a Page in a post
phototagging a Page
liking or sharing a check-in deal
or checking in at a Place.
As far as i'm aware there's no way to retrieve this value using the graph api without scraping the page directly.
You can however retrieve the total_count for a url which is an aggregation of shares, likes, comments via FQL, for example: https://graph.facebook.com/fql?q=SELECT%20total_count%20FROM%20link_stat%20WHERE%20url='https://www.stackoverflow.com'
more info: https://developers.facebook.com/docs/reference/fql/link_stat

How to change the "link" parameter on a Facebook page graph

How can one change the opengraph link value on a Facebook page (type: website) from
https://www.facebook.com/yourwebsite to http://www.yourwebsite.com
It seems easier than it is. I couldn't find an answer. Seems it has something to do with adding an app, and then?!
Example: http://graph.facebook.com/anguillabeachescom
I can’t see that being done anywhere on the page’s settings interface.
My guess would be you have to claim your domain with Facebook to make things work this way (and maybe have to have a special category set for your Facebook page – the example page you mentioned is of type “website”.)

Is there a way to track our website activity from our Facebook fans clicking link on our page?

We just started an advertisement with Facebook and are curious if there is a way to track who has visited our website by clicking our website link on our Facebook page? I am very pleased with all of the ways to track the performance of our ad on Facebook and want to see if people are not only 'liking' our page, but visiting our website to learn more about us. Any information would be helpful :)
This is our website if you need to look into it further:
http://drkennethlevine.webs.com/
I don't know how much you can change about your website or how it is built. However there is a way to track where the users who visited your page from. Use the http reffer field.
In php (and probably in most other languages) you can get the refer link by using
$_SERVER['HTTP_REFERER'];
The refer field contains the last page visited by the user.
Simply count the number of users that are surfing from your facebook page to your website.
You can use $_SERVER['HTTP_REFERER']; as mentioned by #fake, or simply use Google Analytics, which will provide you a lot of statistics for free, including referers, stats by browsers, countries...
All you have to do is create a GA account, and link your website to your account (you'll have a few javascript lines to add in your footer for it)