-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Match error: Unknown key in field username. in users.setAvatar rest call #7509
Comments
Please show an example command of how you are able to reproduce this. |
This is working fine for me on 0.57.1
How do you set the "username"? |
@localguru you even tried setting the avatar to another user by providing their username? |
@graywolf336 no, I only tested to change my own avatar. How do I pass the "username" via curl? If I try - as admin - to change another user's avatar by "userid" I get an error:
Shouldn't that be possible as admin? But through the webinterface there is also no way for changing avatars of other users as admin. |
What command was you using to do it? As it is possible, we developed it and tested it a while back. |
Same as above just with the userid of another user
|
That's why then, that is the incorrect usage. Check the documentation: https://rocket.chat/docs/developer-guides/rest-api/users/setavatar |
Sorry, don't understand. Could you post an example please. |
You always have to use your own user id when calling it. However, some api endpoints allow passing in a |
Hi all. I can confirm that in current version 0.57.2 api request users.setAvatar not working if you use username parameter in payload of request. Example:
Result:
Ok, let's try userId instead:
Result:
Good. Now let's look at source: i don't see here anything about username parameter. Please correct me if i am wrong. |
Rocket.Chat Version: 0.57.2
Running Instances: 1
DB Replicaset OpLog: enabled
Node Version: v4.8.2
According doc https://rocket.chat/docs/developer-guides/rest-api/users/setavatar
I'm trying to call (/api/v1/users.setAvatar) to set user avatar but I get this error :
{
"success": false,
"error": "Match error: Unknown key in field username"
}
when I change username to userId and test It works but with username it's not working.
The text was updated successfully, but these errors were encountered: