Fix API documentation tables finally

This commit is contained in:
Ske 2019-07-16 00:36:28 +02:00
parent 073aff82f1
commit 27dc88db11

View File

@ -19,7 +19,9 @@ on requests that require it. Failure to do so on endpoints that require authenti
## Models ## Models
The following three models (usually represented in JSON format) represent the various objects in PluralKit's API. A `?` after the column type indicates an optional (nullable) parameter. The following three models (usually represented in JSON format) represent the various objects in PluralKit's API. A `?` after the column type indicates an optional (nullable) parameter.
### System model ### System model
|Key|Type|Patchable?|Notes| |Key|Type|Patchable?|Notes|
|---|---|---|---| |---|---|---|---|
|id|string|No|| |id|string|No||
@ -31,6 +33,7 @@ The following three models (usually represented in JSON format) represent the va
|created|datetime|No|| |created|datetime|No||
### Member model ### Member model
|Key|Type|Patchable?|Notes| |Key|Type|Patchable?|Notes|
|---|---|---|---| |---|---|---|---|
|id|string|No|| |id|string|No||
@ -42,7 +45,9 @@ The following three models (usually represented in JSON format) represent the va
|prefix|string?|Yes|| |prefix|string?|Yes||
|suffix|string?|Yes|| |suffix|string?|Yes||
|created|datetime|No|| |created|datetime|No||
### Switch model ### Switch model
|Key|Type|Notes| |Key|Type|Notes|
|---|---|---| |---|---|---|
|timestamp|datetime|| |timestamp|datetime||
@ -71,7 +76,7 @@ Returns information about your own system.
} }
``` ```
### GET /s/<id> ### GET /s/\<id>
Queries a system by its 5-character ID, and returns information about it. If the system doesn't exist, returns `404 Not Found`. Queries a system by its 5-character ID, and returns information about it. If the system doesn't exist, returns `404 Not Found`.
#### Example request #### Example request
@ -90,7 +95,7 @@ Queries a system by its 5-character ID, and returns information about it. If the
} }
``` ```
### GET /s/<id>/members ### GET /s/\<id>/members
Queries a system's member list by its 5-character ID. If the system doesn't exist, returns `404 Not Found`. Queries a system's member list by its 5-character ID. If the system doesn't exist, returns `404 Not Found`.
#### Example request #### Example request
@ -114,7 +119,7 @@ Queries a system's member list by its 5-character ID. If the system doesn't exis
] ]
``` ```
### GET /s/<id>/switches[?before=<timestamp>] ### GET /s/\<id>/switches[?before=<timestamp>]
Returns a system's switch history in newest-first chronological order, with a maximum of 100 switches. If the system doesn't exist, returns `404 Not Found`. Returns a system's switch history in newest-first chronological order, with a maximum of 100 switches. If the system doesn't exist, returns `404 Not Found`.
Optionally takes a `?before=` query parameter with an ISO-8601-formatted timestamp, and will only return switches Optionally takes a `?before=` query parameter with an ISO-8601-formatted timestamp, and will only return switches
that happen before that timestamp. that happen before that timestamp.
@ -140,7 +145,7 @@ that happen before that timestamp.
] ]
``` ```
### GET /s/<id>/fronters ### GET /s/\<id>/fronters
Returns a system's current fronter(s), with fully hydrated member objects. If the system doesn't exist, *or* the system has no registered switches, returns `404 Not Found`. Returns a system's current fronter(s), with fully hydrated member objects. If the system doesn't exist, *or* the system has no registered switches, returns `404 Not Found`.
#### Example request #### Example request
@ -215,7 +220,7 @@ Registers a new switch to your own system given a list of member IDs.
#### Example response #### Example response
(`204 No Content`) (`204 No Content`)
### GET /m/<id> ### GET /m/\<id>
Queries a member's information by its 5-character member ID. If the member does not exist, will return `404 Not Found`. Queries a member's information by its 5-character member ID. If the member does not exist, will return `404 Not Found`.
#### Example request #### Example request
@ -237,7 +242,7 @@ Queries a member's information by its 5-character member ID. If the member does
} }
``` ```
### PATCH /m/<id> ### PATCH /m/\<id>
**Requires authentication.** **Requires authentication.**
Edits a member's information. Missing fields will be set to `null`. Will return the new member object. Member must (obviously) belong to your own system. Edits a member's information. Missing fields will be set to `null`. Will return the new member object. Member must (obviously) belong to your own system.