Skip to content

Commit e69de08

Browse files
Clean up action parameter formatting in README
1 parent 97a74f9 commit e69de08

File tree

1 file changed

+44
-20
lines changed

1 file changed

+44
-20
lines changed

README.md

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,28 @@
22
This project aims to safely expose information from the [SpigotMC](https://spigotmc.org) website in a machine-readable format for use in projects and other systems.
33

44
### Current Capabilities
5-
| Action | Description |
6-
|------------------------|-----------------------------------------------------------------------------------------------------|
7-
| listResources | get information about all resources in the system, optionally specifying a category ID and/or a page|
8-
| getResource | get information about a resource by its ID |
9-
| getResourcesByAuthor | get information about all resources created by a specific author by the user id |
10-
| listResourceCategories | get information about available resource categories; useful for `listResources` later on |
11-
| getResourceUpdate | get information about a specific resource update by its id |
12-
| getResourceUpdates | get information about all of the updates for a specific resource by the resource id |
13-
| getAuthor | get information about an author by the user id |
14-
| findAuthor | get information about an author by the username (**exact match only**) |
5+
| Action | Description |
6+
|------------------------|------------------------------------------------------------------------------------------------------- |
7+
| listResources | get information about all resources in the system |
8+
| getResource | get information about a resource by its ID |
9+
| getResourcesByAuthor | get information about all resources created by a specific author by the user id |
10+
| listResourceCategories | get information about available resource categories |
11+
| getResourceUpdate | get information about a specific resource update by its id |
12+
| getResourceUpdates | get information about all of the updates for a specific resource by the resource id |
13+
| getAuthor | get information about an author by the user id |
14+
| findAuthor | get information about an author by the username (**exact username match only**) |
1515

1616
### How To Use
17-
All requests must currently be sent via **GET** to https://api.spigotmc.org/simple/0.2/index.php. To get started, attach a **GET** parameter `action` specifying which operation you'd like to perform (seen above). Then, attach the action's **GET** parameter(s) (seen above, currently only `id`).
17+
All requests must currently be sent via **GET** to https://api.spigotmc.org/simple/0.2/index.php. To get started, attach a **GET** parameter `action` specifying which operation you'd like to perform (seen above). Then, attach the action's **GET** parameter(s). See below for information on the parameters that each action accepts.
1818

19-
### Example
20-
Here are examples of current capabilities:
19+
### Documentation
2120

2221
#### listResources
23-
##### Parameters: `cat`, optional, ID from `listResourceCategories`; `page`, optional, defaults to `1`
22+
##### Parameters:
23+
| name | type | required | default | description |
24+
|------ |------ |---------- |--------- |----------------------------------------------------------------------------- |
25+
| cat | int | no | none | The resource category to restrict results to (see `listResourceCategories`) |
26+
| page | int | no | 1 | The page number to retrieve. Items are paginated at 10 results per page. |
2427
##### Request: https://api.spigotmc.org/simple/0.2/index.php?action=listResources&cat=4&page=2
2528
##### Response (truncated):
2629
```json
@@ -83,7 +86,10 @@ Here are examples of current capabilities:
8386
```
8487

8588
#### getResource
86-
##### Parameters: `id`, required, the resource id
89+
##### Parameters:
90+
| name | type | required | default | description |
91+
|------ |------ |---------- |--------- |------------------------------------------------ |
92+
| id | int | yes | none | The id of the resource to retrieve |
8793
##### Request: https://api.spigotmc.org/simple/0.2/index.php?action=getResource&id=2
8894
##### Response:
8995
```json
@@ -121,7 +127,11 @@ Here are examples of current capabilities:
121127
```
122128

123129
#### getResourcesByAuthor
124-
##### Parameters: `id`, required, the author id, `page`, optional, defaults to `1`
130+
##### Parameters:
131+
| name | type | required | default | description |
132+
|------ |------ |---------- |--------- |----------------------------------------------------------------------------- |
133+
| id | int | yes | none | The id of the author to restrict results to (see `findAuthor`) |
134+
| page | int | no | 1 | The page number to retrieve. Items are paginated at 10 results per page. |
125135
##### Request: https://api.spigotmc.org/simple/0.2/index.php?action=getResourcesByAuthor&id=100356&&page=1
126136
##### Response (truncated):
127137
```json
@@ -261,7 +271,11 @@ Here are examples of current capabilities:
261271
```
262272

263273
#### getResourceUpdate
264-
##### Parameters: `id`, required, the resource update id
274+
##### Parameters:
275+
| name | type | required | default | description |
276+
|------ |------ |---------- |--------- |----------------------------------------------------------------------------- |
277+
| id | int | yes | none | The id of the **resource _update_** to retrieve (see `getResourceUpdates`) |
278+
| page | int | no | 1 | The page number to retrieve. Items are paginated at 10 results per page. |
265279
##### Request: https://api.spigotmc.org/simple/0.2/index.php?action=getResourceUpdate&id=352711
266280
##### Response:
267281
```json
@@ -274,7 +288,11 @@ Here are examples of current capabilities:
274288
```
275289

276290
#### getResourceUpdates
277-
##### Parameters: `id`, required, the resource id, `page`, optional, defaults to `1`
291+
##### Parameters:
292+
| name | type | required | default | description |
293+
|------ |------ |---------- |--------- |----------------------------------------------------------------------------- |
294+
| id | int | yes | none | The id of the resource for which to retrieve updates |
295+
| page | int | no | 1 | The page number to retrieve. Items are paginated at 10 results per page. |
278296
##### Request: https://api.spigotmc.org/simple/0.2/index.php?action=getResourceUpdates&id=2&page=1
279297
##### Response (truncated):
280298
```json
@@ -313,7 +331,10 @@ Here are examples of current capabilities:
313331
```
314332

315333
#### getAuthor
316-
##### Parameters: `id`, required, the user id
334+
##### Parameters:
335+
| name | type | required | default | description |
336+
|------ |------ |---------- |--------- |----------------------------------------------------------------------------- |
337+
| id | int | yes | none | The id of the author to retrieve |
317338
##### Request: https://api.spigotmc.org/simple/0.2/index.php?action=getAuthor&id=1
318339
##### Response:
319340
```json
@@ -329,7 +350,10 @@ Here are examples of current capabilities:
329350
```
330351

331352
#### findAuthor
332-
##### Parameters: `name`, required, should exactly match the Spigot username (escape if necessary)
353+
##### Parameters:
354+
| name | type | required | default | description |
355+
|------ |------ |---------- |--------- |--------------------------------------------------------------------------------------- |
356+
| name | str | yes | none | The exactly matching username of the desired user, with escape sequences if necessary |
333357
##### Request: https://api.spigotmc.org/simple/0.2/index.php?action=findAuthor&name=simpleauthority
334358
##### Response:
335359
```json

0 commit comments

Comments
 (0)