I am querying in graph api like this /userid/albums
I am getting response of most users successful but I am though not getting response of some users. It give me blank response-
{
"data": [ ]
}
You need to ask the user for user_photos/friends_photos in order to get the albums of the concerned user or his friends.
Related
I have a page access token and I'm trying to retrieve the video_insight of my page's videos in the Facebook Graph API Explorer.
The endpoint is returning fine for my first 4 videos and the remaining 2 videos I'm receiving an empty data response.
{
"data": [
]
}
I'm using the same token for all my requests. I have the read_insights permission.
Does anyone know what's causing the empty response?
I'm trying to get the list of friends who were at a particular place.
For the Bellagio in Las Vegas I use this to get the context ID:
https://graph.facebook.com/v2.5/83005907820?fields=context
I then do this to get the list of friends (User nodes) who were tagged there:
https://graph.facebook.com/v2.5/b3Blbl9ncmFwaF9jb250ZAXh0OjgzMDA1OTA3ODIw/friends_tagged_at
The problem I have is that I only get this in the response:
{
data: [ ],
summary: {
total_count: 1
}
}
I'm using an access token which I got from the Graph API Explorer with all the permissions selected.
Any ideas on what I could be doing wrong?
Only friends who authorized your App will show up in that list, for privacy reasons. I assume that one friend is tagged at the specific place, but he did not authorize your App.
I have a web application that uses Facebook API. Now, I'm facing with an issue on getting the total of likes from a user's post.
I have a long lived "userToken" valid for 2 months with the following scopes: public_profile, email, manage_pages, publish_actions
I use "POST /feed" to send a link into the user's timeline and I get a post ID.
Then, I try to get the total of likes for this post with "GET /{POST_ID}/likes?sumary=true" and I get ZERO likes even if the post has many likes.
{
"data": [
],
"summary": {
"total_count": 0
}
}
I tried to use only "GET /{POST_ID}" to get post information and I get the following json response:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
I have this issue only when I post to a user's timeline. However, when I post to a Facebook page, I can get the post ID and the numer of likes.
I made a test by adding read_stream scope and I can get the post information. However I read in API documentation that this permission has a limited use: "This permission is granted to apps building a Facebook-branded client on platforms where Facebook is not already available"
Then, I started to check other applications that get post likes and I noticed that they are using only public_profile, email, manage_pages, publish_actions. They are not using read_stream.
So, my question is how they can get this information only with these scopes?
I hope anyone of you will be able to help me?
Thanks
Can you please check, if the post is public.
If you have the post id of a public post you can fetch the likes simply by requesting the endpoint you already mentioned.
To get your feed you need the read_stream or user_posts permission.
I'm using a Facebook application that get all user likes in order to check if a given page is liked using
https://graph.facebook.com/{USER_ID}/likes?access_token={MY_ACCESS_TOKEN}
Everything works fine for me and for the most part of the users, except for some users, that return this:
{
"data": [
]
}
Why does it return an empty data? I already requested the authorization for user_likes in the application
Apps only have access to a user's public information. Even with user_likes permission you will get no Likes data from a user that has set their Likes to private.
Facebook allows to get list of Likes and Events of a currently authenticated user and his friends by:
https://graph.facebook.com/me/likes
https://graph.facebook.com/[friend's_user_ID]/likes
We need to get list of Likes and Events of people who aren't friends with a currently authenticated user. I tried this to get Likes:
https://graph.facebook.com/[non-friend's_user_ID]/likes
but that only returns the blank response
{
"data": [
]
}
Is there any way to get Likes and Events of non-friends (those who are not my friends)?
If a user's likes are public you should be able to access them with any access token, but otherwise no.