View Categories

API Specifications for Module ‘Admins’ v1

Files #

Swagger #

admins_api_v1.0.0.html

json #

admins_api_v1.0.0.json

yaml #

admins_api_v1.0.0.yaml

Source #

json #

{
  "openapi": "3.0.3",
  "info": {
    "title": "NovaFacies Open Source Project - Module 'Admins' v1",
    "description": "API specification for Module 'Admins' in NovaFacies Open Source Project. For more information, see https://novafacies.org",
    "version": "1.0.0",
    "contact": {
      "name": "NovaFacies Open Source Foundation",
      "url": "https://novafacies.org/",
      "email": "[email protected]"
    },
    "license": {
      "name": "GNU GPLv3",
      "url": "https://www.gnu.org/licenses/gpl-3.0.html"
    },
    "x-filename-json": "admins_api_v1.0.0.json",
    "x-filename-yaml": "admins_api_v1.0.0.yaml",
    "x-filename-html": "admins_api_v1.0.0.html"
  },
  "servers": [
    {
      "url": "https://api.admins.novafacies.org/v1",
      "description": "Production server"
    },
    {
      "url": "https://staging.api.admins.novafacies.org/v1",
      "description": "Staging server"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "This API expects a valid JWT Token in the Authorization header. The Authentication mechanism, including Token issuance and validation, is handled by the Auth Module."
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/admins/create": {
      "post": {
        "summary": "Creates a new admin. Reference function with internal name: admins.createAdmin",
        "description": "Creates a new admin and registers them in the Auth Module. Sets the Admin Role = Standard. Reference function with internal name: admins.createAdmin",
        "operationId": "createAdmin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "See Module Description"
                  },
                  "first_name": {
                    "type": "string",
                    "description": "See Module Description"
                  },
                  "last_name": {
                    "type": "string",
                    "description": "See Module Description"
                  }
                },
                "required": [
                  "email",
                  "first_name",
                  "last_name"
                ]
              },
              "examples": {
                "validRequest": {
                  "value": {
                    "email": "[email protected]",
                    "first_name": "John",
                    "last_name": "Doe"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "value": {
                      "status": "success",
                      "admin_id": "123e4567-e89b-12d3-a456-426614174000"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "error",
            "content": {
              "application/json": {
                "examples": {
                  "badRequest": {
                    "value": {
                      "message": "error"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/admins/get": {
      "get": {
        "summary": "Retrieves admin details. Reference function with internal name: admins.getAdmin",
        "description": "Retrieves admin details. Reference function with internal name: admins.getAdmin",
        "operationId": "getAdmin",
        "parameters": [
          {
            "name": "admin_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "See Module Description"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "value": {
                      "status": "success",
                      "admin_id": "123e4567-e89b-12d3-a456-426614174000",
                      "email": "[email protected]",
                      "first_name": "John",
                      "last_name": "Doe"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "error",
            "content": {
              "application/json": {
                "examples": {
                  "badRequest": {
                    "value": {
                      "message": "error"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

yaml #

openapi: 3.0.3
info:
  title: NovaFacies Open Source Project - Module 'Admins' v1
  description: >-
    API specification for Module 'Admins' in NovaFacies Open Source Project. For
    more information, see https://novafacies.org
  version: 1.0.0
  contact:
    name: NovaFacies Open Source Foundation
    url: https://novafacies.org/
    email: [email protected]
  license:
    name: GNU GPLv3
    url: https://www.gnu.org/licenses/gpl-3.0.html
  x-filename-json: admins_api_v1.0.0.json
  x-filename-yaml: admins_api_v1.0.0.yaml
  x-filename-html: admins_api_v1.0.0.html
servers:
  - url: https://api.admins.novafacies.org/v1
    description: Production server
  - url: https://staging.api.admins.novafacies.org/v1
    description: Staging server
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This API expects a valid JWT Token in the Authorization header. The
        Authentication mechanism, including Token issuance and validation, is
        handled by the Auth Module.
security:
  - BearerAuth: []
paths:
  /admins/create:
    post:
      summary: >-
        Creates a new admin. Reference function with internal name:
        admins.createAdmin
      description: >-
        Creates a new admin and registers them in the Auth Module. Sets the
        Admin Role = Standard. Reference function with internal name:
        admins.createAdmin
      operationId: createAdmin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: See Module Description
                first_name:
                  type: string
                  description: See Module Description
                last_name:
                  type: string
                  description: See Module Description
              required:
                - email
                - first_name
                - last_name
            examples:
              validRequest:
                value:
                  email: [email protected]
                  first_name: John
                  last_name: Doe
      responses:
        '200':
          description: success
          content:
            application/json:
              examples:
                success:
                  value:
                    status: success
                    admin_id: 123e4567-e89b-12d3-a456-426614174000
        '400':
          description: error
          content:
            application/json:
              examples:
                badRequest:
                  value:
                    message: error
  /admins/get:
    get:
      summary: >-
        Retrieves admin details. Reference function with internal name:
        admins.getAdmin
      description: >-
        Retrieves admin details. Reference function with internal name:
        admins.getAdmin
      operationId: getAdmin
      parameters:
        - name: admin_id
          in: query
          required: true
          schema:
            type: string
          description: See Module Description
      security:
        - BearerAuth: []
      responses:
        '200':
          description: success
          content:
            application/json:
              examples:
                success:
                  value:
                    status: success
                    admin_id: 123e4567-e89b-12d3-a456-426614174000
                    email: [email protected]
                    first_name: John
                    last_name: Doe
        '400':
          description: error
          content:
            application/json:
              examples:
                badRequest:
                  value:
                    message: error