#What is the difference between User.id and User.username?

8 messages · Page 1 of 1 (latest)

viscid oracle
#

They're the same in every example I've seen. Under what conditions might they be different?

pine pecan
#

just upper/lower case afaik

#

id is all lowercase, username can be mixed

#

displayname vs database key

viscid oracle
#

Thank you. It's been my observation that APIs like "Get users by ID" specify user IDs as input, but in fact will accept usernames and, apparently, convert to lowercase internally. Is that universally so?

pine pecan
#

not sure isee

viscid oracle
#

One could argue that the docs should specify username, with id reserved for those cases in which case conversion is not being performed. (I'm an Olympic-class nitpicker. 😉 )

Thanks for your help, @pine pecan. Much appreciated!

pine pecan
#

my guess is it got annoying people using the wrong one so thibault added auto conversion pepefunny