dambel

دمبل

shevron
ورود | ثبت نام

API Docs / chats / chat resource



Chat Resource

Represents a chat, including its users, last message, unread count, and creation time.


Schema

FieldTypeDescriptionExample
idintUnique identifier for the chat123
usersarrayList of user objects in the chat[ { ... }, ... ]
last_messageobjectLast message resource (nullable){ ... }
unread_countintNumber of unread messages0
created_atstringCreation timestamp (ISO 8601 format)"2020-01-01 00:00:00"

Each user object includes all fields from the user resource, plus:

  • is_owner: boolean
  • last_read_at: string (ISO 8601)

Example

{
  "id": 123,
  "users": [
    {
      /* user resource fields */
      "is_owner": false,
      "last_read_at": "2020-01-01 00:00:00"
    }
  ],
  "last_message": { /* chat message resource */ },
  "unread_count": 0,
  "created_at": "2020-01-01 00:00:00"
}

For message schema, see Chat Message Resource.

footer wave
logo

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutube