{ "swagger": "2.0", "info": { "description": "Account service for EasyStartup.", "title": "EasyStartup Account", "contact": { "name": "API Support", "email": "red.tea.dev@gmail.com" }, "version": "1.0" }, "host": "account.easystartup.su", "basePath": "/api", "paths": { "/api/account": { "get": { "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Get account information", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.accountResponce" } } } }, "post": { "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Set account information", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true }, { "description": "account info", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.accountInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.accountInput" } } } } }, "/api/account/:id": { "get": { "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Get account information by id", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true }, { "type": "integer", "description": "account id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.accountResponce" } } } } }, "/api/account/picture": { "post": { "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Get account information", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true }, { "type": "file", "description": "Picture", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK" } } } }, "/api/account/{id}": { "post": { "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Set account information by id", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true }, { "description": "account info", "name": "account", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.accountResponce" } }, { "type": "integer", "description": "account id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handler.accountResponce" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "account" ], "summary": "Delete account by id", "parameters": [ { "type": "integer", "description": "id of user", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true } ], "responses": { "200": { "description": "OK" } } } }, "/api/confidential/": { "get": { "produces": [ "application/json" ], "tags": [ "confidential" ], "summary": "Get all confidential settings", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true } ], "responses": { "200": { "description": "OK" } } }, "post": { "produces": [ "application/json" ], "tags": [ "confidential" ], "summary": "Set confidential settings", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true }, { "description": "Confidencial settings", "name": "confidencial", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/esaccount.AuthorizedUser" } } } } }, "/api/confidential/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "confidential" ], "summary": "Get all confidential settings by id", "parameters": [ { "type": "integer", "description": "id of user", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true } ], "responses": { "200": { "description": "OK" } } }, "post": { "produces": [ "application/json" ], "tags": [ "confidential" ], "summary": "Set confidential settings by id", "parameters": [ { "type": "integer", "description": "id of user", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true }, { "description": "Confidencial settings", "name": "confidencial", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/esaccount.AuthorizedUser" } } } } }, "/api/following/follow/{id}": { "put": { "produces": [ "application/json" ], "tags": [ "following" ], "summary": "Follow to user", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true } ], "responses": { "200": { "description": "OK" } } } }, "/api/following/unfollow/{id}": { "put": { "produces": [ "application/json" ], "tags": [ "following" ], "summary": "Unfollow user", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header", "required": true } ], "responses": { "200": { "description": "OK" } } } }, "/api/public/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "confidential" ], "summary": "Get all public data of users", "parameters": [ { "type": "string", "description": "JWT Bearer token (authorization)", "name": "Authorization", "in": "header" }, { "type": "integer", "description": "user id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK" } } } } }, "definitions": { "esaccount.AuthorizedUser": { "type": "object", "properties": { "access": { "type": "string" }, "email": { "type": "string" }, "first_name": { "type": "string" }, "google_id": { "type": "string" }, "id": { "type": "integer" }, "last_name": { "type": "string" }, "picture_url": { "type": "string" }, "telegram_id": { "type": "string" }, "username": { "type": "string" } } }, "handler.accountInput": { "type": "object", "properties": { "date_of_birth": { "type": "string" }, "description": { "type": "string" } } }, "handler.accountResponce": { "type": "object", "properties": { "date_of_birth": { "type": "string" }, "description": { "type": "string" }, "followers": { "type": "array", "items": { "type": "integer" } }, "follows": { "type": "array", "items": { "type": "integer" } } } } } }