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.
Related
I have subscribed to the "feed" event with a webhook. So far I receive the following object when someone clicks on the "like" button of my page:
{"entry": [
{"changes": [
{
"field":"feed",
"value":{
"item":"like",
"verb":"add",
"user_id":11111111111111
}
}],
"id":"2222222222222",
"time":33333333
}],
"object":"page"}
Question 1: I wounder, is it possible to also get an event when the user "unlikes" the page?
Question 2: With this user_id, how can I get the user object from facebook? Is this the "real" facebook user id (i could not get an user object through the graph explorer so far) or is a page specific id of the user?
Thanks in advance!
EDIT: For Question 2, I just needed to add the page access_token to the request to get the user object.
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'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.
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.
After created an app on FB, I get an access token XXX
when I open https://graph.facebook.com/me/likes?access_token=XXX it does show all information that I likes fine.
but when I open to see from another user (who set those info public,such as https://graph.facebook.com/4/likes?access_token=XXX ) I got nothing but
{
"data": [
]
}
Can somebody expand to me why and any idea solve?
You can not view the likes of a public profile, you have to ask for permission(user_likes) from the app to see this info.
Info on the user_likes permissions
user_likes: Provides access to the list of all of the pages the user has liked as the likes connection
Example of Public profile(sorry btaylor, but your name is on the docs )
https://graph.facebook.com/btaylor/likes?access_token=xxx
You will see an empty data set.
From the user docs, talking about the likes connection:
Read
You can read the pages that a User has liked by issuing an HTTP GET to /PROFILE_ID/likes with the user_likes or friends_likes permissions. For example:
https://graph.facebook.com/me/likes