By Guest

DevBin v3 API Definition

JSON 20.81 KiB 60 2 months ago
{ "openapi": "3.0.1", "info": { "title": "DevBin v3", "version": "v3" }, "paths": { "/api/v3/Me/Pastes": { "get": { "tags": [ "Me" ], "summary": "Get all own pastes", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultPaste" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultPaste" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultPaste" } } } } } } } }, "/api/v3/Me/Folders": { "get": { "tags": [ "Me" ], "summary": "Get all own folders", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultFolder" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultFolder" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultFolder" } } } } } } } }, "/api/v3/Me/Folder/{id}": { "get": { "tags": [ "Me" ], "summary": "Get information about a folder", "parameters": [ { "name": "id", "in": "path", "description": "Folder ID", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ResultFolder" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ResultFolder" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ResultFolder" } } } } } }, "delete": { "tags": [ "Me" ], "summary": "Delete a folder", "parameters": [ { "name": "id", "in": "path", "description": "Folder ID", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ResultFolder" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ResultFolder" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ResultFolder" } } } } } } }, "/api/v3/Me/Folder": { "post": { "tags": [ "Me" ], "summary": "Create a new folder", "requestBody": { "description": "Folder data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserFolder" } }, "text/json": { "schema": { "$ref": "#/components/schemas/UserFolder" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/UserFolder" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ResultFolder" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ResultFolder" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ResultFolder" } } } } } } }, "/api/v3/Me/GetToken": { "get": { "tags": [ "Me" ], "summary": "Get information about the token in use", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ResultToken" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ResultToken" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ResultToken" } } } } } } }, "/api/v3/Options/exposures": { "get": { "tags": [ "Options" ], "summary": "Complete list of available exposures", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Exposure" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Exposure" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Exposure" } } } } } } } }, "/api/v3/Options/syntaxes": { "get": { "tags": [ "Options" ], "summary": "Complete list of available syntaxes", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Syntax" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Syntax" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Syntax" } } } } } } } }, "/api/v3/Paste/{code}": { "get": { "tags": [ "Paste" ], "summary": "Get information about a paste", "parameters": [ { "name": "code", "in": "path", "description": "Paste code", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ResultPaste" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ResultPaste" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ResultPaste" } } } } } }, "patch": { "tags": [ "Paste" ], "summary": "Update information and/or content of an own paste", "parameters": [ { "name": "code", "in": "path", "description": "Paste code", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Updated parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPaste" } }, "text/json": { "schema": { "$ref": "#/components/schemas/UserPaste" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/UserPaste" } } } }, "responses": { "200": { "description": "Success" } } }, "delete": { "tags": [ "Paste" ], "summary": "Delete an own paste", "parameters": [ { "name": "code", "in": "path", "description": "Paste code", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success" } } } }, "/api/v3/Paste": { "post": { "tags": [ "Paste" ], "summary": "Upload a new paste", "requestBody": { "description": "Filled paste", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPaste" } }, "text/json": { "schema": { "$ref": "#/components/schemas/UserPaste" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/UserPaste" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ResultPaste" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ResultPaste" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ResultPaste" } } } } } } }, "/api/v3/User/{username}": { "get": { "tags": [ "User" ], "summary": "Get information about an user", "parameters": [ { "name": "username", "in": "path", "description": "User's username", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ResultUser" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ResultUser" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ResultUser" } } } } } } }, "/api/v3/User/{username}/Pastes": { "get": { "tags": [ "User" ], "summary": "Get the user's public list of pastes", "parameters": [ { "name": "username", "in": "path", "description": "User's username", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultPaste" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultPaste" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultPaste" } } } } } } } }, "/api/v3/User/{username}/folders": { "get": { "tags": [ "User" ], "summary": "Get the user's public list of folders", "parameters": [ { "name": "username", "in": "path", "description": "User's username", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultFolder" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultFolder" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ResultFolder" } } } } } } } } }, "components": { "schemas": { "Exposure": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "maxLength": 255, "type": "string", "nullable": true }, "isListed": { "type": "boolean" }, "isAuthorOnly": { "type": "boolean" } }, "additionalProperties": false }, "ResultFolder": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "ResultPaste": { "type": "object", "properties": { "code": { "type": "string", "nullable": true }, "title": { "type": "string", "nullable": true }, "views": { "type": "integer", "format": "int32" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true }, "syntaxName": { "type": "string", "nullable": true }, "exposureId": { "type": "integer", "format": "int32" }, "author": { "type": "string", "nullable": true }, "folderId": { "type": "integer", "format": "int32", "nullable": true } }, "additionalProperties": false }, "ResultToken": { "type": "object", "properties": { "name": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "allowGet": { "type": "boolean" }, "allowCreate": { "type": "boolean" }, "allowUpdate": { "type": "boolean" }, "allowDelete": { "type": "boolean" }, "allowGetUser": { "type": "boolean" }, "allowCreateFolders": { "type": "boolean" }, "allowDeleteFolders": { "type": "boolean" } }, "additionalProperties": false }, "ResultUser": { "type": "object", "properties": { "username": { "type": "string", "nullable": true } }, "additionalProperties": false }, "Syntax": { "type": "object", "properties": { "name": { "maxLength": 255, "type": "string", "nullable": true }, "displayName": { "maxLength": 255, "type": "string", "nullable": true }, "isHidden": { "type": "boolean" } }, "additionalProperties": false }, "UserFolder": { "type": "object", "properties": { "name": { "type": "string", "nullable": true } }, "additionalProperties": false }, "UserPaste": { "type": "object", "properties": { "title": { "type": "string", "nullable": true }, "syntaxName": { "type": "string", "nullable": true }, "exposureId": { "type": "integer", "format": "int32" }, "content": { "type": "string", "nullable": true }, "folderId": { "type": "integer", "format": "int32", "nullable": true }, "asGuest": { "type": "boolean", "nullable": true } }, "additionalProperties": false } }, "securitySchemes": { "Bearer": { "type": "apiKey", "description": "Authorization header", "name": "Authorization", "in": "header" } } }, "security": [ { "Bearer": [ ] } ] }