docs: added endpoints and object models

This commit is contained in:
SauceyRed 2025-05-02 01:42:24 +02:00
parent ebab7e4fb3
commit 142cc5a448
Signed by: sauceyred
GPG key ID: 4BEDD9C389F924D0
7 changed files with 184 additions and 0 deletions

View file

@ -0,0 +1,28 @@
#### <b><span style="color: lightgreen;">GET</span> <code>/v1/servers/{serverId}/channels/{channelId}/messages</code></b>
Retrieves all [[Message|messages]] in a [[Guild]].
##### Responses
| Status | Description |
| ------ | --------------------------------------------------------- |
| 200 | The request succeeded and the message object is returned. |
| 400 | The post request included poorly formated data. |
| 401 | User is not authenticated. |
| 403 | User does not have permission to view the message. |
| 500 | An unhandled error occurred. |
###### 200
Returns a [[Message]] object.
#### <b><span style="color: lightgreen;">GET</span> <code>/v1/servers/{serverId}/channels/{channelId}/messages/{messageId}</code></b>
Retrieves a [[Message]] from a channel.
##### Responses
| Status | Description |
| ------ | --------------------------------------------------------- |
| 200 | The request succeeded and the message object is returned. |
| 400 | The post request included poorly formated data. |
| 401 | User is not authenticated. |
| 403 | User does not have permission to view the message. |
| 500 | An unhandled error occurred. |
###### 200
Returns a [[Message]] object.

9
API/models/Channel.md Normal file
View file

@ -0,0 +1,9 @@
## Channel Object
Represents a channel in a [[Guild#Guild Object|Guild]].
**Structure**
| Field | Type | Description |
| ----- | ------ | ------------------- |
| id | string | ID of the channel |
| name | string | Name of the channel |

9
API/models/Emoji.md Normal file
View file

@ -0,0 +1,9 @@
## Emoji Object
Represents an emoji in a [[Guild]].
**Structure**
| Field | Type | Description |
| ----- | ------ | ----------------- |
| id | string | ID of the emoji |
| name | string | Name of the emoji |

25
API/models/Guild.md Normal file
View file

@ -0,0 +1,25 @@
## Guild Object
Represents a guild in an [[Instance]].
**Structure**
| Field | Type | Description |
| ------------ | ---------------------------------------------- | ------------------------------ |
| id | string | ID of the guild |
| description | string | Description of the guild |
| name | string | Name of the guild |
| icon | string | URL for the icon |
| owner_id | string | ID of the owner |
| roles | array of [[#Role Object\|Role]] objects | Roles in the guild |
| emojis | array of [[Emoji#Emoji Object\|Emoji]] objects | Emojis in the guild |
| member_count | integer | Number of members in the guild |
### Role Object
**Structure**
| Field | Type | Description |
| ----- | ------ | ----------------------- |
| id | string | ID of the role |
| name | string | Name of the role |
| icon | string | URL for the role's icon |

15
API/models/Instance.md Normal file
View file

@ -0,0 +1,15 @@
# We will probably have/need this right?
## Message Object
Represents a Gorb instance.
**Structure**
| Field | Type | Description |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| id | string | ID of the instance |
| name | string | Name of the instance |
| accounts | integer | Number of accounts registered on the instance |
| uptime | integer | Seconds since the instance was last started |
| version | string | The version of Gorb that the instance is running |
| build_number | string | The build number of Gorb that the instance is running |
| guilds | array of [[Guild#Guild Object\|Guild]] objects | Guilds in the instance |

88
API/models/Message.md Normal file
View file

@ -0,0 +1,88 @@
## Message Object
Represents a message in a [[Channel]]/DM.
**Structure**
| Field | Type | Description |
| ----------- | --------------------------------------------------- | ----------------------------------------------- |
| id | string | ID of the message |
| channel_id | string | ID of the channel the message was sent it |
| author | [[User]] object | Author of the message |
| content | string | Content of the message |
| created_at | timestamp | When the message was sent |
| edited | timestamp \| null | When this message was edited, null if it hasn't |
| attachments | array of [[#Attachment Object\|Attachment]] objects | Files attached with the message, empty if none |
| embeds | array of [[#Embed Object\|Embed]] objects | Embeds sent with the message, empty if none |
**Example Message**
```json
{
"id": "aa077418-c9e3-4703-bdd7-8187f230192c",
"channel_id": "b61aebb9-0463-47cb-b007-c0940ada962b",
"author": {
"uuid": "26c8037c-2c35-4c0f-9504-35df82a1effc",
"username": "sauceyred",
"display_name": "💜The Sauce🔥",
"created_at": "1746115074928"
},
"content": "heyo what's going on",
"created_at": "1746110781000",
"edited": null,
"attachments": [],
"embeds": []
}
```
## Embed Object
Represents an embed in a [[#Message Object|Message]].
**Structure**
| Field | Type | Description |
| ------ | ----------------------------------------- | ------------------- |
| title | string | Title of the embed |
| color | integer | Color of the embed |
| fields | array of [[#Field Object\|Field]] objects | Fields of the embed |
**Example Embed**
```json
{
"title": "SauceyRed's Profile",
"color": 6572758,
"fields": [
{ "name": "Username", value: "sauceyred" },
{ "name": "Height", value: "159" },
{ "name": "" }
]
}
```
### Field Object
Represents a field in an [[#Embed Object|Embed]].
**Structure**
| Field | Type | Description |
| ------ | ------- | ----------------------------------------------------- |
| name | string | Name of the field |
| value | string | Value of the field |
| inline | boolean | Whether field is displayed inline, default is `false` |
**Example Field**
```json
{
"name": "Username",
"value": "sauceyred"
}
```
## Attachment Object
Represents an attachment in a [[#Message Object|Message]].
**Structure**
| Field | Type | Description |
| ----- | ---- | ----------- |
| | | |
**Example Attachment**
```json
{
"": ""
}
```

10
API/models/User.md Normal file
View file

@ -0,0 +1,10 @@
Represents a user of an [[Instance]].
**Structure**
| Field | Type | Description |
| ------------ | --------- | ------------------------- |
| uuid | string | ID of the user |
| username | string | Username of the user |
| display_name | string | Display name of the user |
| created_at | timestamp | When the user was created |