birzha-legalizasia/storage/api-docs/api-docs.json

620 lines
23 KiB
JSON

{
"openapi": "3.0.0",
"info": {
"title": "Legalization API",
"version": "1.0.0"
},
"paths": {
"/api/login": {
"post": {
"tags": [
"Authorization"
],
"summary": " - Login user",
"operationId": "a3b306d14572d1f4bd6c064b3233e7b8",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
},
"type": "object",
"example": {
"email": "ilmedovamahri@gmail.com",
"password": 12345678
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/api/register": {
"post": {
"tags": [
"Authorization"
],
"summary": " - Register user",
"operationId": "8a56853624e025573120a09a4c75d468",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"email": {
"type": "string"
},
"password": {
"type": "string"
},
"account_type": {
"type": "string"
},
"country": {
"type": "integer"
}
},
"type": "object",
"example": {
"firstname": "Mahri",
"lastname": "Ilmedova",
"email": "ilmedovamahri@gmail.com",
"password": 12345678,
"country": 1,
"account_type": "business"
}
}
}
}
},
"responses": {
"201": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"properties": {
"token": {
"type": "string"
},
"client": {
"properties": {
"id": {
"type": "integer"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"email": {
"type": "string"
},
"is_verified": {
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
},
"errors": {
"type": "object"
}
},
"type": "object"
}
}
}
}
}
}
},
"/api/verify-email": {
"post": {
"tags": [
"Authorization"
],
"summary": " - Verify email of client",
"operationId": "200ade402157108a4de2cc69e35ee0bf",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"email": {
"type": "string"
},
"token": {
"type": "string"
}
},
"type": "object",
"example": {
"email": "ilmedovamahri@gmail.com",
"token": "4515"
}
}
}
}
},
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Missing fields (email or token)"
},
"404": {
"description": "Client not found"
},
"401": {
"description": "Unauthorised. Tokens do not match"
}
}
}
},
"/api/client": {
"get": {
"tags": [
"Authorization"
],
"summary": " - Get user",
"operationId": "9f1c53ceee113e04ff7709c819ce9bf5",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"bearerAuth": []
}
]
}
},
"/api/logout": {
"post": {
"tags": [
"Authorization"
],
"summary": " - Logout user",
"operationId": "fe8f3429cd6979b3b4517e186505f9f9",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"bearerAuth": []
}
]
}
},
"/api/forgot-password": {
"post": {
"tags": [
"Authorization"
],
"summary": " - Send a user password reset link",
"operationId": "45bf57623119762aa1c685aff5d3716e",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"email": {
"type": "string"
}
},
"type": "object",
"example": {
"email": "ilmedovamahri@gmail.com"
}
}
}
}
},
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/reset-password": {
"post": {
"tags": [
"Authorization"
],
"summary": " - Reset client password and enter new",
"operationId": "4196e530fdb10fa91f253ae2ef237046",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"email": {
"type": "string"
},
"token": {
"type": "string"
},
"password": {
"type": "string"
},
"confirm_password": {
"type": "string"
}
},
"type": "object",
"example": {
"email": "ilmedovamahri@gmail.com",
"token": "2546",
"password": "Hello001!",
"confirm_password": "Hello001!"
}
}
}
}
},
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/update-client": {
"post": {
"tags": [
"Authorization"
],
"summary": " - Update client account",
"description": "Every field is required, except password. Password field is optional",
"operationId": "aea3e7359e7ae73fa1f74ee19df97360",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"password": {
"type": "string"
}
},
"type": "object",
"example": {
"firstname": "Mahri",
"lastname": "Ilmedova",
"email": "ilmedovamahri@gmail.com",
"password": "Hello001!"
}
}
}
}
},
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"bearerAuth": []
}
]
}
},
"/api/get-countries": {
"get": {
"tags": [
"Sprawochnik"
],
"summary": " - Get countries list",
"operationId": "659eb6cf84f228d274888bfeaff6edbd",
"parameters": [
{
"name": "X-Localization",
"in": "header",
"description": "Localization",
"required": false,
"schema": {
"type": "string"
},
"examples": {
"ru": {
"summary": "Russian localization",
"value": "ru"
},
"en": {
"summary": "English localization",
"value": "en"
},
"tm": {
"summary": "Turkmen localization",
"value": "tm"
}
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"name": "bearerAuth",
"in": "header",
"bearerFormat": "JWT",
"scheme": "bearer"
}
}
}
}