Chat

The chat object contains the following attributes:

Field Name
Data Type
Description

id

string

A unique identifier for the chat.

Example: CHT-1111-2222-3333

revision

uint

The revision number of the chat.

icon

string

Icon for the group and channel.

name

string

The chat name. Required for Channelchats, optional for Group chats.

For Case chats, the name is automatically generated from a truncated version of the first message in the support conversation. This field is invalid for Direct chats. Example: “SoftwareOne news!”

description

string

The chat description. Required for channel chats and optional for group chats. This field is invalid for any other chat type.

type

string

The type of chat. Allowed values are direct, group, case, or channel.

participants

object

The chat participant. This field can be used to set the participants when creating a chat.

Example:

lastMessage

object

The latest message in the chat sent by any participant. This field can be used to create an opening message when creating a chat.

Example:

links

object

The link for this chat.

attachments

object

The attachment for this chat

audit

object

A reference to the audit object.

Participant object

This object contains the following attributes:

Field Name
Data Type
Description

id

string

The ID of the participant.

Example: CPT-1111-2222-3333

chat

chat

Chat parent object.

Example:

status

string

Can only be set to exited in in chats not of direct type. Deactivated is a special state for exited participants where the user is no longer active on the platform, to ensure their participant state is never transitioned back to active.

Example: Active

contact

object

The contact entity from the notifications API forms the primary mechanism for identifying chat participants.

identity

identity

Platform identity model. The property exists on the participant object only as a convenience and is calculated from the identity property of the referenced contact object.

Example:

account

object

Platform account model. It is only provided during participant creation when a provided contact has multiple account contexts. In most circumstances, it is derived automatically from contact.

Example:

lastReadMessage

If set, this field represents the last message seen by this user. It can be the same as latest message if user is up to date with chat.

Example:

unread

integer

Calculated field. It represents the count of messages appended to the chat since the lastReadMessage. When a participant performs an action that changes any chat state, this will be reset to zero for that participant. It can also be reset by a put operation that changes the lastReadMessage reference.

Example: 27

audit

object

A reference to the audit object.

muted

boolean

Flag indicating whether participant should be notified of new messages in the chat. Example: true

Message object

This object contains the following attributes:

Field Name
Data Type
Description

id

string

The ID of the chat message. The first three sections are derived from the chat ID. The last section (length 5) supports up to 100,000 messages. For additional performance, this field could be separated from the clustered index in the database.

Example: CMG-1111-2222-3333-99999

chat

object

A reference to the chat object.

Example:

sender

object

The participant that sent this message.

Example:

content

string

The body of the message. Can contain any Markdown supported by the UI, as well as special markup for links to platform objects.

Example: Please find attached <form id=”FRm-1234-5678 display=”Order details”/>

visibility

string

Allowed values: public or private. Private means that its visible only to users within the same account. In the context of a Channel, these statuses can be interpreted as draft (private) and published (public).

isDeleted

bool

Soft delete state. The message is hidden going forward but may have already been seen by users. Deleting a message does not delete associated attachments or links. Soft-deleted messages are still returned by the API but contain no content.

links

Gets the links for this message.

Example:

audit

object

A reference to the audit object.

For system messages, created.by is null whereas created.at contains a value.

This object contains the following attributes:

Field
Type
Description

id

string

The ID of the link.

Example: LNK-1111-2222-3333

chat

object

The linked chat object.

Example:

message

object

The message object that this link object links to.

url

string

The URL provided by the user.

objectId

string

When ObjectId is provided, the FE attempts to extract the corresponding PlatformEntity and create a proper link. To do this, it calls the Audit API to locate the entity:

https://portal.s1.today/public/v1/audit/records?eq(object.id,PRD-2245-6484) (ordered by latest record and limited to 1 result).

If found, the returned object should include { id, name, icon }, where applicable.

icon

string

Calculated by the FE when adding a link.

name

string

Calculated by the FE when not provided by the user.

isDeleted

boolean

Soft delete property.

audit

object

A reference to the audit object.

Attachment object

This object contains the following attributes:

id

string

The ID of the attachment object. Example: ATC-1111-2222-3333

chat

object

The ID of the chat object.

Example:

message

object

The message object that this attachment links to.

isDeleted

bool

Soft delete state. It does not prevent users from having seen the message in the past; it only affects visibility going forward.

fileId

string

The ID of file metadata.

Example: FIL-1111-2222-3333

filename

string

The name of the file. Not Read-only because it doesn’t affect the stored file, only the content-disposition if the file is downloaded.

Example: prod-passwords-lol.txt

contentType

string

Attachment MIME type. Read-only; set automatically when the attachment is uploaded.

Example: application/vnd.ms-excel

size

integer

Size of attachment in bytes. Read-only; set automatically when the attachment is uploaded.

Example: 123,456

audit

object

A reference to the audit object. The Created audit property is used to find the message sender and timestamp. For system messages, null is used.

Last updated

Was this helpful?