From ebe5e6b922f756f2f64be6d2b688fe3a33e6823d Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Wed, 23 Oct 2024 15:06:21 +1100 Subject: [PATCH] Update README with new API --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 347fcc6..6074608 100644 --- a/README.md +++ b/README.md @@ -30,17 +30,57 @@ Chookpen is very simple in how it works at present. There's only one chat on eac ### Brief API documentation for the server -**Create account** +#### Create account + +**Usage** `http://(address:port)/api/createAccount/username:{(username)}token:{(password-hash)}` -**Send a message** +**Successful response** -`http://(address:port)/api/username:{(username)}token:{(password-hash)}message:{(message to send)}` +`Success` -**Get messages** +**Unsuccessful responses** -`http://(address:port)/api/username:{(username)}token:{(password-hash)}` +`Username already exists` - Choose a new username + +`No username` - Add a username + +`No token` - Add a token + +#### Send a message + +**Usage** + +`http://(address:port)/api/send/username:{(username)}token:{(password-hash)}message:{(message to send)}` + +**Successful response** + +`Success` + +**Unsuccessful responses** + +`Unknown account` - Either you don't have an account or your username is wrong + +`Invalid token` - Password is wrong + +`No data provided` - Add a message + +#### Get messages + +**Usage** + +`http://(address:port)/api/syncmessages/username:{(username)}token:{(password-hash)}` + +**Successful response** + +A successful response should contain everything in `chatHistory` in the directory you run the server in. + +**Unsuccessful responses** + +`Unknown account` - Either you don't have an account or your username is wrong + +`Invalid token` - Password is wrong ## Some handy tips and tricks @@ -48,4 +88,4 @@ Chookpen Server **does not support HTTPS!** You can put Chookpen Server behind a Chookpen Server and CLI client are both in an alpha stage, keep this in mind before doing ANYTHING with it! -Chookpen Server is not ready for production :/ \ No newline at end of file +Chookpen Server is not ready for production :/