2023-08-23 01:02:56 +06:00
|
|
|
{
|
|
|
|
"openapi": "3.0.3",
|
|
|
|
"info": {
|
|
|
|
"title": "Captcha service - API",
|
|
|
|
"description": "API Documentation.",
|
|
|
|
"version": "1.0.0"
|
|
|
|
},
|
|
|
|
"tags": [
|
|
|
|
{
|
|
|
|
"name": "captcha",
|
|
|
|
"description": "Operations about captcha"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"paths": {
|
2023-08-23 21:56:06 +06:00
|
|
|
"/api/v1/captcha": {
|
2023-08-23 01:02:56 +06:00
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"captcha"
|
|
|
|
],
|
|
|
|
"summary": "Captcha generation",
|
|
|
|
"description": "",
|
|
|
|
"operationId": "captchaGeneration",
|
|
|
|
"parameters": [
|
|
|
|
{
|
2023-08-23 23:45:57 +06:00
|
|
|
"name": "public-token",
|
2023-08-23 01:02:56 +06:00
|
|
|
"in": "header",
|
|
|
|
"description": "Public token for captcha generation",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "successful operation",
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/Captcha"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"403": {
|
|
|
|
"description": "Invalid public token value"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"post": {
|
|
|
|
"tags": [
|
|
|
|
"captcha"
|
|
|
|
],
|
|
|
|
"summary": "Checking captcha",
|
|
|
|
"description": "",
|
|
|
|
"operationId": "captchaChecking",
|
|
|
|
"parameters": [
|
|
|
|
{
|
2023-08-23 23:45:57 +06:00
|
|
|
"name": "public-token",
|
2023-08-23 01:02:56 +06:00
|
|
|
"in": "header",
|
|
|
|
"description": "Public token for captcha generation",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"requestBody": {
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/CaptchaChecking"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "successful operation",
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/CaptchaVerification"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"403": {
|
|
|
|
"description": "Invalid public token value"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2023-08-23 21:56:06 +06:00
|
|
|
"/api/v1/captcha/{captcha_key}": {
|
2023-11-26 22:42:22 +06:00
|
|
|
"post": {
|
2023-08-23 01:02:56 +06:00
|
|
|
"tags": [
|
|
|
|
"captcha"
|
|
|
|
],
|
|
|
|
"summary": "Verification Information",
|
|
|
|
"description": "",
|
|
|
|
"operationId": "CaptchaKeyInfo",
|
|
|
|
"parameters": [
|
|
|
|
{
|
2023-08-23 23:45:57 +06:00
|
|
|
"name": "private-token",
|
2023-08-23 01:02:56 +06:00
|
|
|
"in": "header",
|
|
|
|
"description": "Private token for captcha verification",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "captcha_key",
|
|
|
|
"in": "path",
|
|
|
|
"description": "The key that we received when generating the captcha",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2023-11-26 22:42:22 +06:00
|
|
|
"requestBody": {
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/GetCaptchaKeyInfo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2023-08-23 01:02:56 +06:00
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "successful operation",
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/CaptchaKeyInfo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"403": {
|
|
|
|
"description": "Invalid private token value"
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "Captcha key not found"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"components": {
|
|
|
|
"schemas": {
|
|
|
|
"Captcha": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2023-09-19 14:27:33 +06:00
|
|
|
"image_head": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/Image",
|
|
|
|
}
|
2023-08-23 01:02:56 +06:00
|
|
|
},
|
2023-09-19 14:27:33 +06:00
|
|
|
"image_body": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/Image"
|
|
|
|
}
|
2023-08-23 01:02:56 +06:00
|
|
|
},
|
|
|
|
"captcha_key": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": [
|
2023-09-19 14:27:33 +06:00
|
|
|
"image_head", "image_body", "captcha_key"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Image": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"base64": {
|
|
|
|
"type": "string",
|
|
|
|
"format": "byte"
|
|
|
|
},
|
|
|
|
"width": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"height": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": [
|
|
|
|
"base64", "width", "height"
|
2023-08-23 01:02:56 +06:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"CaptchaVerification": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2023-11-26 15:09:42 +06:00
|
|
|
"captcha_key": {
|
2023-08-23 01:02:56 +06:00
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": [
|
2023-11-26 15:09:42 +06:00
|
|
|
"captcha_key"
|
2023-08-23 01:02:56 +06:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"CaptchaChecking": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"captcha_key": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"verification": {
|
|
|
|
"type": "array",
|
|
|
|
"example": [{"x": 10, "y": 20}, {"x": 30, "y": 30}, {"x": 60, "y": 50}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": [
|
|
|
|
"captcha_key", "verification"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"CaptchaKeyInfo": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"status": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"message": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": [
|
|
|
|
"status", "message"
|
|
|
|
]
|
2023-11-26 22:42:22 +06:00
|
|
|
},
|
|
|
|
"GetCaptchaKeyInfo": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"user_ageng": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
2023-08-23 01:02:56 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|