I'm trying to get the group feed via Facebook Graph API.
According to the documentation
https://developers.facebook.com/docs/graph-api/reference/v2.8/group/feed
I'm trying to costruct the appropiate url and here it is
https://graph.facebook.com/v2.8/154205721275156/feed?access_token=[TOKEN]
And each and every time I'm getting the next result
{ "error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1,
"fbtrace_id": "B7/12QU7BW/"
} }
[TOKEN] is valid, it applies to the member of the group.
At the same time other requests for the same group, such as "/events" or "/members", return correct answers.
What is wrong with the "/feed" request?
Related
I'm new in facebook graph API, I want to get all the details of scheduler post like
full_picture
message
etc
I used :
GET v4.0/...?fields={fieldname_of_type_ScheduledPost} HTTP/1.1
Host: graph.facebook.com
But, I got error :
{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: ...",
"type": "OAuthException",
"code": 803,
"fbtrace_id": "A-aQAYXFbAdSX7oMYfcUP_3"
}
}
Ref., https://developers.facebook.com/docs/graph-api/reference/scheduled-post/
The brackets and dots are just placeholders.
Wrong
fields={id,message,...}
Correct
fields=id,message,...
Also, you have to use the ID of a scheduled post instead of just using "..." in the API call.
To get all scheduled posts, use this endpoint: https://developers.facebook.com/docs/graph-api/reference/page/scheduled_posts/
Example:
/me/scheduled_posts?fields=id,message&access_token=<your-page-token>
I'm getting the feed from a page through the Facebook Graph API. At the end there is a link given, in order to retrieve the next page of the feed, as shown here (I removed my access token):
"paging": {
"previous": "https://graph.facebook.com/v2.8/14408401557/feed?fields=from,message,link,created_time,type,name,id,comments.limit\u0025280\u002529.summary\u002528true\u002529,shares,reactions.limit\u0025280\u002529.summary\u002528true\u002529&limit=100&since=1483025111&access_token=XXX|XXX&__paging_token=enc_AdABZBt6ZC7DctahZAsXG9wOUghwu8tMLYo1ZAlMdLcVCwa8VqVjBEsZABFiLRSVlA96xTQzKkrnd2ALIlGrGLhZALSum7&__previous=1",
"next": "https://graph.facebook.com/v2.8/14408401557/feed?fields=from,message,link,created_time,type,name,id,comments.limit\u0025280\u002529.summary\u002528true\u002529,shares,reactions.limit\u0025280\u002529.summary\u002528true\u002529&limit=100&access_token=XXX|XXX&__paging_token=enc_AdBOFdepWf3pcZBDLiV0r00WXJZA8qN7iYCZCzrwSoZCxYuKnHvXVUyCp35KCz4CW35p0gsmQV3Vzs5xKXe16QyCKMEN"
If I try to use the given url, I get the following error:
"error": {
"message": "Syntax error \"Expected \")\", got end of string\" at character 171: from,message,link,created_time,type,name,id,comments.limit(u0025280\\u002529.summary\\u002528true\\u002529,shares,reactions.limit\\u0025280\\u002529.summary\\u002528true\\u002529",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "Dxf6QrEjBl6"
}
Does anybody know why?
They seem to be encoded fine as output of JSON. But my guess is you are not decoding them before using. e.g.
comments.limit\u0025280\u002529.summary\u002528true\u002529
e.g. if you replace manually it works
comments.limit%280%29.summary%28true%29
See this answer https://stackoverflow.com/a/3020108/1542667 for an explanation of JSON encoding of strings, \u0025 is just '%'
https://graph.facebook.com/895895040502397/events/attending/?fields=id,name,description,place,timezone,start_time,cover&offset=0&limit=2000&access_token=xxxxxxx&since=&until=2997993600
With this url I am getting below error.
{
"error": {
"message": "(#100) Tried accessing nonexisting field (fql) on node type (User)",
"type": "OAuthException",
"code": 100
}
}
Any idea how I can fix it.
.../895895040502397/attending...
Remove "events", the ID is already the ID of a specific event.
You can get event like this.
https://graph.facebook.com/895895040502397/attending/.....
Also Use CURL PHP.
According to https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0,
Some edges have an upper maximum on the limit value, for performance reasons. We will return the correct pagination links if that happens.
A recent response for https://graph.facebook.com/20531316728/feed?limit=500&access_token=CAACE... is
{
"error": {
"message": "(#100) The 'limit' parameter should not exceed 250",
"type": "OAuthException",
"code": 100
}
}
However (as documented) some endpoints allow limit=500. The response has error code 100 and error type OAuthException but the message tells a different story. What is a good way to detect that the HTTP 400 Bad Request response is because of the limit parameter?
This issue has been raised to Facebook developer team. https://developers.facebook.com/bugs/763425230375017/
For some of my fanpages, it gives OAuth error , once you try to get data using /PAGE_ID/insights/page_fans/lifetime Facebook API.
What excatly happened was, I used PAGE_ID/insights/page_fans/lifetime?until=2013-05-04. It pulling through data. But if I use PAGE_ID/insights/page_fans/lifetime?until=2013-05-03 , that means same query a day before the first query, it gives
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
}
Does any have proper explanation for this?
you cannot use date range in /insights/page_fans/lifetime
query it without any parameters
you can combine
/insights/page_fans/lifetime
/insights/page_fan_removes
/insights/page_fan_adds
to get a daily reading