View Issue Details

IDProjectCategoryView StatusLast Update
0025229mantisbtapi restpublic2022-08-22 12:01
Reporterrombert Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2.19.0 
Summary0025229: swagger.json does not document /project functions
Description

Projects can now be managed through the REST API ( 0024622, 0024636, 0024624 ) but this is not reflected in the swagger docs.

TagsNo tags attached.

Relationships

related to 0030908 closedvboctor Update postman collection 

Activities

gthomas

gthomas

2022-08-15 04:39

reporter   ~0066890

And as I see, /issues/:issue_id/files and /issues/:issue_id/notes is missing, too.
Shall I open a spearate issue for them?

gthomas

gthomas

2022-08-15 06:09

reporter   ~0066891

swagger.json (16,445 bytes)   
{
  "swagger": "2.0",
  "info": {
    "title": "MantisBT REST API",
    "description": "For the sandbox to work, MantisBT must be hosted at the root folder of the host. For example: http://mantishost/ rather http://host/mantisbt.  If that is not the case, then create a host alias to map it as such or edit swagger.json to change basePath to include the mantisbt folder name.",
    "version": "1.0.0"
  },
  "schemes": [
    "http",
    "https"
  ],
  "produces": [
    "application/json"
  ],
  "basePath": "/api/rest",
  "paths": {
    "/issues": {
      "get": {
        "summary": "Get issue details",
        "tags": [
          "Issues"
        ],
        "operationId": "issueGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "200": {
            "description": "Success with issue details",
            "schema": {
              "$ref": "#/definitions/CreateIssueResponse"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "post": {
        "summary": "Create an issue",
        "tags": [
          "Issues"
        ],
        "operationId": "issueAdd",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "The issue to add.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Issue"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Issue successfully created"
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "delete": {
        "summary": "Delete an issue",
        "tags": [
          "Issues"
        ],
        "operationId": "issueDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "204": {
            "description": "Issue deleted successfully"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Issue doesn't exist"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/issues/:id/notes": {
      "get": {
        "summary": "Get note details",
        "tags": [
          "Issues",
          "Notes"
        ],
        "operationId": "issueNoteGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "note_id",
            "in": "query",
            "description": "The note id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "200": {
            "description": "Success with note details",
            "schema": {
              "$ref": "#/definitions/Note"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "delete": {
        "summary": "Delete a note",
        "tags": [
          "Issues",
          "Notes"
        ],
        "operationId": "issueNoteDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "note_id",
            "in": "query",
            "description": "The note id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "204": {
            "description": "Note deleted successfully"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Issue or note doesn't exist"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "post": {
        "summary": "Create a note",
        "tags": [
          "Issues",
          "Notes"
        ],
        "operationId": "issueNoteAdd",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "The note to add.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateNoteResponse"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Note successfully created"
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/issues/:id/files": {
      "get": {
        "summary": "Get file details",
        "tags": [
          "Issues",
          "Files"
        ],
        "operationId": "issueFileGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "file_id",
            "in": "query",
            "description": "The file id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "200": {
            "description": "Success with file details",
            "schema": {
              "$ref": "#/definitions/FileRef"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "delete": {
        "summary": "Delete a file",
        "tags": [
          "Issues",
          "Files"
        ],
        "operationId": "issueFileDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "file_id",
            "in": "query",
            "description": "The file id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "204": {
            "description": "File deleted successfully"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Issue or file doesn't exist"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/config": {
      "get": {
        "summary": "Get config options",
        "description": "Get the value for a set of configuration options given a user and project context.  If a configuration option is invalid or is marked as private, then they will be filtered out, but request will still succeed.",
        "tags": [
          "Config"
        ],
        "operationId": "configGet",
        "parameters": [
          {
            "name": "option",
            "in": "query",
            "description": "An array of configuration options.",
            "required": true,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "The project id (default All Projects).",
            "required": false,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "user_id",
            "in": "query",
            "description": "The user id (default is logged in user).  This can only be set by users with access level ADMINISTRATOR.",
            "required": false,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/ConfigGetResponse"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "User or Project not found"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/lang": {
      "get": {
        "summary": "Get localized strings",
        "description": "Gets a set of localized strings in context of the logged in user's language.  If a localized string is not defined, then it will be filtered out.",
        "tags": [
          "Localization"
        ],
        "operationId": "langGet",
        "parameters": [
          {
            "name": "string",
            "in": "query",
            "description": "An array of localized labels given their name string lang/strings_english.txt folder in MantisBT.  The name doesn't include $s_ prefix.",
            "required": true,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/LangGetResponse"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/users/me": {
      "get": {
        "summary": "Get information about logged in user",
        "description": "Gets information about logged in user.",
        "tags": [
          "Users"
        ],
        "operationId": "userGetMe",
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/UserMeResponse"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/users/reset": {
      "put": {
        "summary": "Reset user's password",
        "description": "Reset the user's password",
        "tags": [
          "Users"
        ],
        "operationId": "userResetPassword",
        "responses": {
          "200": {
            "description": "Success"
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "securityDefinitions": {
    "Authorization": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  },
  "definitions": {
    "Issue": {
      "type": "object",
      "required": [
        "summary",
        "description"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "summary": {
          "type": "string"
        },
        "reporter": {
          "$ref": "#/definitions/AccountRef"
        },
        "handler": {
          "$ref": "#/definitions/AccountRef"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "Note": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "reporter": {
          "$ref": "#/definitions/AccountRef"
        },
        "text": {
          "type": "string"
        },
        "view_state": {
          "$ref": "#/definitions/ViewStateRef"
        },
        "time_tracking": {
          "$ref": "#/definitions/TimeTrackingRef"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileRef"
          }
        },
        "type": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "dateTime"
        },
        "updated_at": {
          "type": "string",
          "format": "dateTime"
        }
      }
    },
    "FileRef": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "content": {
          "type": "string",
          "format": "byte"
        }
      }
    },
    "TimeTrackingRef": {
      "type": "object",
      "properties": {
        "duration": {
          "type": "string"
        }
      }
    },
    "ViewStateRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      }
    },
    "AccountRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "realname": {
          "type": "string"
        }
      }
    },
    "ProjectRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        }
      }
    },
    "EnumRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "UserMeResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "access_level": {
          "$ref": "#/definitions/EnumRef"
        },
        "projects": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProjectRef"
          }
        }
      }
    },
    "ConfigGetResponse": {
      "type": "object",
      "properties": {
        "configs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ConfigOption"
          }
        }
      }
    },
    "ConfigOption": {
      "type": "object",
      "properties": {
        "option": {
          "type": "string"
        },
        "value": {}
      }
    },
    "LangGetResponse": {
      "type": "object",
      "properties": {
        "language": {
          "type": "string"
        },
        "strings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LocalizedString"
          }
        }
      }
    },
    "LocalizedString": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "localized": {
          "type": "string"
        }
      }
    },
    "CreateIssueResponse": {
      "type": "object",
      "properties": {
        "issues": {
          "$ref": "#/definitions/Issue"
        }
      }
    },
    "CreateNoteResponse": {
      "type": "object",
      "properties": {
        "issue": {
          "$ref": "#/definitions/Issue"
        },
        "note": {
          "$ref": "#/definitions/Note"
        }
      }
    }
  }
}
swagger.json (16,445 bytes)   
gthomas

gthomas

2022-08-22 06:34

reporter   ~0066930

openapi_3.json (20,865 bytes)   
{
  "openapi": "3.0.1",
  "info": {
    "title": "MantisBT REST API",
    "description": "For the sandbox to work, MantisBT must be hosted at the root folder of the host. For example: http://mantishost/ rather http://host/mantisbt.  If that is not the case, then create a host alias to map it as such or edit swagger.json to change basePath to include the mantisbt folder name.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/api/rest"
    }
  ],
  "security": [
    {
      "Authorization": []
    }
  ],
  "paths": {
    "/issues": {
      "get": {
        "tags": [
          "Issues"
        ],
        "summary": "Get issue details",
        "operationId": "issueGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success with issue details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateIssueResponse"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Issues"
        ],
        "summary": "Create an issue",
        "operationId": "issueAdd",
        "requestBody": {
          "description": "The issue to add.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Issue"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Issue successfully created",
            "content": {}
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      },
      "delete": {
        "tags": [
          "Issues"
        ],
        "summary": "Delete an issue",
        "operationId": "issueDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Issue deleted successfully",
            "content": {}
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "404": {
            "description": "Issue doesn't exist",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      }
    },
    "/issues/:id/notes": {
      "get": {
        "tags": [
          "Issues",
          "Notes"
        ],
        "summary": "Get note details",
        "operationId": "issueNoteGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          },
          {
            "name": "note_id",
            "in": "query",
            "description": "The note id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success with note details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Issues",
          "Notes"
        ],
        "summary": "Create a note",
        "operationId": "issueNoteAdd",
        "requestBody": {
          "description": "The note to add.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateNoteResponse"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Note successfully created",
            "content": {}
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "body"
      },
      "delete": {
        "tags": [
          "Issues",
          "Notes"
        ],
        "summary": "Delete a note",
        "operationId": "issueNoteDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          },
          {
            "name": "note_id",
            "in": "query",
            "description": "The note id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Note deleted successfully",
            "content": {}
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "404": {
            "description": "Issue or note doesn't exist",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      }
    },
    "/issues/:id/files": {
      "get": {
        "tags": [
          "Issues",
          "Files"
        ],
        "summary": "Get file details",
        "operationId": "issueFileGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          },
          {
            "name": "file_id",
            "in": "query",
            "description": "The file id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success with file details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileRef"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      },
      "post": {
        "tags": [
          "Issues",
          "Files"
        ],
        "summary": "Attach a file to an issue",
        "operationId": "issueAddFile",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue to attach to.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddFileRequest"
                }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "File successfully attached",
            "content": {}
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "files"
      },
      "delete": {
        "tags": [
          "Issues",
          "Files"
        ],
        "summary": "Delete a file",
        "operationId": "issueFileDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          },
          {
            "name": "file_id",
            "in": "query",
            "description": "The file id.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "File deleted successfully",
            "content": {}
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "404": {
            "description": "Issue or file doesn't exist",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      }
    },
    "/config": {
      "get": {
        "tags": [
          "Config"
        ],
        "summary": "Get config options",
        "description": "Get the value for a set of configuration options given a user and project context.  If a configuration option is invalid or is marked as private, then they will be filtered out, but request will still succeed.",
        "operationId": "configGet",
        "parameters": [
          {
            "name": "option",
            "in": "query",
            "description": "An array of configuration options.",
            "required": true,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "The project id (default All Projects).",
            "schema": {
              "type": "number",
              "format": "int64"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "description": "The user id (default is logged in user).  This can only be set by users with access level ADMINISTRATOR.",
            "schema": {
              "type": "number",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigGetResponse"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "404": {
            "description": "User or Project not found",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      }
    },
    "/lang": {
      "get": {
        "tags": [
          "Localization"
        ],
        "summary": "Get localized strings",
        "description": "Gets a set of localized strings in context of the logged in user's language.  If a localized string is not defined, then it will be filtered out.",
        "operationId": "langGet",
        "parameters": [
          {
            "name": "string",
            "in": "query",
            "description": "An array of localized labels given their name string lang/strings_english.txt folder in MantisBT.  The name doesn't include $s_ prefix.",
            "required": true,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LangGetResponse"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      }
    },
    "/users/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get information about logged in user",
        "description": "Gets information about logged in user.",
        "operationId": "userGetMe",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserMeResponse"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      }
    },
    "/users/reset": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Reset user's password",
        "description": "Reset the user's password",
        "operationId": "userResetPassword",
        "responses": {
          "200": {
            "description": "Success",
            "content": {}
          },
          "403": {
            "description": "Access denied",
            "content": {}
          },
          "503": {
            "description": "Mantis Offline",
            "content": {}
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Issue": {
        "required": [
          "description",
          "summary"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "summary": {
            "type": "string"
          },
          "reporter": {
            "$ref": "#/components/schemas/AccountRef"
          },
          "handler": {
            "$ref": "#/components/schemas/AccountRef"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Note": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "reporter": {
            "$ref": "#/components/schemas/AccountRef"
          },
          "text": {
            "type": "string"
          },
          "view_state": {
            "$ref": "#/components/schemas/ViewStateRef"
          },
          "time_tracking": {
            "$ref": "#/components/schemas/TimeTrackingRef"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileRef"
            }
          },
          "type": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "dateTime"
          },
          "updated_at": {
            "type": "string",
            "format": "dateTime"
          }
        }
      },
      "FileRef": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "content": {
            "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
            "type": "string",
            "format": "byte"
          }
        }
      },
      "TimeTrackingRef": {
        "type": "object",
        "properties": {
          "duration": {
            "type": "string"
          }
        }
      },
      "ViewStateRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "AccountRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "realname": {
            "type": "string"
          }
        }
      },
      "ProjectRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "EnumRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UserMeResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "access_level": {
            "$ref": "#/components/schemas/EnumRef"
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectRef"
            }
          }
        }
      },
      "ConfigGetResponse": {
        "type": "object",
        "properties": {
          "configs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigOption"
            }
          }
        }
      },
      "ConfigOption": {
        "type": "object",
        "properties": {
          "option": {
            "type": "string"
          },
          "value": {
            "type": "object"
          }
        }
      },
      "LangGetResponse": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string"
          },
          "strings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocalizedString"
            }
          }
        }
      },
      "LocalizedString": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "localized": {
            "type": "string"
          }
        }
      },
      "CreateIssueResponse": {
        "type": "object",
        "properties": {
          "issues": {
            "$ref": "#/components/schemas/Issue"
          }
        }
      },
      "CreateNoteResponse": {
        "type": "object",
        "properties": {
          "issue": {
            "$ref": "#/components/schemas/Issue"
          },
          "note": {
            "$ref": "#/components/schemas/Note"
          }
        }
      },
      "AddFileRequest": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileRef"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "Authorization": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    }
  }
}
openapi_3.json (20,865 bytes)   
swagger-20220822.json (17,388 bytes)   
{
  "swagger": "2.0",
  "info": {
    "title": "MantisBT REST API",
    "description": "For the sandbox to work, MantisBT must be hosted at the root folder of the host. For example: http://mantishost/ rather http://host/mantisbt.  If that is not the case, then create a host alias to map it as such or edit swagger.json to change basePath to include the mantisbt folder name.",
    "version": "1.0.0"
  },
  "schemes": [
    "http",
    "https"
  ],
  "produces": [
    "application/json"
  ],
  "basePath": "/api/rest",
  "paths": {
    "/issues": {
      "get": {
        "summary": "Get issue details",
        "tags": [
          "Issues"
        ],
        "operationId": "issueGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "200": {
            "description": "Success with issue details",
            "schema": {
              "$ref": "#/definitions/CreateIssueResponse"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "post": {
        "summary": "Create an issue",
        "tags": [
          "Issues"
        ],
        "operationId": "issueAdd",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "The issue to add.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Issue"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Issue successfully created"
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "delete": {
        "summary": "Delete an issue",
        "tags": [
          "Issues"
        ],
        "operationId": "issueDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "204": {
            "description": "Issue deleted successfully"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Issue doesn't exist"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/issues/:id/notes": {
      "get": {
        "summary": "Get note details",
        "tags": [
          "Issues",
          "Notes"
        ],
        "operationId": "issueNoteGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "note_id",
            "in": "query",
            "description": "The note id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "200": {
            "description": "Success with note details",
            "schema": {
              "$ref": "#/definitions/Note"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "delete": {
        "summary": "Delete a note",
        "tags": [
          "Issues",
          "Notes"
        ],
        "operationId": "issueNoteDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "note_id",
            "in": "query",
            "description": "The note id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "204": {
            "description": "Note deleted successfully"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Issue or note doesn't exist"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "post": {
        "summary": "Create a note",
        "tags": [
          "Issues",
          "Notes"
        ],
        "operationId": "issueNoteAdd",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "The note to add.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateNoteResponse"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Note successfully created"
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/issues/:id/files": {
      "get": {
        "summary": "Get file details",
        "tags": [
          "Issues",
          "Files"
        ],
        "operationId": "issueFileGet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "file_id",
            "in": "query",
            "description": "The file id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "200": {
            "description": "Success with file details",
            "schema": {
              "$ref": "#/definitions/FileRef"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "post": {
        "summary": "Attach a file to an issue",
        "tags": [
          "Issues",
          "Files"
        ],
        "operationId": "issueAddFile",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue to attach to.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
              "name": "files",
              "in": "body",
              "required": true,
              "type": "array",
              "items": {
                "$ref": "#/definitions/FileRef"
              }
          }
        ],
        "responses": {
          "201": {
            "description": "File successfully attached"
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      },
      "delete": {
        "summary": "Delete a file",
        "tags": [
          "Issues",
          "Files"
        ],
        "operationId": "issueFileDelete",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "The issue id.",
            "required": true,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "file_id",
            "in": "query",
            "description": "The file id.",
            "required": true,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "204": {
            "description": "File deleted successfully"
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "Issue or file doesn't exist"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/config": {
      "get": {
        "summary": "Get config options",
        "description": "Get the value for a set of configuration options given a user and project context.  If a configuration option is invalid or is marked as private, then they will be filtered out, but request will still succeed.",
        "tags": [
          "Config"
        ],
        "operationId": "configGet",
        "parameters": [
          {
            "name": "option",
            "in": "query",
            "description": "An array of configuration options.",
            "required": true,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "The project id (default All Projects).",
            "required": false,
            "type": "number",
            "format": "int64"
          },
          {
            "name": "user_id",
            "in": "query",
            "description": "The user id (default is logged in user).  This can only be set by users with access level ADMINISTRATOR.",
            "required": false,
            "type": "number",
            "format": "int64"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/ConfigGetResponse"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "404": {
            "description": "User or Project not found"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/lang": {
      "get": {
        "summary": "Get localized strings",
        "description": "Gets a set of localized strings in context of the logged in user's language.  If a localized string is not defined, then it will be filtered out.",
        "tags": [
          "Localization"
        ],
        "operationId": "langGet",
        "parameters": [
          {
            "name": "string",
            "in": "query",
            "description": "An array of localized labels given their name string lang/strings_english.txt folder in MantisBT.  The name doesn't include $s_ prefix.",
            "required": true,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/LangGetResponse"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/users/me": {
      "get": {
        "summary": "Get information about logged in user",
        "description": "Gets information about logged in user.",
        "tags": [
          "Users"
        ],
        "operationId": "userGetMe",
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/UserMeResponse"
            }
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    },
    "/users/reset": {
      "put": {
        "summary": "Reset user's password",
        "description": "Reset the user's password",
        "tags": [
          "Users"
        ],
        "operationId": "userResetPassword",
        "responses": {
          "200": {
            "description": "Success"
          },
          "403": {
            "description": "Access denied"
          },
          "503": {
            "description": "Mantis Offline"
          }
        }
      }
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "securityDefinitions": {
    "Authorization": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  },
  "definitions": {
    "Issue": {
      "type": "object",
      "required": [
        "summary",
        "description"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "summary": {
          "type": "string"
        },
        "reporter": {
          "$ref": "#/definitions/AccountRef"
        },
        "handler": {
          "$ref": "#/definitions/AccountRef"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "Note": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "reporter": {
          "$ref": "#/definitions/AccountRef"
        },
        "text": {
          "type": "string"
        },
        "view_state": {
          "$ref": "#/definitions/ViewStateRef"
        },
        "time_tracking": {
          "$ref": "#/definitions/TimeTrackingRef"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileRef"
          }
        },
        "type": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "dateTime"
        },
        "updated_at": {
          "type": "string",
          "format": "dateTime"
        }
      }
    },
    "FileRef": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "content": {
          "type": "string",
          "format": "byte"
        }
      }
    },
    "TimeTrackingRef": {
      "type": "object",
      "properties": {
        "duration": {
          "type": "string"
        }
      }
    },
    "ViewStateRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      }
    },
    "AccountRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "realname": {
          "type": "string"
        }
      }
    },
    "ProjectRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        }
      }
    },
    "EnumRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "UserMeResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "access_level": {
          "$ref": "#/definitions/EnumRef"
        },
        "projects": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProjectRef"
          }
        }
      }
    },
    "ConfigGetResponse": {
      "type": "object",
      "properties": {
        "configs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ConfigOption"
          }
        }
      }
    },
    "ConfigOption": {
      "type": "object",
      "properties": {
        "option": {
          "type": "string"
        },
        "value": {}
      }
    },
    "LangGetResponse": {
      "type": "object",
      "properties": {
        "language": {
          "type": "string"
        },
        "strings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LocalizedString"
          }
        }
      }
    },
    "LocalizedString": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "localized": {
          "type": "string"
        }
      }
    },
    "CreateIssueResponse": {
      "type": "object",
      "properties": {
        "issues": {
          "$ref": "#/definitions/Issue"
        }
      }
    },
    "CreateNoteResponse": {
      "type": "object",
      "properties": {
        "issue": {
          "$ref": "#/definitions/Issue"
        },
        "note": {
          "$ref": "#/definitions/Note"
        }
      }
    }
  }
}
swagger-20220822.json (17,388 bytes)   
dregad

dregad

2022-08-22 12:01

developer   ~0066931

@vboctor you may want to take a look at this while you're on 0030908, and maybe include the proposed changes in your PR https://github.com/mantisbt/mantisbt/pull/1844