API Endpoints - Grouloo/dawnpen GitHub Wiki

POST /api/topic

Creates a topic

Body

"text": [string],
"textarea": [string]

DELETE /api/topic/[id]

Deletes a topic (moderators only)

GET /api/topics

Returns a list of all the topics

GET /api/topic/[id]

Returns the data of the specified topic

POST /api/message

Posts a message

Body

"text": [string],
"textarea": [string],
"media": [base64],
"topic": [string],
"parent": [string]

GET /api/messages/[topic]

Returns 10 messages from a specified topic

GET /api/message/[topic]/[id]

Returns a message and its replies

POST /api/ticket

Posts a ticket

Body

"email": [string],
"type": [string],
"content": [string]

DELETE /api/ticket/[id]

Deletes a ticket

GET /api/tickets

Returns all tickets

POST /api/instance

Edits instance (moderators only)

POST /api/moderator

Creates a moderator (moderators only)

Body

"text" : [string],
"email": [string],
"password": [string]

GET /api/moderators

Returns list of all moderators (moderators only)

GET /api/logged-moderator

Returns a 200 HTTP status if the user is logged as a moderator

POST /api/login-moderator

Log in as a moderator

Body

email: [string],
password: [string]