User object

User is an object that refers to a single user in a chat.

Properties

The UserImpl class implements the User protocol and takes following properties:

extension UserImpl: User {
public var chat: ChatImpl
public var id: String
public var name: String?
public var externalId: String?
public var profileUrl: String?
public var email: String?
public var custom: [String: JSONCodableScalar]?
public var status: String?
public var type: String?
public var updated: String?
public var lastActiveTimestamp: TimeInterval?
}
ParameterTypeDescription
chatChatImplReference to the main Chat protocol.
idStringUnique ID of the user.
nameStringDisplay name or username of the user (must not be empty or consist only of whitespace characters).
externalIdStringIdentifier for the user from an external system, such as a third-party authentication provider or a user directory.
profileUrlStringURL to the user's profile or avatar image.
emailStringUser's email address.
custom[String: JSONCodableScalar]Any custom properties or metadata associated with the user in the form of a JSON. App Context filtering language doesn’t support filtering by custom properties.
statusStringCurrent status of the user, like online, offline, or away.
typeStringType of the user, like admin, member, guest.
updatedStringTimestamp (a number of seconds since January 1, 1970) for the last time the user information was updated or modified.
lastActiveTimestampTimeIntervalTimestamp for the last time the user was active in a chat app.
API limits

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

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-related methods to:

Last updated on