What is a reliable way to check whether a Facebook Page is published or unpublished using the graph API? I currently do this:
http://graph.facebook.com/{page_id}
and check if the return value is "false". If it's false, I conclude that it's unpublished and if it returns a graph object, then conclude that it's published. But I'm noticing now that a lot of published pages return "false" from the above request.
Here's an example:
this page is published: http://www.facebook.com/AjiRestaurant
but these requests return false: http://graph.facebook.com/104433516257517 (using page Id) http://graph.facebook.com/AjiRestaurant (using page username)
What is the best way to check whether a Page is published?
In most cases, Facebook should publish it for you, but we've seen a few instances where admins needed to go in and change their page's settings from “unpublished” to “published.” In your settings, navigate to “General,” and then look for “Page Visibility.” If it says “unpublished,” you've found your problem.
To see your unpublished posts, you can use a search bar in the Page Posts tool to navigate through your Ads Posts. This is particularly useful if you have a large volume of posts associated with ads. You can search by the text copy within the ad post using this search bar. You can also search by the Post ID number.
Punch this in under FQL query on http://developers.facebook.com/tools/explorer
SELECT page_id, name, username, is_published
FROM page
WHERE page_id IN
(SELECT page_id FROM page_admin WHERE uid = me())
AND is_published=""
ORDER BY fan_count DESC
That will select all pages in your account and check if they are published, returning all unpublished pages in a list.
It turns out that there's no known way to check specifically whether a Page is published / unpublished. The graph API http://graph.facebook.com/{page_id} will return false if any of the following is true:
If and only if none of the above settings apply, then http://graph.facebook.com/{page_id} will return an object graph.
Note: I'm assuming that an access token with manage_pages permission is not used for the API calls above. With a proper access token, https://graph.facebook.com/{page_id} will return the object graph, regardless of whether the Page has restrictions or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With