👨🏭Account
This route verifies the username and password.The route goes thorough numerous checks.The route then creates a session and generates tokens if the user is authenticated.
Body
usernamestringOptionalExample:
john@API
passwordstringOptionalExample:
honeyBunnies
Responses
200
Successful
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
401005
application/json
401006
application/json
401007
application/json
403002
application/json
post
POST /api/v1/account/login HTTP/1.1
Host: www.dyorbackend.tk
Content-Type: application/json
Accept: */*
Content-Length: 49
{
"username": "john@API",
"password": "honeyBunnies"
}
{
"ok": true,
"result": {
"token": {
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2V4YW1wbGUuYXV0aDAuY29tLyIsImF1ZCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tL2NhbGFuZGFyL3YxLyIsInN1YiI6InVzcl8xMjMiLCJpYXQiOjE0NTg3ODU3OTYsImV4cCI6MTQ1ODg3MjE5Nn0.CA7eaHjIHz5NxeIJoFK9krqaeZrPLwmMmgI_XiQiIkQ",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2V4YW1wbGUuYXV0aDAuY29tLyIsImF1ZCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tL2NhbGFuZGFyL3YxLyIsInN1YiI6InVzcl8xMjMiLCJpYXQiOjE0NTg3ODU3OTYsImV4cCI6MTQ1ODg3MjE5Nn0.CA7eaHjIHz5NxeIJoFK9krqaeZrPLwmMmgI_XiQiIkQ"
}
}
}
Needs Account Authentication
This route logouts of the account.The route first checks and finds the session saved in the database.The route then deletes the session found related to the account.
Responses
200
Successful
application/json
401
Not Found
application/json
500
Internal Server Error
application/json
401001
application/json
401002
application/json
401003
application/json
401004
application/json
delete
DELETE /api/v1/account/logout HTTP/1.1
Host: www.dyorbackend.tk
Accept: */*
{
"ok": true,
"result": {}
}
Needs Account Authentication
This route refreshes the account session.The route first checks and finds the account session saved in the database.The route then deletes the session, creates a new one and generates new tokens.
Responses
200
Successful
application/json
401
Not Found
application/json
500
Internal Server Error
application/json
401001
application/json
401002
application/json
401003
application/json
401004
application/json
get
GET /api/v1/account/refresh HTTP/1.1
Host: www.dyorbackend.tk
Accept: */*
{
"ok": true,
"result": {
"token": {
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2V4YW1wbGUuYXV0aDAuY29tLyIsImF1ZCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tL2NhbGFuZGFyL3YxLyIsInN1YiI6InVzcl8xMjMiLCJpYXQiOjE0NTg3ODU3OTYsImV4cCI6MTQ1ODg3MjE5Nn0.CA7eaHjIHz5NxeIJoFK9krqaeZrPLwmMmgI_XiQiIkQ",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2V4YW1wbGUuYXV0aDAuY29tLyIsImF1ZCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tL2NhbGFuZGFyL3YxLyIsInN1YiI6InVzcl8xMjMiLCJpYXQiOjE0NTg3ODU3OTYsImV4cCI6MTQ1ODg3MjE5Nn0.CA7eaHjIHz5NxeIJoFK9krqaeZrPLwmMmgI_XiQiIkQ"
}
}
}
This route registers a new account.The route first processes the payload provided.The route then creates a new account entry in our database.
Body
usernamestringOptionalExample:
john@API
passwordstringOptionalExample:
honeyBunnies
Responses
200
Successful
application/json
500
Internal Server Error
application/json
post
POST /api/v1/account/register HTTP/1.1
Host: www.dyorbackend.tk
Content-Type: application/json
Accept: */*
Content-Length: 49
{
"username": "john@API",
"password": "honeyBunnies"
}
{
"ok": true,
"result": {}
}
Last updated