112 lines
1.7 KiB
Plaintext
112 lines
1.7 KiB
Plaintext
# Group Accounts
|
|
|
|
## Account [/user]
|
|
|
|
### Create an account [POST]
|
|
|
|
+ Request (application/json)
|
|
+ Headers
|
|
|
|
Accept: application/json
|
|
|
|
+ Body
|
|
|
|
{
|
|
"username": "user",
|
|
"password": "apassword"
|
|
}
|
|
|
|
|
|
+ Response 200
|
|
|
|
+ Response 409
|
|
|
|
### Delete a user [DELETE]
|
|
|
|
+ Request
|
|
+ Headers
|
|
|
|
Authorization: Bearer <token>
|
|
Accept: application/json
|
|
|
|
+ Response 200
|
|
|
|
+ Response 404
|
|
|
|
|
|
## Authentication [/user/login]
|
|
Authenticate one user to access protected routing.
|
|
|
|
### Authenticate a user [POST]
|
|
|
|
+ Request (application/json)
|
|
+ Headers
|
|
|
|
Accept: application/json
|
|
|
|
+ Body
|
|
|
|
{
|
|
"username": "user",
|
|
"password": "myrealpassword"
|
|
}
|
|
|
|
+ Response 200 (application/json)
|
|
+ Body
|
|
|
|
{
|
|
"token": "<token>",
|
|
"refreshToken": "<token>"
|
|
}
|
|
|
|
+ Response 401
|
|
|
|
## Token refresh [/user/refresh_token]
|
|
|
|
### Refresh JWT token [POST]
|
|
|
|
+ Request (application/json)
|
|
+ Headers
|
|
|
|
Accept: application/json
|
|
|
|
+ Body
|
|
|
|
{
|
|
"refreshToken": "<refresh-token>"
|
|
}
|
|
|
|
+ Response 200 (application/json)
|
|
+ Body
|
|
|
|
{
|
|
"token": "<token>",
|
|
"refreshToken": "<refresh-token>"
|
|
}
|
|
|
|
|
|
+ Response 401
|
|
|
|
## User Info [/user/me]
|
|
Receive the username and email from the currently logged in user
|
|
|
|
### Get User Info [GET]
|
|
|
|
+ Request
|
|
+ Headers
|
|
|
|
Authorization: Bearer <token>
|
|
Accept: application/json
|
|
|
|
|
|
+ Response 200 (application/json)
|
|
+ Body
|
|
|
|
{
|
|
"user": {
|
|
"username": "user"
|
|
}
|
|
}
|
|
|
|
+ Response 401
|