From 6e9c485d692870eb99611ee16c5c14970a295341 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Fri, 17 Apr 2020 17:13:42 -0700 Subject: [PATCH] notes about what the client should expect from the api for now --- docs/api.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/api.md diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..925355d --- /dev/null +++ b/docs/api.md @@ -0,0 +1,58 @@ +# Server Requests + +``` +/auth/login +``` + +Parameters: + username + set via a config the first time the app is started up + server-generated-access-key + this is given to us the first time we join the server +Return: + Session key + +``` +/channels/list/voice +/channels/list/text +``` + +Return: + List of channels owned by the server + +``` +for channel in text_channels + GET /channnels/history/{channel} +``` + +Behavior: + By default the client requests the most recent 100 messages + But it shows the most recently cached messages from the last session + +``` +for channel in voice_channels + GET /channels/vc_members/{channel} +``` + +Behavior: + By default we request the people in the voce chat on login but only + cache updates during sessions, not between sessions + +# Response Objects + +Channel { + name: string + description: string + type: integer [1=Voice Channel, 2=Text Channel] +} + +User { + userid: u64 + username: string +} + +Message { + content: string + author: User + date: Unix timestamp(u64) +}