From 58300710ed6bc9f0734fa3fbdaac6c38dfb8a790 Mon Sep 17 00:00:00 2001 From: curly Date: Wed, 8 Feb 2023 18:54:16 -0700 Subject: POST and more --- README.md | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e2e6948..033b570 100644 --- a/README.md +++ b/README.md @@ -2,56 +2,60 @@ The api is available on `/api`. GET `/` -Gets information about the server + Gets information about the server - Return type: JSON - Returns: GET `/ping` -Pings the server + Pings the server - Return type: JSON - Returns: pong -GET `/create_user/` -Creates a new user with name +POST `/create_user/` + Creates a new user with name +- Data type: JSON +- Data: `String` of wanted username - Return type: JSON -- Returns: +- Returns: `UID` of user GET `/get_user/` -Gets a user from id + Gets a user from id - Return type: JSON - Returns: GET `/get_user_by_name/` -Gets a user from name + Gets a user from name - Return type: JSON - Returns: GET `/get_message/` -Gets a message by id + Gets a message by id - Return type: JSON - Returns: GET `/get_message_id_newest` -Gets the newest message id + Gets the newest message id - Return type: JSON - Returns: GET `/get_message_id_list//` -Gets a list of messages from_id to to_id inclusive + Gets a list of messages from_id to to_id inclusive - Return type: JSON - Returns: > -GET `/send_message//` -Sends a message +POST `/send_message` + Sends a message +- Data type: JSON +- Data: + - `"sender": u64` + - `"message": String` + - `"reply_to": Option` - Return type: JSON -- Returns: - -GET `/send_reply///` -Sends a reply to a message -- Return type: JSON -- Returns: +- Returns: `UID` of message -GET `/delete_message/` -Deletes a message +DELETE `/delete_message` + Deletes a message +- Data type: JSON +- Data: `u64` - Return type: JSON -- Returns: Deleted \ No newline at end of file +- Returns: `Result` \ No newline at end of file -- cgit v1.2.3