Skip to content

Commit f9b8ad9

Browse files
committed
feat: enhance API documentation with authentication requirements and new update endpoints
1 parent 6979574 commit f9b8ad9

File tree

5 files changed

+80
-2
lines changed

5 files changed

+80
-2
lines changed

docs/endpoints/cards.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ sidebar_position: 2
55

66
This page contains information about the `/cards` endpoint, which is used to manage your cards.
77

8+
:::info
9+
10+
This endpoint requires authentication and the [`cards` scope](/oauth2/scopes#cards).
11+
12+
:::
13+
814
## Get a card
915

1016
Get a card by its ID.

docs/endpoints/links.md

+38
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ sidebar_position: 3
55

66
This page contains information about the `/links` endpoint, which is used to manage your links.
77

8+
:::info
9+
10+
This endpoint requires authentication and the [`links` scope](/oauth2/scopes#links).
11+
12+
:::
13+
814
## Get a link
915

1016
Get a link by its ID.
@@ -58,6 +64,38 @@ Returns a 201 status on success, and the link object in the response body.
5864
}
5965
```
6066

67+
## Update a link
68+
69+
Update a link by its ID.
70+
71+
### Request
72+
73+
`:id` is the ID of the link you want to update.
74+
75+
```http request
76+
PATCH /api/links/:id
77+
Content-Type: application/json
78+
```
79+
80+
Example body:
81+
```json
82+
{
83+
"value": "id/Yuuto"
84+
}
85+
```
86+
87+
### Example Response
88+
89+
Returns a 200 status on success, and the updated link object in the response body.
90+
91+
```json
92+
{
93+
"id": "5675e563-0fd3-419b-947f-d95e507f673b",
94+
"type": "steam",
95+
"value": "id/Yuuto"
96+
}
97+
```
98+
6199
## Delete a link
62100

63101
Delete a link by its ID.

docs/endpoints/uploads.md

+18
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ sidebar_position: 4
55

66
This page contains information about the `/upload` endpoint, which is used to upload avatars, backgrounds, audios, custom cursors, and custom fonts.
77

8+
:::info
9+
10+
Those endpoints requires authentication and the [`uploads` scope](/oauth2/scopes#uploads).
11+
12+
:::
13+
814
## Upload an avatar
915

1016
Upload a new avatar, and replace the current one if you have one.
@@ -99,6 +105,12 @@ Covers URLs are just `https://cdn.miwa.lol/audios-covers/:id.png`, where `:id` i
99105

100106
## Update an audio
101107

108+
:::info
109+
110+
This endpoint requires the [`audios.manage`](/oauth2/scopes#audios.manage) scope.
111+
112+
:::
113+
102114
Update an audio by its ID.
103115

104116
### Request
@@ -131,6 +143,12 @@ Returns the updated audio object.
131143

132144
## Delete an audio
133145

146+
:::info
147+
148+
This endpoint requires the [`audios.manage`](/oauth2/scopes#audios.manage) scope.
149+
150+
:::
151+
134152
Delete an audio by its ID.
135153

136154
### Request

docs/endpoints/users.md

+12
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ GET /api/user/:username
8686

8787
## Get your user
8888

89+
:::info
90+
91+
This endpoint requires authentication and the [`identify` scope](/oauth2/scopes#identify). If you want to get the user's email address, you will also need the [`email` scope](/oauth2/scopes#email).
92+
93+
:::
94+
8995
Get the user that is currently authenticated.
9096

9197
### Request
@@ -168,6 +174,12 @@ This is practically the same as the response from the previous endpoint, but wit
168174

169175
## Update your profile
170176

177+
:::info
178+
179+
This endpoint requires authentication and the [`profile.update` scope](/oauth2/scopes#profileupdate).
180+
181+
:::
182+
171183
Allows you to update your profile, including your username, display name, alias, bio, and more.
172184

173185
### Request

docs/oauth2/scopes.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ Grants access to the user's information, such as their username, display name, a
1414

1515
Grants access to the user's email address.
1616

17+
### `profile.update`
18+
19+
Grants ability to update the user's profile, such as their username, display name, colors, effects, etc.
20+
1721
### `links`
1822

1923
Grants access to the user's links and the ability to create, update, and delete them.
2024

2125
### `cards`
2226

23-
Grants access to the user's cards and the ability to create, update, and delete them.
27+
Grants access to the user's cards and the ability to create and delete them.
2428

2529
### `audios.manage`
2630

27-
Grants ability to create, update, and delete audios.
31+
Grants ability to update and delete audios. For uploading audios, you need the `uploads` scope.
2832

2933
### `uploads`
3034

0 commit comments

Comments
 (0)