diff --git a/docs/docs/api/routes/user.md b/docs/docs/api/routes/user.md new file mode 100644 index 000000000..1d37b34d3 --- /dev/null +++ b/docs/docs/api/routes/user.md @@ -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= +``` + +#### 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 + + + diff --git a/docs/docs/api/routes/users.md b/docs/docs/api/routes/users.md index 6b3540154..ae1ea85da 100644 --- a/docs/docs/api/routes/users.md +++ b/docs/docs/api/routes/users.md @@ -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