-
GET /v0/post?id=<uuid>Returns:200Response body:{ "_id": "<uuid>", "user": "<uuid>", "created_at": "<iso_6801_utc_datetime>" "reply": { "parent": "<uuid>", "on_feed": bool, } // This is skipped if the post is not a reply "mature": bool, "liked_by": ["<uuid>"], "flagged_by": ["<uuid>"], "skrunkle": { "palette": ["str"]; // Exactly 8 elements "bg_color": "str", "strokes": [ { "color": number, "shape": [ [num, num, num] // Exactly 3 elements ] } ] } }400When the uuid in the query is malformed401Response body:{ "type": { "authentication": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L25 "message": "<human_readable_message>" }500Response body:{ "type": { "database": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L42 "message": "<human_readable_message>" }
-
GET /v0/post/all- Everything is the same as
GET /v0/postbut you get a list instead. The list is ordered from newest to oldest, and limited to 100 elements. You don't get replies on this list unless the author of the reply specifically wanted the reply to also be published to the feed.
- Everything is the same as
-
GET /v0/post/replies?id=<uuid>- Similar to
/v0/post/all, but instead you only get posts which reply to the post provided on the query. The skrunkles in each post will contain the strokes of the original post and the strokes added by the reply.
- Similar to
-
POST /v0/postHTTP HeadersContent-Type: application/jsonAuthorization: Bearer <jwt>Body:
{ "reply": { "parent": "<uuid>", "on_feed": bool, } // Can be skipped if the post shouldn't be a reply "mature": bool, "skrunkle": { "palette": ["str"]; // Exactly 8 elements "bg_color": "str", "strokes": [ { "color": number, "shape": [ [num, num, num] // Exactly 3 elements ] q} ] } }Returns:
200(no body)400When the json sent is malformed401Response body:{ "type": { "authentication": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L25 "message": "<human_readable_message>" }500Response body:{ "type": { "database": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L42 "message": "<human_readable_message>" }
-
DELETE /v0/post?id=<uuid>HTTP HeadersAuthorization: Bearer <jwt>Returns:200: The body is simply the number of updated documents. Should be equal to 1,400When the uuid in the query is malformed401Response body:{ "type": { "authentication": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L25 "message": "<human_readable_message>" }500Response body:{ "type": { "database": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L42 "message": "<human_readable_message>" }
-
GET /user?id=<uuid>Returns:200Response body:{ "_id": "<uuid>", "created_at": "<iso_6801_utc_datetime>", "name": "<string>", "link": "<string>", // This could be like a personal website or a portfolio "profile_picture": "<uuid>", // The profile picture can reference one of the user's posts }400When the uuid in the query is malformed500Response body:
{ "type": { "database": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L42 "message": "<human_readable_message>" } -
PUT /userHTTP HeadersContent-Type: application/jsonAuthorization: Bearer <jwt>Body:
{ "name": "<string>", // All fields are required on create. Fields skipped when updating will stay unchanged. "link": "<string>", // Creates the user if it doesn't exist. Updates it otherwise. "profile_picture": "<uuid>" }Returns:
200(no body)400When the json sent is malformed401Response body:{ "type": { "authentication": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L25 "message": "<human_readable_message>" }500Response body:{ "type": { "database": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L42 "message": "<human_readable_message>" }
-
DELETE /v0/user?id=<uuid>HTTP HeadersAuthorization: Bearer <jwt>Returns:200: The body is simply the number of updated documents. Should be equal to 1,400When the uuid in the query is malformed401Response body:{ "type": { "authentication": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L25 "message": "<human_readable_message>" }500Response body:{ "type": { "database": "<type>" } // type is one of https://github.com/HackHajs/skrunkly_draw_backend/blob/trunk/src/error.rs#L42 "message": "<human_readable_message>" }