projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
[akkoma]
/
docs
/
API
/
chats.md
diff --git
a/docs/API/chats.md
b/docs/API/chats.md
index 8d925989c459df793919688474cd13aa5bba619a..2e415e4dac1284deb0e9daea7d0df51470d60c0b 100644
(file)
--- a/
docs/API/chats.md
+++ b/
docs/API/chats.md
@@
-43,12
+43,17
@@
you can call:
`POST /api/v1/pleroma/chats/by-account-id/{account_id}`
`POST /api/v1/pleroma/chats/by-account-id/{account_id}`
-The account id is the normal FlakeId of the usre
-
+The account id is the normal FlakeId of the user
```
POST /api/v1/pleroma/chats/by-account-id/someflakeid
```
```
POST /api/v1/pleroma/chats/by-account-id/someflakeid
```
+If you already have the id of a chat, you can also use
+
+```
+GET /api/v1/pleroma/chats/:id
+```
+
There will only ever be ONE Chat for you and a given recipient, so this call
will return the same Chat if you already have one with that user.
There will only ever be ONE Chat for you and a given recipient, so this call
will return the same Chat if you already have one with that user.
@@
-62,7
+67,9
@@
Returned data:
...
},
"id" : "1",
...
},
"id" : "1",
- "unread" : 2
+ "unread" : 2,
+ "last_message" : {...}, // The last message in that chat
+ "updated_at": "2020-04-21T15:11:46.000Z"
}
```
}
```
@@
-82,7
+89,8
@@
Returned data:
...
},
"id" : "1",
...
},
"id" : "1",
- "unread" : 0
+ "unread" : 0,
+ "updated_at": "2020-04-21T15:11:46.000Z"
}
```
}
```
@@
-105,7
+113,9
@@
Returned data:
...
},
"id" : "1",
...
},
"id" : "1",
- "unread" : 2
+ "unread" : 2,
+ "last_message" : {...}, // The last message in that chat
+ "updated_at": "2020-04-21T15:11:46.000Z"
}
]
```
}
]
```
@@
-159,10
+169,10
@@
Posting a chat message for given Chat id works like this:
`POST /api/v1/pleroma/chats/{id}/messages`
Parameters:
`POST /api/v1/pleroma/chats/{id}/messages`
Parameters:
-- content: The text content of the message
+- content: The text content of the message. Optional if media is attached.
+- media_id: The id of an upload that will be attached to the message.
-Currently, no formatting beyond basic escaping and emoji is implemented, as well as no
-attachments. This will most probably change.
+Currently, no formatting beyond basic escaping and emoji is implemented.
Returned data:
Returned data:
@@
-184,6
+194,14
@@
Returned data:
}
```
}
```
+### Deleting a chat message
+
+Deleting a chat message for given Chat id works like this:
+
+`DELETE /api/v1/pleroma/chats/{chat_id}/messages/{message_id}`
+
+Returned data is the deleted message.
+
### Notifications
There's a new `pleroma:chat_mention` notification, which has this form:
### Notifications
There's a new `pleroma:chat_mention` notification, which has this form: