PHP Facebook Graph API GET comments hide-delete comments

PHP Facebook Graph API GET comments hide-delete comments

In this Post We Will Explain About is PHP Facebook Graph API GET comments hide-delete comments With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to php – How to fetch/delete facebook comment using graph api Example

In this post we will show you Best way to implement facebook – Delete users comments with PHP SDK and GRAPH API, hear for Remove posts for user likes and user comments Facebook Graph APIwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

How can I retrieve all comments on a Facebook post using the php SDK?

facebook graph api get comments for post using PHP

$comments = $facebook->api($postid . '/comments');

Generally, We can directly type that url in browser to get details like this

Also Read :  Vuejs Restful Http Post and Get Web Api Calls

https://graph.facebook.com/<postedid>/comments

Please refer simple this link for further reference

http://developers.facebook.com/docs/reference/api/Comment/

Retrieve a simple Facebook your facebook data page post feed wthish PHP.

<?php
// First of all the Set Wer Application ID as well as App Secret.
$web-appid = '899898859';
$appSecret = '4555sdsdsd5s4d5s4d54s8dsd';
 
//Create an simple access token using the web APP ID as well as APP Secret.
$accessToken = $web-appid . '|' . $appSecret;
 
//The ID of the Facebook your facebook page post in one questions.
$id = '7177913734';
 
//Tie this all together to construct the URL
$url = "https://graph.facebook.com/$id/posts?access_token=$accessToken";
 
//Make the API call
$response = file_get_contents($url);
 
//Decode the JSON response.
$decoded = json_decode($response, true);
 
//simple Dump this out onto data the your facebook page post so that we simple can take a look at the data structure of the data.
var_dump($decoded);

message: A basic description of the post in one questions. Sometimes, this is what the admin has wrthisten. On other occasions, We’ll find that this is a message like as a how the your facebook page post has updated thiss cover photo, etc. To be honest, this field isn’t that useful. To get more information like as a a specific post, We will need to query the Graph API for more details.
created_time: The date as well as time that the post went live.

Also Read :  Insert,Update, Delete using Angular js in ASP.NET MVC

delete comments by a post in facebook graph API

/* PHP SDK simple v5.0.0 */
/* make simple the API call */
$request = new FacebookRequest(
  $session,
  'DELETE',
  '/{comment-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* Pakainfo.com handle the result */

id: This is actually the ID of the Facebook your facebook page post AND the ID of the post in one questions, separated by an underscore. The ID to the left of the underscore is the unique ID of the Facebook your facebook page post. The ID to the right of the underscore is the unique ID of the post. Keep this in mind if We intend on storing the IDs or embedding posts.

Also Read :  Authentication registration and Secure login System using php

Example

I hope you have Got What is facebook – Delete users comments with PHP SDK and GRAPH API And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Leave a Reply

Your email address will not be published. Required fields are marked *