docs.jonasjones.dev/docs/API/v1-routes/basic.mdx
J-onasJones 4c0fe127b5 API revision 1
- added missing methods to projects
- fixed other pages typos/missing features/etc.
- added return types table
2024-08-31 18:25:57 +02:00

167 lines
No EOL
3.7 KiB
Text

---
sidebar_position: 1
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Basic
The basic routes of the API
## GET /v1/help
Get a help message.
:::tip[**Example** Response]
<Tabs>
<TabItem value="200" label="200">
```json
Please refer to the wiki at https://wiki.jonasjones.dev/Api/
```
</TabItem>
<TabItem value="500" label="500">
```json
{
"status": 500,
"statusText": "Internal Server Error"
}
```
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------- |
| status | Number | The status code of the error |
| statusText | String | The status text of the error |
</TabItem>
<TabItem value="503" label="503">
```json
API is down
{
"status": 503,
"statusText": "Service Unavailable"
}
```
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------- |
| status | Number | The status code of the error |
| statusText | String | The status text of the error |
</TabItem>
</Tabs>
:::
## GET /v1/ping
Get a ping back from the API
:::tip[**Example** Response]
<Tabs>
<TabItem value="200" label="200">
```json
pong
```
</TabItem>
<TabItem value="500" label="500">
```json
{
"status": 500,
"statusText": "Internal Server Error"
}
```
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------- |
| status | Number | The status code of the error |
| statusText | String | The status text of the error |
</TabItem>
<TabItem value="503" label="503">
```json
API is down
{
"status": 503,
"statusText": "Service Unavailable"
}
```
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------- |
| status | Number | The status code of the error |
| statusText | String | The status text of the error |
</TabItem>
</Tabs>
:::
## GET /v1/version
Get the version of the Rust api back-end
:::tip[**Example** Response]
<Tabs>
<TabItem value="200" label="200">
```json
["0.0.1+alpha-build01"]
```
</TabItem>
<TabItem value="500" label="500">
```json
{
"status": 500,
"statusText": "Internal Server Error"
}
```
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------- |
| status | Number | The status code of the error |
| statusText | String | The status text of the error |
</TabItem>
<TabItem value="503" label="503">
```json
API is down
{
"status": 503,
"statusText": "Service Unavailable"
}
```
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------- |
| status | Number | The status code of the error |
| statusText | String | The status text of the error |
</TabItem>
</Tabs>
:::
## GET /v1/debug/headers
Get the incoming headers of the request
:::tip[**Example** Response]
<Tabs>
<TabItem value="200" label="200">
```json
{
"Origin": "...",
"Referer": "...",
"User-Agent": "...",
"...": "..."
}
```
</TabItem>
<TabItem value="500" label="500">
```json
{
"status": 500,
"statusText": "Internal Server Error"
}
```
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------- |
| status | Number | The status code of the error |
| statusText | String | The status text of the error |
</TabItem>
<TabItem value="503" label="503">
```json
API is down
{
"status": 503,
"statusText": "Service Unavailable"
}
```
| Parameter | Type | Description |
| ---------- | ------ | ---------------------------- |
| status | Number | The status code of the error |
| statusText | String | The status text of the error |
</TabItem>
</Tabs>
:::