70 lines
2.2 KiB
Markdown
70 lines
2.2 KiB
Markdown
# 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](#sign-up)
|
|
2. [Log In](#log-in)
|
|
3. [API Sign Up](#api-sign-up)
|
|
4. [API Log In](#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:
|
|
```JSON
|
|
{
|
|
"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:
|
|
```JSON
|
|
{
|
|
"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:
|
|
```JSON
|
|
{
|
|
"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:
|
|
```JSON
|
|
{
|
|
"id": 123,
|
|
"username": "user123",
|
|
"email": "rr@ttt.yy",
|
|
"access_level": 1,
|
|
"password": "password123"
|
|
}
|
|
``` |