👨‍🏭Account

Login to the account by credentials.

post

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
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"
    }
  }
}

Logs out of the account by deleting session

delete

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
delete
DELETE /api/v1/account/logout HTTP/1.1
Host: www.dyorbackend.tk
Accept: */*
{
  "ok": true,
  "result": {}
}

Refreshes the account session and generates new tokens

get

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
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"
    }
  }
}

Register a new account in our app

post

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
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