Search code examples
facebookfacebook-graph-apifacebook-marketing-api

Facebook Graph API v2.11+ - '/business_id/pages' does not return associated pages under the business manager


I am the admin of a business manager and the business id has two pages associated with it. I am the owner of one of the page and another business admin is the owner of the other page.

https://graph.facebook.com/v2.11/business_id/pages

Running above snippet on graph-api explorer returns

{
  "error": {
  "message": "(#12) pages field is deprecated for versions v2.11 and higher",
  "type": "OAuthException",
  "code": 12,
  "fbtrace_id": "DbR8kp2GtWz"
 }
}

I am able to get pages related to my account straightforward via

https://graph.facebook.com/v2.11/me/accounts

But how can I get all pages associated to my business account instead of my personal account


Solution

  • According to https://developers.facebook.com/docs/graph-api/changelog/version2.11 you should now be using:

    https://graph.facebook.com/v2.11/{business_id}/owned_pages

    or

    https://graph.facebook.com/v2.11/{business_id}/client_pages

    depending on your need