PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] Facebook PHP SDK Issue with specific Facebook Id

 February 11, 2022     facebook, facebook-like, facebook-php-sdk     No comments   

Issue

Im using the following to retrieve information about Facebook pages that I'm the admin of. Specifically the number of likes.

// Get User ID
    $page = $facebook->api($id);
    return $page['likes'];

This works fine for 20 Facebook pages that I admin but I've run into one case where it does not. This is the error that I'm getting in response.

Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

I have checked that the Id being used is correct by viewing the Facebook Id Page under the admin settings. http://findmyfacebookid.com/ also runs into an error when entering the pages url.

Has anyone else experienced this? Is this a bug?


Solution

I am pretty sure you are not using an Access Token to grab the Page likes, and that one Page is restricted by age or country. Either that, or it is unpublished. Also, calling the return value "$user" may be misleading, it is not a User object, it is a Page object, right?

For restricted Pages you MUST use a User or Page Access Token of a User who can access the Page.



Answered By - andyrandy
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing