-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Is your feature request related to a problem? Please describe.
Many actions cannot be performed if you do not know the user ID of a user.
For example, the /public/v1/moderation/bans API requires a user_id param to be passed.
However, there is no way to look up a user's ID from their username. This means that API consumers must keep lists of user_ids relevant to whatever they are building, to be able to reliably perform actions that require them.
Use case example: Say I build a moderation panel app. It has a input with a submit button that allows me to ban users by username. Say I know a username of someone I want to ban, but I have no clue what their user ID is. There is no way to programmatically get that information, and therefore my implementation is impossible to accomplish.
Describe the solution you'd like
I would like to see /public/v1/users be updated to accept user_id OR username, and thusly return both of those params as part of the response.
The current 200 response is:
{
"data": [
{
"email": "john.doe@example.com",
"name": "John Doe",
"profile_picture": "https://kick.com/img/default-profile-pictures/default-avatar-2.webp",
"user_id": 123
}
],
"message": "text"
}username doesn't even exist in this response. It would be nice if it did.
Or, alternatively, every API endpoint that accepts user_id as a parameter should also be able to accept a username as a parameter in lieu of user_id
Describe alternatives you've considered
As my personal app tracks chat messages externally, I have considered (and have implemented) a list of all users that have sent chat messages in this session, so I can derive their user_ids. But this causes two problems:
- I'm wasting memory storing a cached list of users
- I can't ban people that haven't shown up in my chat this session
This is undesirable because I may want to ban/unban someone on the fly from my app that