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
Related
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
I'm trying to download every comment on a public facebook post (it's one of those "can you do this basic algebra problem" posts - I want to see what percent of the comments get it right).
The Graph API Reference shows that I should be able to just GET graph.facebook.com/v2.5/{object-id}/comments.
I believe the object-id of this post is {user-id}_{post-id}, where post-id is the id in the url. So given this url:
https://www.facebook.com/beth.mansfield.9/posts/10207885721596563
The user-id of facebook.com/beth.mansfield.9 is 1101752663 (from findmyfbid.com), and the post-id is 10207885721596563 (from the url), which makes the object-id="1101752663_10207885721596563".
When I try graph.facebook.com/v2.5/1101752663_10207885721596563/comments in the Graph API Explorer, though, I get:
{
"data": [
]
}
What am I doing wrong? Is there another way to get the comments? There are close to a million so loading them all in the browser and scraping with javascript would be unfeasible.
That is a user profile. You can only get data of a user profile if that specific user authorized your App. In that case, you would need to authorize with the user_posts permission. Just because it is public, does not mean you can get the data - that would only work for Pages.
I am trying to get the mutual Likes using Facebook Graph API V2.0, But it returns only the count.. here is the output I got..
API URL : https://graph.facebook.com/876378047155445?fields=context.fields(mutual_likes)&access_token=xxxxxxxxxxxxxxxx
Output:
{
"context": {
"mutual_likes": {
"data": [ ],
"summary": {
"total_count": 4
}
}
},
"id": "xxxxxxxxxxxx"
}
Please suggest some solution...
Thanks in Advance...
I too experienced this problem and I think it's a bug in Facebook's API. The solution I used was to use this endpoint "/{user-id}?fields=context" as described here: https://developers.facebook.com/docs/facebook-login/social-context/v2.0#user-context, which is not bugged! It will return both the mutual_friends and mutual_likes simultaneously however, and not just specifically the mutual_likes.
EDIT:
It seems like I was totally wrong, and it is not a bug with the facebook API. You can only see the mutual friends and mutual interests if the users are already friends unless you provide "appsecret_proof". According to facebook documentation:
"If you want to call this endpoint on behalf two app-users who are not friends, then you must provide the appsecret_proof parameter along with the user access token when making the request. This means you must call this endpoint from your server." -https://developers.facebook.com/docs/graph-api/reference/v2.3/user.context/mutual_friends
The thing is they only documented this in the mutual_friends doc, but not the mutual likes document here: https://developers.facebook.com/docs/graph-api/reference/v2.3/user.context/mutual_likes, which I've tested and requires the users to be friends before receiving the data about the mutual likes.
To fix this you can either go on the facebook app and disable the requirement of appsecret_proof (https://developers.facebook.com/docs/graph-api/securing-requests#appsecret_proof) or have to call this api request server sided.
For you to get the actual Likes in the data array, both users need to grant the "user_likes" permission. Otherwise, you will only get the count. This allows you to evaluate shared interests quantitatively while protecting the users' privacy.
I'm authenticating myself against FB with the following permissions:
"read_stream", "publish_stream", "user_photos", "friends_photos", "friends_likes", "friends_status", "read_friendlists"
I manage to do a successful call to https://graph.facebook.com/user_id/home with the access token and I get back results, however when following next link
paging: {
previous: "...",
next: "..."
}
I'm getting back an empty json, e.g.
{
data: [ ]
}
Couple of observations:
When working with the FB API explorer everything works fine (I've changed the token manually)
When trying to fetch more posts (say 250) I'm getting also the old posts, e.g. the ones that I should have gotten when calling next
When using a token that was supplied by the api explorer everything works just fine
read couple of posts on this matter - wrong permissions, official docs all seem to point to wrong permissions, however I've added all permissions and still the same result.
I'm having an issue getting the graph search to work when I manually use the Graph API Explorer to generate an access token for myself against my application.
I've created an application, set the sandboxed mode to 'off', and then manually granted my user account permissions to my application. To be safe, I included all the permissions available in the graph API explorer before generating the access token.
When I click on my access token, I see that it is still valid, and has all the permissions listed, however, when I perform the following search:
/search?q=myphonenumber&type=user
I get an error saying:
{
"error": {
"message": "(#200) Must have a valid access_token to access this endpoint",
"type": "OAuthException",
"code": 200
}
}
I know the above search code is valid because I was able to get it working a few days ago, I can't seem to figure out what has changed. Am I missing a permission somewhere that prevents me from using my access token to do an API search?
UPDATE: I should also mention that normal /me queries work just fine, it seems to be only the search which is disallowed.
I got the same problem when searching for email addresses using the same search term. While researching the problem, I found this bug report: https://developers.facebook.com/bugs/453298034751100?browse=search_516534c213df06064266897. So Facebook is aware of the problem but nothing has changed for more than a week now.