notes about what the client should expect from the api for now
This commit is contained in:
parent
6918475be5
commit
6e9c485d69
58
docs/api.md
Normal file
58
docs/api.md
Normal file
@ -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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user