User object

User refers to a single user in a chat.

Properties

The User class has the following properties:

public class User : UniqueChatEntity {
public string Id { get; protected set; }
public string UserName { get; }
public string ExternalId { get; }
public string ProfileUrl { get; }
public string Email { get; }
public string CustomData { get; }
public string Status { get; }
public string DataType { get; }
}
ParameterTypeDescription
IdstringUnique identifier for the user.
UserNamestringDisplay name or username of the user.
ExternalIdstringIdentifier for the user from an external system, such as a database or CRM.
ProfileUrlstringURL to the user's profile or avatar image.
EmailstringUser's email address.
CustomDatastringAny custom data that you want to store for the user.
StatusstringCurrent status of the user (e.g., online, offline, away).
DataTypestringType of user's data.
API limits

To learn about the maximum length of parameters used to set user metadata, refer to REST API docs.

Events

The User object has the following event:

// Event triggered when the user is updated
public event Action<User> OnUserUpdated;

Example

An event that is triggered when the user is updated by the server.

user.OnUserUpdated += (user) =>
{
Console.WriteLine("User metadata updated!");
};

Methods

You can call the following methods on the User object. Click on each method for more details.

Use case

For example, you can use the User object methods to:

Last updated on