From here: https://developers.facebook.com/docs/graph-api/reference/user/accounts/ I got to write this in my code
$request = new FacebookRequest(
$session,
'GET',
'/{user-id}/accounts'
);
$response = $request->execute();
The problem here is with version 2.8 of the API and SDK 5.0 execute() doesn’t exist. How can I get a list of all the pages on a Facebook account.
2
Answers
@JayNCoke was correct with the approach.
$response returns a FacebookFacebookResponse object
To get it in a usable data format, just call getDecodedBody() like below
This returns an array.
You have the right endpoint, you just need to make sure you have the right call in PHP:
Also remember:
manage_pages
permission.