I've been trying to figure out how to retrieve a list of child pages for a given Facebook page. We have a customer that has a master page and several hundred child pages under it (set up by Facebook staff). When I create a page for a user (not in a parent-child relationship) then I can access /me/accounts to get the list and the page access token. But when I use the /me/accounts API on the customer's account I only see the parent page and none of the child pages.
How do I get a list of children for the parent page? I tried using /PARENT_PAGE_ID/accounts (pages, children, etc, etc) but none of them seem to exist - I couldn't find any mention on the FB developer page regarding how to do this
How do I post to the child pages using the graph API? The user I'm using has permissions to post on the child pages (on the Facebook page) and even though I'm logged in as the user, the posts show up as if they were posted by the page. When I try to post to /CHILD_PAGE_ID/feed using the user token (or even parent page token) I get a successful response from the API but don't see the post show up. When I publish to a regular page it works fine.
Is it always the case that when a user posts to a child page that the posts will always show up as posted by the page admin? For regular pages you have to "log in as page" to do this so this behavior seems different.
Any help would be greatly appreciated.
I was able to find the solution. The use of Page API is not required for posting to child pages. While Facebook does not list the child pages under /me/accounts, you can still access the auth token using one of two ways:
https://graph.facebook.com/CHILD_PAGE_ID?fields=access_token&method=GET&access_token=USER_TOKEN
Or using PHP:
$facebook->setAccessToken(USER_TOKEN);
$facebook->api('/CHILD_PAGE_ID?fields=access_token');
Both are really the same and will give you the same array containing the child page ID and the token to use to post on the page.