0% found this document useful (0 votes)
55 views7 pages

Rest Api

This document defines an OpenAPI specification for an API with endpoints for authentication, user accounts, jobs, and games. It includes endpoints for user login/signup, creating/deleting/listing accounts, creating/deleting/listing jobs, relating accounts to games, and checking/creating/deleting/listing games. Each endpoint is associated with a tag category and most require a request body with defined parameters. The API uses JWT tokens for authentication.

Uploaded by

Rafael Kuhn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views7 pages

Rest Api

This document defines an OpenAPI specification for an API with endpoints for authentication, user accounts, jobs, and games. It includes endpoints for user login/signup, creating/deleting/listing accounts, creating/deleting/listing jobs, relating accounts to games, and checking/creating/deleting/listing games. Each endpoint is associated with a tag category and most require a request body with defined parameters. The API uses JWT tokens for authentication.

Uploaded by

Rafael Kuhn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

{

"openapi": "3.0.0",
"info": {
"title": "API Documentation",
"version": "1.0.0"
},
"tags": [
{
"name": "Games",
"description": "Endpoints related to games"
},
{
"name": "Accounts",
"description": "Endpoints related to games"
},
{
"name": "Jobs",
"description": "Endpoints related to Jobs"
},
{
"name": "Auth",
"description": "Endpoints related to Auth"
}
],
"paths": {
"/auth/login": {
"post": {
"responses": {},
"summary": "User login",
"tags": [
"Auth"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"name",
"password"
]
}
}
}
}
}
},
"/auth/signup": {
"post": {
"responses": {},
"summary": "User signup",
"tags": [
"Auth"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"job": {
"type": "string"
}
},
"required": [
"name",
"password"
]
}
}
}
}
}
},
"/job/list": {
"get": {
"responses": {},
"summary": "Retrieve a list of jobs",
"tags": [
"Jobs"
]
}
},
"/job/create": {
"post": {
"responses": {},
"summary": "Create a new job",
"tags": [
"Jobs"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"permissions": {
"type": "string",
"pattern": "^[a-zA-Z0-9;]+$",
"example": "canDoThis;canDoThat"
}
},
"required": [
"name",
"permissions"
]
}
}
}
}
}
},
"/job/delete": {
"delete": {
"responses": {},
"summary": "Delete a job by name",
"tags": [
"Jobs"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
}
}
}
}
}
},
"/accounts/create": {
"post": {
"responses": {},
"summary": "Create a new account",
"tags": [
"Accounts"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"gamename": {
"type": "string"
},
"accounts": {
"type": "string",
"pattern": "[0-9_!@#$%^&*()a-zA-Z]+\\/[0-9_!@#$%^&*()a-zA-Z]
+\\/[0-9]+;",
"example": "example_account/example_user/1234;"
}
},
"required": [
"gamename",
"accounts"
]
}
}
}
}
}
},
"/accounts/delete": {
"delete": {
"responses": {},
"summary": "Delete an account by ID",
"tags": [
"Accounts"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "(/;*)/gi",
"example": "example_id;"
}
},
"required": [
"id"
]
}
}
}
}
}
},
"/accounts/list": {
"get": {
"responses": {},
"summary": "Retrieve a list of accounts",
"tags": [
"Accounts"
]
}
},
"/accounts/relate": {
"post": {
"responses": {},
"summary": "Relate an account to a game",
"tags": [
"Accounts"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"accountId": {
"type": "string",
"pattern": "(/;*)/gi",
"example": "example_account_id;example_account_id2"
},
"gameId": {
"type": "string",
"format": "uuid"
}
},
"required": [
"accountId",
"gameId"
]
}
}
}
}
}
},
"/game/check": {
"post": {
"responses": {},
"summary": "Check game by ID",
"tags": [
"Games"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
}
},
"required": [
"id"
]
}
}
}
}
}
},
"/game/list": {
"get": {
"responses": {},
"summary": "Retrieve a list of games",
"tags": [
"Games"
]
}
},
"/game/delete": {
"delete": {
"responses": {},
"summary": "Delete a game by name",
"tags": [
"Games"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
}
}
}
}
}
},
"/game/create": {
"post": {
"responses": {},
"summary": "Create a new game",
"tags": [
"Games"
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"accounts": {
"type": "string",
"example":
"accountUser/accountPass/accountValue;accountUser/accountPass/accountValue"
}
},
"required": [
"name"
]
}
}
}
}
}
}
},
"components": {
"securitySchemes": {
"Token": {
"type": "apiKey",
"in": "header",
"name": "Token"
}
}

},
"security": [
{
"Token": []
}
]
}

You might also like