Ether is responsible for CRUD operations on conversation metadata, conversation content, and conversation members. It uses MariaDB to store the conversation metadata and members, and stores the conversation content as an HTML file in the file system.
ETHER_DB_USERNAME
: username for accessing MariaDBETHER_DB_PASSWORD
: password for accessing MariaDBETHER_DB_LOCATION
: host and port where MariaDB is located (ex: "localhost:3306")ETHER_DB_DATABASE
: name of the database to use in MariaDBETHER_DB_CONTENT_DIR
: directory where conversation content HTML files are stored
The following APIs are protected by heimdall
, so requests must have the
Authorization
header set to the value Bearer <token>
, where <token>
is the
token generated by heimdall
. heimdall
will then forward the request with an
added User-ID
header with the user ID value from the token. This user is
treated as the "session user" for all requests.
Creates a new conversation with just the session user as an owner member.
{
"name": "Friends",
"description": "Casual banter",
"avatar_url": "example.com/image.png"
}
201 Created
{
"id": 1
"name": "Friends",
"description": "Casual banter",
"avatar_url": "example.com/image.png"
}
Retrieves a conversation's metadata.
200 OK
{
"id": 1
"name": "Friends",
"description": "Casual banter",
"avatar_url": "example.com/image.png"
}
Notable error codes: 404 Not Found
Updates a conversation's metadata.
{
"name": "Acquintances...",
"description": "Casual banter",
"avatar_url": "example.com/image.png"
}
200 OK
{
"id": 1
"name": "Acquintances...",
"description": "Casual banter",
"avatar_url": "example.com/image.png"
}
Notable error codes: 403 Forbidden
, 404 Not Found
Deletes a conversation.
204 No Content
Notable error codes: 403 Forbidden
, 404 Not Found
Retrieve's a conversation's content.
200 OK
<div>hello world!</div>
<div>sup</div>
Notable error codes: 403 Forbidden
, 404 Not Found
Adds a member to a conversation.
{
"user_id": 2,
"conversation_id": 1,
"role": "user"
}
201 Created
{
"user_id": 2,
"conversation_id": 1,
"role": "user",
"nickname": "",
"pending": true,
"last_opened": "2020-02-19 18:32:00"
}
Notable error codes: 403 Forbidden
, 404 Not Found
, 409 Conflict
Retrieves a conversation member.
200 OK
{
"user_id": 2,
"conversation_id": 1,
"role": "user",
"nickname": "",
"pending": true,
"last_opened": "2020-02-19 18:32:00"
}
Notable error codes: 404 Not Found
Retrieves all of a conversation's member.
200 OK
{
"users": [
{
"user_id": 1,
"conversation_id": 1,
"role": "owner",
"nickname": "",
"pending": false,
"last_opened": "2020-02-19 18:39:00"
},
{
"user_id": 1,
"conversation_id": 2,
"role": "user",
"nickname": "",
"pending": true,
"last_opened": "2020-02-19 18:32:00"
}
]
}
Notable error codes: 404 Not Found
Updates a member in a conversation.
{
"user_id": 3,
"conversation_id": 1,
"role": "admin",
"nickname": "An alright guy"
}
200 OK
{
"user_id": 3,
"conversation_id": 1,
"role": "admin",
"nickname": "An alright guy",
"pending": false,
"last_opened": "2020-02-19 18:44:00"
}
Notable error codes: 403 Forbidden
, 404 Not Found
Deletes a member from a conversation.
204 No Content
Notable error codes: 403 Forbidden
, 404 Not Found