terms_of_service/openapi.json

327 строки
12 KiB
JSON

{
"openapi": "3.0.3",
"info": {
"title": "terms_of_service",
"version": "0.0.1",
"description": "Requires users to accept the terms of service before accessing data.",
"license": {
"name": "agpl"
}
},
"components": {
"securitySchemes": {
"basic_auth": {
"type": "http",
"scheme": "basic"
},
"bearer_auth": {
"type": "http",
"scheme": "bearer"
}
},
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode"
],
"properties": {
"status": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"message": {
"type": "string"
},
"totalitems": {
"type": "string"
},
"itemsperpage": {
"type": "string"
}
}
},
"Terms": {
"type": "object",
"required": [
"id",
"countryCode",
"languageCode",
"body",
"renderedBody"
],
"properties": {
"id": {
"type": "integer",
"format": "int64",
"minimum": 1
},
"countryCode": {
"type": "string"
},
"languageCode": {
"type": "string"
},
"body": {
"type": "string",
"minLength": 1
},
"renderedBody": {
"type": "string",
"minLength": 1
}
}
}
}
},
"paths": {
"/ocs/v2.php/apps/terms_of_service/terms": {
"get": {
"operationId": "terms-index",
"summary": "Get all available terms for the current country",
"tags": [
"terms"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Get list successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "object",
"required": [
"terms",
"languages",
"hasSigned"
],
"properties": {
"terms": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Terms"
}
},
"languages": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"hasSigned": {
"type": "boolean"
}
}
}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/apps/terms_of_service/sign": {
"post": {
"operationId": "signing-sign-terms",
"summary": "As a logged in user sign the terms",
"tags": [
"signing"
],
"security": [
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"termId"
],
"properties": {
"termId": {
"type": "integer",
"format": "int64",
"description": "The terms the user signed"
}
}
}
}
}
},
"parameters": [
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Signed successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/apps/terms_of_service/sign_public": {
"post": {
"operationId": "signing-sign-terms-public",
"summary": "As a guest sign the terms",
"tags": [
"signing"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"termId"
],
"properties": {
"termId": {
"type": "integer",
"format": "int64",
"description": "The terms the user signed"
}
}
}
}
}
},
"parameters": [
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Signed successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
}
},
"tags": []
}