Is it possible to get user id by userName? - facebook

I am building a small facebook application, in which I am performing the following:
The user fills out his friend's names (using friend selector), What I want to do next is retrieve the friend's user ID based on their user name. Is it possible? Can I query a user by its name and receive his id?

That's not true! usernames ARE unique too, but the actual name isn't unique!
The username itself is the part from the url e.g.: www.facebook.com/zuck (Page from Mark Zuckerberg) his username is zuck BUT not all user have set a username. For them it shows an userid e.g.: www.facebook.com/profile.php?id=123

No because names aren't unique. What you could do though is capture the UIDs that the friend is submitting, because even though it looks like names, what he's really doing is picking out UID's. Then, even without your app being approved, you can query some basic data (first, last, locale, profile url)

Related

Is this possible to retrieve public informations from facebook without access token?

I've got a simple question, but can't find out any real solution/answer.
Is that possible to retrieve Public informations about someone's facebook profile, just by typing its firstname and lastname?
Eg. I'm typing for John Doe, and some "API" return to me his first/last name, gender, age range, localisation…
Since now, I only could get Invalid OAuth access token when using application's access_token, and This action can be taken only on the current user and the param 'id' (if any) must be the current session user. if I directly query /{the-user-id}/?fields=xxxxxx
From far I've read, that's not possible (especially now that columbia analytica stolen data !)
(also pointed out by #WizKid)

Facebook app URL scheme to a group with an id that is not a number

I'm trying to link to Facebook groups in the app from my website. Currently the scheme works for linking to a group with an ID that is a string of numbers, eg. 1808123152733889
fb://profile/1808123152733889 (this works currently)
However some Facebook groups have an ID that is a string of letters, eg. EastBayBerniecrats and I haven't found a scheme that works.
I have tried:
fb://profile/EastBayBerniecrats,
fb://profile?id=EastBayBerniecrats,
fb://groups/EastBayBerniecrats (takes user to list of all subscribed
groups),
and others. I tried each with a "/" at the end and without.
Any ideas?
EDIT: turns out that it suits my purposes to search for the groups id number using a service like this: https://lookup-id.com/
You have found your group id. It's
1808123152733889
You need to use this url scheme:
group?id=[your_group_id]
So, the final link from app to facebook iOS app, should look like:
fb://group?id=1808123152733889

how can i upload course and user with its id on moodle

I want to upload course using upload courses menu.
and i want to import the id with the other fields.
I tried "id","shortname","fullname","category" as a filed on the csv.But it uses incremented id instead.
Oh and i want the same thing for user too.
That cannot be done - all ids in Moodle are automatically generated, in order to make sure they always uniquely identify the item (course, user, etc).
Instead of trying to identify the course by id, you should look at identifying it by shortname or idnumber.

get Facebook Group Id using identifier or url

I would like to get a facebook group id by using a URL or specific identifier.
For ex: http://www.facebook.com/groups/chennaifoodies/ should give group id 194462073956868.
Is there way to get the group id by using above URL or identifiers like 'chennaifoodies'?
If I tried https://graph.facebook.com/chennaifoodies, then it gives the fan page id.
I think 'wallflux' has done a wonderful script, so I need a script like that to get group the id.
is there any way to get a group id using graph api or fql?
Thanks.
I don't think you can get the Group ID from the url you mentioned with the group username.
But, you surely can get the same with the url:
http://graph.facebook.com/search?q=chennaifoodies&type=group&access_token=ACCESS_TOKEN
Yes, you'll be needing an active user access token to query this.
Or, the graph API (the same thing)-
/search?q=chennaifoodies
Demo

API call to retrieve all public information of Facebook user?

I know I can call each individual field via something like
/---ID----?fields=gender,languages,age_range,bio,birthday,education,email,hometown
Is there a quicker way than listing every single field?
It is ok if the user has most of these fields locked down with their privacy settings, I just want it to pull what is available.
just try:
https://graph.facebook.com/{{ username or uid }}?access_token={{access token goes here}}
Example:
https://graph.facebook.com/zuck?access_token=###
will give all the public information available for that user.