0

I have everything set up and everything was working properly. I have a popup where the user can reply to a review on their business page. This was also working fine.

My code looks like this:

$url = "https://graph.facebook.com/v3.2/221454575852164769/comments";
$attachment =  array(
    "access_token"  => $page_access_token,
    "message"       => "Thank you so much!!",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($attachment));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$comment = curl_exec($ch);
curl_close ($ch);
$comment = json_decode($comment, TRUE);

This was working fine. Even now this script is working but the issue is it returns this error

Unsupported post request. Object with ID '221454575852164769' does not exist, cannot be loaded due to missing permissions, or does not support this operation

Even after the Curl receives error when I go and check into the reviews on Facebook the comment was successfully posted.

Any help?

Yunus Aslam
  • 2,447
  • 4
  • 25
  • 39
  • 1
    Possible duplicate of [Object with ID '203618703567212' does not exist, cannot be loaded due to missing permissions, or does not support this operation](https://stackoverflow.com/questions/50266800/object-with-id-203618703567212-does-not-exist-cannot-be-loaded-due-to-missing) – Max Voisard Apr 24 '19 at 07:31
  • Its already done and it is Live now. I have been using the API for last 3 months and now all of a sudden it stopped working. Also the comment is getting posted on facebook but due to some reason api is returning that error. – Yunus Aslam Apr 24 '19 at 07:39
  • If so, then it looks like your ID number is wrong. In that case, you must have mis-typed a parameter with the wrong spelling - say it could be your access token or attachment - so it can't reference that instance. – Max Voisard Apr 24 '19 at 07:49
  • The comment is successfully posted on FB. The only issue I am getting is the API is returning error instead of the new comment ID. – Yunus Aslam Apr 24 '19 at 08:20
  • The error means there must be a mismatch between the comment IDs. Other than that, that's all I could conjecture on to help you. – Max Voisard Apr 24 '19 at 08:31

1 Answers1

0

From the duplicate I flagged, you'll see you may need to submit your app for App Review to Facebook for permissions.

https://developers.facebook.com/docs/facebook-login/permissions/v3.0

How do I test a Facebook app since the recent introduction of login review?

Either that or you mis-typed a paramater/variable, hence the incorrect 18-digit ID number since it can't reference that instance of an object.

Max Voisard
  • 1,685
  • 1
  • 8
  • 18