diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 46 |
1 files changed, 25 insertions, 21 deletions
@@ -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: <information> GET `/ping` -Pings the server + Pings the server - Return type: JSON - Returns: pong -GET `/create_user/<name>` -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: <user_id> +- Returns: `UID` of user GET `/get_user/<id>` -Gets a user from id + Gets a user from id - Return type: JSON - Returns: <user> GET `/get_user_by_name/<name>` -Gets a user from name + Gets a user from name - Return type: JSON - Returns: <user> GET `/get_message/<id>` -Gets a message by id + Gets a message by id - Return type: JSON - Returns: <message> GET `/get_message_id_newest` -Gets the newest message id + Gets the newest message id - Return type: JSON - Returns: <message_id> GET `/get_message_id_list/<from_id>/<to_id>` -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: <Array<message_id>> -GET `/send_message/<user_id>/<message>` -Sends a message +POST `/send_message` + Sends a message +- Data type: JSON +- Data: + - `"sender": u64` + - `"message": String` + - `"reply_to": Option<u64>` - Return type: JSON -- Returns: <message_id> - -GET `/send_reply/<user_id>/<message_id>/<message>` -Sends a reply to a message -- Return type: JSON -- Returns: <message_id> +- Returns: `UID` of message -GET `/delete_message/<message_id>` -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 |