Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.
/ API Public archive

A modern API created with Actix in rust for GO-PC Build

License

Notifications You must be signed in to change notification settings

GO-PC-Build/API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO-PC Build Official API

About

This API was created as backend for the project on GO-AO (GO-PC Build). Which hosts workshops on how you can successfully and professionally build your own computers and install an operating system.

Documentation

Endpoints

/status

About

This route can be used to check if the API is up.

Return type

StatusResponse

/auth/login

About

This endpoint can be used for existing users to receive a token with their credentials.

Request Body

{
  "username": "string",
  "password": "string"
}

Return type

TokenResponse

/auth/extern/login

About

Login with a third party service.

Request Body

{
  "value": "string (client id)",
  "token": "optional[Auth token, eg for discord]"
}

Return type

TokenResponse

Exception type

BaseException

/auth/register

About

This endpoint provides a way for new users to create an account.

Request Body

{
  "username": "string",
  "email": "string",
  "password": "string"
}

Return type

TokenResponse

/auth/revoke

About

This endpoint permanently deletes a token from the database.

Request Header

Authorization

Return type

StatusResponse

Exception type

BaseException

/user/@me

About

This endpoint fetches the base data from a user.

Request Header

Authorization

Return type

User

Exception type

BaseException

/user/connect/{platform}

About

Connect an account with a third party platform.

Request Body

{
  "value": "string"
}

Request Header

Authorization

Return type

StatusResponse

Exception type

BaseException

Responses

Success

StatusResponse

Format:

{
  "message": "string"
}

Example response:

{
  "message": "API is fully operational!"
}
TokenResponse

Format:

{
  "token": "string"
}

Example response:

{
  "token": "GsRl67eiDZt4oskOmJqFa256okMu6aNDSHVmJRJSsEv6koS9jfn9M8aelIZM92GA.qljU4k7k"
}
User

Format:

{
  "id": "string",
  "nickname": "string",
  "email": "string",
  "avatar": "string",
  "date": "string"
}

Example response:

{
  "id": "123example321",
  "nickname": "example lord",
  "email": "[email protected]",
  "avatar": "http://cdn.example.com/pfp/123example321",
  "date": "2020-12-28T13:18:23.986284700+00:00"
}

Exceptions

BaseException

Format:

{
  "message": "string",
  "error": "string"
}

Example response:

{
  "message": "Oops... You did something wrong! (See error for more information)",
  "error": "No or an invalid 'Authorization' header was present on the request"
}

Headers

Authorization

Format

Name Value
Authorization string
Example
Name Value
Authorization GsRl67eiDZt4oskOmJqFa256okMu6aNDSHVmJRJSsEv6koS9jfn9M8aelIZM92GA.qljU4k7k

License

This application is under a CCO 1.0 License.

About

A modern API created with Actix in rust for GO-PC Build

Resources

License

Stars

Watchers

Forks