aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md54
1 files changed, 49 insertions, 5 deletions
diff --git a/README.md b/README.md
index 58f9989..f4e1002 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,13 @@ DELETE `/delete_user`
- Return type: JSON
- Returns: `Result`
+POST `set_user_data`
+ Sets data in the user fields
+- Data type: JSON
+- Data: `{user: UID, field: ReceiveDataField, data: String}`
+- Return type: JSON
+- Returns: `Result`
+
GET `/get_user/<id>`
Gets a user from id
- Return type: JSON
@@ -60,10 +67,7 @@ GET `/get_message_list/<from_id>/<to_id>`
POST `/send_message`
Sends a message
- Data type: JSON
-- Data:
- - `"sender": u64`
- - `"message": String`
- - `"reply_to": Option<u64>`
+- Data: ReceiveMessage
- Return type: JSON
- Returns: `UID` of message
@@ -72,4 +76,44 @@ DELETE `/delete_message`
- Data type: JSON
- Data: `UID`
- Return type: JSON
-- Returns: `Result` \ No newline at end of file
+- Returns: `Result`
+
+# Types
+- ReceiveDataField
+ - DisplayName
+ - StatusText
+ - Desc
+
+- ReceiveMessage
+ - message: String
+ - sender: UID
+ - reply_to: Option<UID>
+
+- UID
+ - u64
+
+- Date
+ - u64 (date since epoch in UTC)
+
+- Status
+ - Online
+ - Offline
+ - Away
+ - Busy
+
+- User
+ - id: UID
+ - username: String (Max 20 chars)
+ - displayname: String (Max 30 chars)
+ - desc: String (Max 500 chars)
+ - statustext: String (Max 60 chars)
+ - status: Status
+ - deleted: bool
+
+- Message
+ - id: UID
+ - message: String (Max 6000 chars)
+ - reply_to: UID (of another message)
+ - deleted: bool
+ - date: Date
+ - sender: UID (of a User) \ No newline at end of file