Create user through Backend API

Hi,

I am looking for a way to create users from back-end API. What I can read from here is that I can create user by creating his session (API endpoint is here) If secure mode is enabled than it will ignore displayName as well while creating a new user. I want to create user with his avatar as well. Let me know if that is enable through session only?

The best is if I can create in a single call and if that is not possible than please confirm the following flow

  • Create a new user with Session API
  • Upload avatar file through File API (Can skip in case of avatarCustomUrl)
  • Update user info by Amity API

Regards,
Nasir

Hello, the steps you have listed are accurate. The avatar will need to be updated later using the user update API, as you mentioned in the third bullet point.

Please let us know if you have further questions.

Please can you help me upload avatar , file , image .
because when i upload file or image and make get user information doesn’t return any file or image that i upload for this user

@hossam After uploading image to file API you need to set the uploaded fileId to ```
avatarFileId



https://api-docs.amity.co/#/UserV3/put_api_v3_users
1 Like

and this step for the file and video also ?

and when try to upload file how can put the access token for the user I put it in the header or what .
and finally if you have any social network can contact you on it , can you share it with me please?

Hello, if you are referring to uploading file and video in general, please look at these endpoints for upload:

Regarding the access token, yes, you can pass it in the header as the bearer token. Please see the sample below:

curl --location ‘https://api.sg.amity.co/api/v4/videos’
–header ‘accept: application/json’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkdTLWNDSUFib1IyQUhfQXczY29Bb0VtR1ZkdzFfaxxxxx’
–form ‘files=@“/Users/Screen Recording 2567-01-08 at 16.47.22.mov”’
–form ‘feedType=@“/path/to/file”’

Hello I have user and I will upload for this user avatar and image , file and video , so I need to make this and when i try to get user information I need to get this files also but when i make get users the files doesn’t contains anything