I'm getting checkins from the facebook API in a iOS-app. This worked perfectly earlier, but now I always get this response with an empty array. Has the API changed or something?
reponse:
{
"data": [
]
}
Facebook had an issue, they have fixed it now.
Related
I am using FB Graph API to get the post reach posted on a page. But the API always returns an empty data object (no errors).
Query:
https://graph.facebook.com/v2.10/[POST_ID]/insights?metric=post_impressions_unique&access_token=[PAGE_ACCESS_TOKEN]
Response:
{
"data": [
],
"paging": {
"previous": "https://graph.facebook.com/v2.11/[POST_ID]/insights?access_token=[PAGE_ACCESS_TOKEN]&metric=post_impressions_unique&since=1528268400&until=1528441200",
"next": "https://graph.facebook.com/v2.11/[POST_ID]/insights?access_token=[PAGE_ACCESS_TOKEN]&metric=post_impressions_unique&since=1528614000&until=1528786800"
}
}
I have tried it with other API versions v2.11, v2.12 and v3.0 etc. same response. And posts do have a reach metric when checked on the page.
Anyone have any clue about whats wrong here?
Thanks to CBroe 's comment pointed me in the right direction.
My app that I used to get page access token didn't have the read_insights permission.
From Graph api Explorer , from the dropdown "Graph API Explorer" in the top right, I selected my app.
From "Get token" dropdown just below it, select "Get App Token".
From the popup window make sure you have the read_insights permission ticked along with others.
When I send the request search?type=page&q=test&access_token=[access_token] to Graph API, the response is empty data. Is there a problem with the access token or is there something missing from the request URI? I also can't seem to find a comprehensive documentation of the search method, only that for places search.
This is the response I'm getting:
{
"data": [
]
}
Facebook made a lot of changes recently:
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#search-4-4
You can no longer use the /search endpoint with the following object
types:
event
group
page
user
Try this instead :
https://graph.facebook.com/pages/search?q=[PageName]&fields=id,name,link,location&access_token=[access_token]
it worked for me
How can I get the users friends work history? Currently I tried this in the Graph api explorer:
GET /me/taggable_friends?fields=id,name,work&acess_token...
and the query returns the friends, but don't show any job.
The response returns me somethin like this:
"data": [
{
"id": "<some-long-string>",
"name": "<name>"
},
I tried to do this:
GET /<the-some-long-string>...
And the response says me that the user id is incorrect. Googling I didn't found anything :'(
Thank you!!!
From Facebook Developers:
"message": "(#10) To use taggable_friends on behalf of people who are
not admins, developers and testers of your app, your use of this
endpoint must be reviewed and approved by Facebook. To submit this
feature for review please read our documentation on reviewable
features: https://developers.facebook.com/docs/apps/review"
I'm trying to post an image from a URL to reply to a certain comment on Facebook. The Graph API documentation at https://developers.facebook.com/docs/graph-api/reference/object/comments/ mentions that you can publish an image from a URL using the 'attachment_url' field.
When I try that in Graph API explorer by posting attachment_url to {comment_id}/comments, I get the following error:
{
"error": {
"message": "An unexpected error has occurred. Please retry your request later.",
"type": "OAuthException",
"code": 2
}
}
If I try to post a message, it works perfectly, but attachment_url doesn't work, even though the documentation mentions it. Anybody has any idea what's going on here?
NOTE: I wanna first try to knock it off using the Graph API Explorer, then I would move to my desired language. As such, I don't have any code to paste here. Thanks
This was a bug in the API and about 2 weeks after my report, Facebook has finally resolved this. Here is the bug report:
https://developers.facebook.com/bugs/1487638524783972
I was using the user_photo_video_tags permission, but after it was announced that it would be deprecated, I switched the permission to user_photos.
Without user_photo_video_tags and with only user_photos, I get the following response when making an authenticated call to 'me/photos':
{
"data": [
]
}
but with user_photo_video_tags I get the correct response with tagged photos and uploaded photos.
Isn't user_photos + user_videos supposed to be equivalent to user_photo_video_tags? Why am I getting different results?
(there are a few similar questions out there, but I do not believe they are the same use case)
Not sure what you're seeing here. I can try it using the Graph API Explorer with user_photos, and I get the expected results: https://developers.facebook.com/tools/explorer?method=GET&path=me%2Fphotos