Get a Facebook page on a public Android page
I am trying to get a list of channels from the Facebook homepage in an android app.
I have a page id and an access_token for the page. I am trying to get a feed with a request using the following url: -
"https://graph.facebook.com/page_id/feed?access_token=sometoken"
But doing above gives me the following error: -
Tried accessing non existent field (feed) on node type (Open Graph Object)
I also tried it from Google Chrome. Gives me the same error.
How can I solve this? Any help would be appreciated.
source to share
If the page id is a numeric value, you may be getting the wrong value.
You can try using any of the following solutions: -
1) Use the page username instead of the numeric page id.
2) Replacing the feed with messages.
Something like that: -
"https://graph.facebook.com/page-username/posts?access_token=sometoken"
source to share
For me, the error message indicates that the one used is page_id
not real page_id
. You are replacing it with a real numeric ID in the request, right? If it object_id
is a page, the request should work.
You can check the type object_id
with
/{object_id}?metadata=1&fields=id,name,metadata{type}
For example, for the CocaCola page
/40796308305?metadata=1&fields=id,name,metadata{type}
it returns
{
"id": "40796308305",
"name": "Coca-Cola",
"metadata": {
"type": "page"
}
}
source to share