Scope: chats
/api/v2/chats
Gibt alle Chats zurück in welchen der Nutzer Mitglied ist.
Antwort:
[
{
"id": 1,
"name": "Neuer Chat",
"created_at": "2020-05-09 15:36:07",
"last_message_at": "2020-05-17 18:27:57",
"broadcast_only": false,
"files_allowed": true,
"url": "http://localhost:8080/chats/1",
"is_admin": true,
"can_write": true,
"unread_messages": 2
},
{
"id": 2,
"name": "Mitteilungen",
"created_at": "2020-05-09 15:36:20",
"last_message_at": "2020-05-17 17:37:34",
"broadcast_only": true,
"files_allowed": true,
"url": "http://localhost:8080/chats/2",
"is_admin": true,
"can_write": true,
"unread_messages": 0
}
]
/api/v2/chats/:chat_id
Gibt Informationen von einem Chat zurück.
Antwort:
{
"id": 1,
"name": "Neuer Chat",
"created_at": "2020-05-09 15:36:07",
"last_message_at": "2020-05-17 18:27:57",
"broadcast_only": false,
"files_allowed": true,
"url": "http://localhost:8080/chats/1",
"is_admin": true,
"can_write": true,
"unread_messages": 0
}
/api/v2/chats
Erstellt einen Chat. Der angemeldete Benutzer wird automatisch Administrator.
Anfrage:
{
"name": "Neuer Chat",
"broadcast_only": false,
"files_allowed": false
}
Antwort:
{
"id": 2,
"name": "Neuer Chat",
"created_at": "2020-05-09 15:36:07",
"last_message_at": "2020-05-17 18:27:57",
"broadcast_only": false,
"file_allowed": false,
"url": "http://localhost:8080/chats/1",
"is_admin": true,
"can_write": true,
"unread_messages": 1
}