AI Integration Quick Reference
AI Integration Quick Reference
Creating a user
Ideally, user creation should happen on your backend using the REST API. For on-the-fly creation during development, use thecreateUser() method with a User object and your API Key.
- Java
- Kotlin
Updating a user
UseupdateUser() with a User object and API Key. Ideally done on your backend via the REST API.
- Java
- Kotlin
User object provided to the updateUser() method has the UID of the user to be updated.
Updating logged-in user
UseupdateCurrentUserDetails() to update the currently logged-in user’s profile. No API Key required.
- Java
- Kotlin
updateCurrentUserDetails() method, you can only update the logged-in user regardless of the UID passed. Also, it is not possible to update the role of a logged-in user.
Deleting a user
Deleting a user can only be achieved via the RESTful APIs. For more information, see the delete a user section.User Class
User Payload Structure
User Object
User Object
The
User object returned by SDK methods contains the following fields:Sample User Object:
Next Steps
Authentication
Log users into CometChat after creating their accounts
Retrieve Users
Fetch user lists and search for specific users
User Presence
Track user online/offline status in real-time
Block Users
Implement user blocking and unblocking features