Scope: chats.messages
/api/v2/chats/:chat_id/messages
Gibt alle Nachrichten für einen Chat zurück.
Antwort:
[
{
"id": 541,
"chat_id": 1,
"user": {
"id": 47,
"name": "Geschichts-Ass"
},
"text": "toll",
"has_files": false,
"meta_type": null,
"sent_at": "2020-05-17 18:32:43",
"is_own": false,
"reactions": []
},
...truncated
]
/api/v2/chats/:chat_id/messages
Sendet eine Text-Nachricht als Benutzer.
Attribute | Art | Werte | Standard | Beschreibung |
---|---|---|---|---|
text |
string |
Textinhalt der Nachricht |
Anfrage für Text-Nachricht:
{
"text": "Eine tolle Nachricht!"
}
Anfrage für Dateien:
Dateien müssen davor mit der Relation chat-message-file-new
hochgeladen werden.
{
"text": "Hier kommen meine Dateien",
"with_files": true
}
Anfrage für Umfragen:
Attribute | Art | Werte | Standard | Beschreibung |
---|---|---|---|---|
is_anonymous |
boolean |
true/false |
false |
Gibt an, ob die Umfrage anonym sein soll. Somit wird nicht mehr angezeigt wer abgestimmt hat. |
is_multiple_choice |
boolean |
true/false |
false |
Gibt an, ob mehrere Optionen ausgewählt werden dürfen, anstelle nur einer. |
{
"text": "Frage der Umfrage",
"poll": {
"is_anonymous": true,
"is_multiple_choice": false,
"options": [
"Option 1",
"Option 2",
"Option 3"
]
}
}
Antwort:
{
"id": 542,
"chat_id": 1,
"user": {
"id": 1,
"name": "Flo"
},
"text": "Eine tolle Nachricht!",
"is_hidden": false,
"has_files": false,
"has_poll": false,
"meta_type": null,
"sent_at": "2020-05-17T18:35:35+02:00",
"is_own": true,
"reactions": []
}
/api/v2/chats/:chat_id/messages/:message_id
Löscht eine Nachricht aus einem Chat