AmityCoreClient.newUserRepository().updateUser - error

I’m trying to update my photo & name in Amity

        await AmityCoreClient.newUserRepository().updateUser(userMail).avatarFileId(file1.fileUrl).update().then((AmityUser user) async {          ......

with the following parameters
userMail = allerg.meridor@gmail.com
file1.fileUrl = https://api.eu.amity.co/api/v3/files/67d67520d6544a6fb51c18f5c1e1bbc1/download

The error - Parameters validation error!
In the log -
[log] *** DioError ***:
[log] uri: https://api.eu.amity.co/api/v3/users
[log] DioError [DioErrorType.response]: Http status error [422]

Hi @meridork ,

Which platform(s) & version does this occur in?

Thank you,
Amity Support

I’m working with Flutter
debugging with Android studio & Android mobile device
Amity - amity_sdk: ^0.23.0
Flutter version 3.10.6

Please point me a way to update my avatar,
Do I need to upload image and then update the user
in the command
AmityCoreClient.newUserRepository().updateUser(email).avatarFileId(file1.fileId).update().then((AmityUser user)

Or in one step like following?
AmityCoreClient.newUserRepository().updateUser(email).avatarFileId(image).update().then((AmityUser user)

Hi @meridork ,

For this it’s AmityCoreClient.newUserRepository().updateUser(email).avatarFileId(avatarFileId).update().then((AmityUser user)
Please refer to https://docs.amity.co/core-concepts/user#avatars

Does this resolve your issue?

Amity Support