document me

This commit is contained in:
zkldi
2021-06-28 16:41:16 +01:00
parent b955f825f8
commit b8aeaabf88
2 changed files with 83 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
# Individual User Endpoints
*****
## Change Profile Picture
`PUT /api/v1/users/:userID/pfp`
### Permissions
- customise_profile
- Must be the owner of this profile.
### Parameters
| Property | Type | Description |
| :: | :: | :: |
| `pfp` | JPG, or PNG | The new profile picture to set. |
!!! note
This endpoint expects multipart form data.
### Response
| Property | Type | Description |
| :: | :: | :: |
| `get` | String | This contains the URL to then GET the new profile picture. |
### Example
#### Request
```
PUT /api/v1/users/1/pfp
```
```
// this is not a real multipart request, as those things
// are huge!
pfp=<somefiledata>
```
#### Response
```json
{
"get": "/api/v1/users/1/pfp"
}
```
*****
## Get a user's profile picture.
`GET /api/v1/users/:userID/pfp`
### Parameters
None.
### Response
Not JSON. This returns the actual JPG or PNG stored for
this user.
### Example
N/A
+13
View File
@@ -51,6 +51,17 @@ GET /api/v1/users
| :: | :: | :: |
| `:userID` | URL Parameter | The user's userID or their username. |
!!! note
The :userID param has some special functionality,
and any time you see it in these docs, that
functionality is supported.
You may pass the integer userID for this user - 1.
You may also pass the username - zkldi.
You may also pass the special string - `me` - which
will select whatever user this authentication token
is for.
### Response
| Property | Type | Description |
@@ -70,6 +81,8 @@ GET /api/v1/users
GET /api/v1/users/zkldi
OR
GET /api/v1/users/1
OR
GET /api/v1/users/me WHEN authenticated as userID 1.
```
#### Response