swagger: "2.0" info: description: "This is the documentation of the Artemis REST API accessible to normal users.\n There are 2 ways of authentication for the API. \n 1. Use the session cookie (get it with /api/auth/login/credentials or /api/auth/login/ldap) \n 2. Store the credentials in the body of each request performed.\n The x-artemis-api-key header is used to circumvent the csrf protection." version: "1.0.0" title: "Artemis Web API" host: "demo.artemis-pc.duckdns.org" # basePath: "/v2" tags: - name: "login" description: "API for credentials and LDAP authentication" - name: "user account" description: "API related to the user's account" - name: "session" description: "API for handling the session state" - name: "data" description: "API for retrieving miscellaneous application data" schemes: - "https" paths: /api/auth/login/credentials: post: tags: - "login" summary: "User logs in with credentials (email/password)." description: "" operationId: "credentials" consumes: - "application/json" produces: - "application/json" parameters: - in: "body" name: "body" required: true schema: $ref: "#/definitions/loginBody" - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "200": description: "successful operation" schema: $ref: "#/definitions/user" /api/auth/login/ldap: post: tags: - "login" summary: "User logs in with her ldap credentials (email/password)." description: "" operationId: "ldap" consumes: - "application/json" produces: - "application/json" parameters: - in: "body" name: "body" required: true schema: $ref: "#/definitions/loginBody" - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "200": description: "successful operation" schema: $ref: "#/definitions/user" /api/auth/logout: delete: tags: - "login" summary: "User logout" description: "" operationId: "logoutp" consumes: - "application/json" produces: - "application/json" parameters: - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "204": description: "User logged out." /api/auth/change-password: put: tags: - "user account" summary: "Change user's password" description: "" operationId: "changePass" consumes: - "application/json" produces: - "application/json" parameters: - in: "body" name: "body" required: true schema: $ref: "#/definitions/passBody" - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "200": description: "Your password has been updated." "300": description: "Old password is wrong or password missmatch." /api/auth/jwt: get: tags: - "session" summary: "Retrieve JWT." description: "" operationId: "jwt" consumes: - "application/json" produces: - "application/json" parameters: - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "200": description: "JWT retrieved." schema: $ref: "#/definitions/jwt" /api/auth/signup: post: tags: - "user account" summary: "Create new account" description: "" operationId: "signup" consumes: - "application/json" produces: - "application/json" parameters: - in: "body" name: "body" required: true schema: $ref: "#/definitions/signupBody" - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "200": description: "user created" "400": description: "missing fields or invalid email." "403": description: "The email has already been used." /api/auth/userinfo: post: tags: - "user account" summary: "Get user information" description: "" operationId: "userifo" consumes: - "application/json" produces: - "application/json" parameters: - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "200": description: "user" schema: $ref: "#/definitions/user" /api/configs: get: tags: - "data" summary: "Get the configuration data" description: "" operationId: "configinfo" consumes: - "application/json" produces: - "application/json" parameters: - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "200": description: "configs" schema: $ref: "#/definitions/configs" /api/download_tables: get: tags: - "data" summary: "Get data for the table described in the action field, in json format" description: "" operationId: "downloadtable" consumes: - "application/json" produces: - "application/json" parameters: - in: "body" name: "body" required: true schema: $ref: "#/definitions/tableBody" - in: header name: x-artemis-api-key type: string format: uuid required: true responses: "200": description: "table" schema: $ref: "#/definitions/table" definitions: loginBody: type: "object" properties: email: type: "string" password: type: "string" rememberMe: type: "boolean" signupBody: type: "object" properties: email: type: "string" password: type: "string" name: type: "string" tableBody: type: "object" properties: action: type: "string" parameters: type: "string" jwt: type: "object" properties: accessToken: type: "string" passBody: type: "object" properties: old_password: type: "string" new_password: type: "string" user: type: "object" properties: user: type: "object" properties: _id: type: "string" name: type: "string" email: type: "string" role: type: "string" lastLogin: type: "string" configs: type: "object" properties: configs: type: "array" items: type: object properties: raw_config: type: "string" comment: type: "string" time_modified: type: "string" table: type: "array" items: type: object