I need to search for certain users on Facebook by their names(ex. Full name or First_name). Is it possible to do that without having access token for user?
No, you cant do that,
Atmost, you can search for User object (note, that you MUST provide search type) (will include everything related with jashwant)
http://graph.facebook.com/search?q=jashwant
but this
http://graph.facebook.com/search?q=jashwant&type=user
append access_token to requested URL.
Related
I'm working on creating an application for a client that has to search Yammer for a term specified by a user. I'm using the Yammer JavaScript SDK to authenticate the user's login to acquire the access token which I then use to query the search REST API.
This is all working great, but I need to know about the user access rights using the SDK and REST API. Will the search endpoint restrict the search results to the groups and files that a user has access to? Or does the endpoint return everything that matches the search term regardless of the user's access to it?
Unfortunately I only have the one user account on the client's Yammer network to test with and can't really investigate the issue properly.
Any feedback will be appreciated!
It will return only what that user has access too
ie. If they can not see a hidden private group they would not be able to search for it
Try to think of the Javascript SDK emulating them logged into yammer.com
Is it possible to do a Graph API search without requiring the user to login? (App token only?)
ie: I want my user to be able search for Facebook Users from my website without requiring them to allow access with my application. I simply want my web page to return a list of matching names.
AFAIK, you can't do that.
Allways you need at least an user token, so after he/she authenticate you can search "impersonating" that user,
Is there a way to get a user's facebook user id from their login email address?
I want an API call where I can provide joe#example.com and get facebook user id 342255534.
I'll use that id to call http://graph.facebook.com/342255534/picture?type=large
The closest thing I've found is https://graph.facebook.com/search?q=EMAILADDRESS&type=user&access_token=ACCESSTOKEN, but that requires an access token, which I'm hoping to avoid.
I know this isn't how it's supposed to work, but is there a way to get a generic access token?
You can use your own access_token for the application, and change it to a long-lived access token so you can make the API call in a cron. The only issue is that you will have to login to the app every so often to update the access token.
UPDATE: The User Search API is now deprecated, so you cannot search using email addresses. But name based searches still work.
You can create an app and get an access token for that app. Instructions are here: https://developers.facebook.com/docs/authentication/applications/
Unfortunately, a search for a user_id by email only works with a user access token.
You don't need to be friends with a user to get their id by email address.
Let's rule out the obvious...
My Facebook app requests the following permissions: user_work_history, friends_work_history
...so the usual suspect (insufficient permissions) isn't the source of my problem.
ISSUE:
The following graph api call works perfectly: /me/friends?fields=name,work
I get back names, ids, work history, etc. Just like you'd expect.
BUT
When I replace the /me with the user id of one my apps users (who has already authorized the app), I can only see names and ids (no work or education fields).
Why is this?
The reason why, is the access token you are using is not the access token belonging to the user you want to look at. Check out your token in the linter tool (https://developers.facebook.com/tools/lint) and see who it belongs to.
When you do get a user access token for that individual, then you can use it to get their friends. You wont need to specify /{userid}/friends?fields=name,work (although you could), just /me/friends?fields=name,work since the access token belongs to that user id.
My question is very simple
On this page: http://www.facebook.com/axefan?sk=app_116526158422952
How did they do to show the names of the connected user, without asking permission? I thought it was not possible to have UID of a member without going through auth?
You don't need an access token to get the name of something in Facebook. You just need the id of whatever it is you are checking (Person, page, event, etc).
For example, you can check these without appending any access token to the URL:
http://graph.facebook.com/595869823?fields=id,name
http://graph.facebook.com/292378408255?fields=id,name