Files
5/docs/api.md
2024-07-04 03:49:03 +05:30

2.2 KiB

API Documentation

Introduction

This document provides detailed information on how to use and implement the APIs in the V8 engine.

Table of Contents

  1. Sign Up
  2. Log In
  3. API Sign Up
  4. API Log In

Sign Up

  • Description: This API allows users to sign up for a new account through the browser.
  • Usage: To use this API, follow the steps below:
    1. Step 1: Redirect the user to the sign-up page using the /signup route.
    2. Step 2: Fill in the required information and submit the form.
    3. Step 3: A JSON response will be returned with the user's information.
  • Payload Example:
    {
      "status": "success",
      "message": "User created successfully"
    }
    

Log In

  • Description: This API allows users to log in to their account through the browser.
  • Usage: To use this API, follow these steps:
    1. Step 1: Redirect the user to the log-in page using the /login route.
    2. Step 2: Enter the user's credentials and submit the form.
    3. Step 3: A JSON response will be returned with the user's information.
  • Payload Example:
    {
      "id": 123,
      "username": "user123",
      "email": "rr@ttt.yy",
      "access_level": 1,
      "password": "password123"
    }
    

API Sign Up

  • Description: This API allows users to sign up for a new account programmatically.
  • Usage: To use this API, follow these steps:
    1. Step 1: API call to the /api/signup?username={newUser}&email={Email}&password={Password} endpoint with the required parameters.
    2. Step 2: The server will create a new user account and return a JSON response.
  • Payload Example:
    {
      "status": "success",
      "message": "User created"
    }
    

API Log In

  • Description: This API allows users to log in to their account programmatically.
  • Usage: To use this API, follow these steps:
    1. Step 1: API call to the /api/login?username={user}&password={password} endpoint with the required parameters.
    2. Step 3: The server will authenticate the user and return a JSON response.
  • Payload Example:
    {
      "id": 123,
      "username": "user123",
      "email": "rr@ttt.yy",
      "access_level": 1,
      "password": "password123"
    }