{
  "x-generator": "NSwag v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))",
  "swagger": "2.0",
  "info": {
    "title": "Trackspot API",
    "description": "Verbinden Sie Ihre Ger�te mit der Trackspot API",
    "termsOfService": "https://welcome.trackspot.de/en/terms-of-use/",
    "contact": {
      "name": "Trackspot",
      "url": "https://www.trackspot.de",
      "email": "info@trackspot.de"
    },
    "version": "v1"
  },
  "host": "trackspot.biz",
  "schemes": [
    "https"
  ],
  "produces": [
    "text/plain",
    "application/json",
    "text/json"
  ],
  "paths": {
    "/api/Area/{areaId}/count": {
      "get": {
        "tags": [
          "Area"
        ],
        "summary": "The area person count.",
        "operationId": "Area_GetCount",
        "parameters": [
          {
            "type": "string",
            "name": "areaId",
            "in": "path",
            "required": true,
            "description": "The area Guid.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The amount of persons currently in the area.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/Area/{areaId}/closed": {
      "get": {
        "tags": [
          "Area"
        ],
        "summary": "The area closed state.",
        "operationId": "Area_GetAreaIsClosed",
        "parameters": [
          {
            "type": "string",
            "name": "areaId",
            "in": "path",
            "required": true,
            "description": "The area Guid.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "True if the area is closed.",
            "schema": {
              "type": "boolean"
            }
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/Area/{areaId}": {
      "get": {
        "tags": [
          "Area"
        ],
        "summary": "The area informations.",
        "operationId": "Area_GetAreaInfo",
        "parameters": [
          {
            "type": "string",
            "name": "areaId",
            "in": "path",
            "required": true,
            "description": "The area Guid.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The area is available.",
            "schema": {
              "$ref": "#/definitions/AreaInfo"
            }
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/HealthCare/{dashboardIdentifier}/can-enter": {
      "get": {
        "tags": [
          "HealthCare"
        ],
        "summary": "Receive information, if passage is possible.",
        "operationId": "HealthCare_IsEntryAllowed",
        "parameters": [
          {
            "type": "string",
            "name": "dashboardIdentifier",
            "in": "path",
            "required": true,
            "description": "The identifier, that has been created for the dashboard.",
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "count",
            "in": "query",
            "description": "The amount of people, who like to enter.",
            "format": "int32",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The status of the dashboard was evaluated with success.",
            "schema": {
              "type": "boolean"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/HealthCare/{dashboardIdentifier}/space": {
      "get": {
        "tags": [
          "HealthCare"
        ],
        "summary": "Receive currently available space.",
        "operationId": "HealthCare_GetSpace",
        "parameters": [
          {
            "type": "string",
            "name": "dashboardIdentifier",
            "in": "path",
            "required": true,
            "description": "The identifier, that has been created for the dashboard.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The space of given dashboard.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/HealthCare/{dashboardIdentifier}/capacity": {
      "get": {
        "tags": [
          "HealthCare"
        ],
        "summary": "Receive capacity information.",
        "operationId": "HealthCare_GetCapacity",
        "parameters": [
          {
            "type": "string",
            "name": "dashboardIdentifier",
            "in": "path",
            "required": true,
            "description": "The identifier, that has been created for the dashboard.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The status of the dashboard was evaluated with success.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/HealthCare/{dashboardIdentifier}/warning": {
      "get": {
        "tags": [
          "HealthCare"
        ],
        "summary": "Receive warning value which indicates that capacity is almost reached.",
        "operationId": "HealthCare_GetWarning",
        "parameters": [
          {
            "type": "string",
            "name": "dashboardIdentifier",
            "in": "path",
            "required": true,
            "description": "The identifier, that has been created for the dashboard.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The warning value of the dashboard.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/HealthCare/{dashboardIdentifier}": {
      "get": {
        "tags": [
          "HealthCare"
        ],
        "summary": "Receive dashboard informations.",
        "operationId": "HealthCare_GetDashboardInfo",
        "parameters": [
          {
            "type": "string",
            "name": "dashboardIdentifier",
            "in": "path",
            "required": true,
            "description": "The identifier, that has been created for the dashboard.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The dashboard informations as json.",
            "schema": {
              "$ref": "#/definitions/DashboardInfo"
            }
          },
          "400": {
            "x-nullable": false,
            "description": "The dashboardIdentifier is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/Transit/{transitionIdentifier}/event": {
      "post": {
        "tags": [
          "Transit"
        ],
        "summary": "Post a count event to Trackspot.",
        "operationId": "Transit_PostEntry",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "transitionIdentifier",
            "in": "path",
            "required": true,
            "description": "The identifier, that has been created for the transition.",
            "x-nullable": false
          },
          {
            "name": "countEvent",
            "in": "body",
            "required": true,
            "description": "The count event data.",
            "schema": {
              "$ref": "#/definitions/CountEvent"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "description": "The event was posted with success."
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Write"
            ]
          }
        ]
      }
    },
    "/api/Transit/{transitId}/closed": {
      "get": {
        "tags": [
          "Transit"
        ],
        "summary": "The transit closed state.",
        "operationId": "Transit_GetTransitIsClosed",
        "parameters": [
          {
            "type": "string",
            "name": "transitId",
            "in": "path",
            "required": true,
            "description": "The transit Guid.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "True if the transit is closed.",
            "schema": {
              "type": "boolean"
            }
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token key is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/Identity/token": {
      "get": {
        "tags": [
          "Identity"
        ],
        "summary": "Returns a JWT session token which is valid for 24 hours.\nEnables Revoking a token by checking if the main JWT is available in the database before creating a JWT session token.",
        "operationId": "Identity_GetToken",
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The token was created.",
            "schema": {
              "type": "string"
            }
          },
          "204": {
            "description": "The session token token was not created. The given token was not found in the database."
          },
          "401": {
            "x-nullable": false,
            "description": "The token is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "402": {
            "x-nullable": false,
            "description": "The bearer token is missing.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "423": {
            "x-nullable": false,
            "description": "A new session token can only be created every 2 minutes.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Credentials"
            ]
          }
        ]
      }
    },
    "/api/Identity/test/read": {
      "get": {
        "tags": [
          "Identity"
        ],
        "summary": "Receive information, if reading is possible.",
        "operationId": "Identity_CanRead",
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The token is able to read.",
            "schema": {
              "type": "boolean"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Read"
            ]
          }
        ]
      }
    },
    "/api/Identity/test/write": {
      "post": {
        "tags": [
          "Identity"
        ],
        "summary": "Receive information, if writing is possible.",
        "operationId": "Identity_CanWrite",
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The token is able to write.",
            "schema": {
              "type": "boolean"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "The token is invalid.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "403": {
            "x-nullable": false,
            "description": "The token roles are insufficient.",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        },
        "security": [
          {
            "Bearer": [
              "Write"
            ]
          }
        ]
      }
    }
  },
  "definitions": {
    "ProblemDetails": {
      "type": "object",
      "additionalProperties": {},
      "properties": {
        "type": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer",
          "format": "int32"
        },
        "detail": {
          "type": "string"
        },
        "instance": {
          "type": "string"
        }
      }
    },
    "AreaInfo": {
      "type": "object",
      "required": [
        "count",
        "isClosed"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "count": {
          "type": "integer",
          "format": "int32"
        },
        "isClosed": {
          "type": "boolean"
        },
        "transits": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TransitInfo"
          }
        }
      }
    },
    "TransitInfo": {
      "type": "object",
      "required": [
        "id",
        "isClosed"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "isClosed": {
          "type": "boolean"
        }
      }
    },
    "DashboardInfo": {
      "type": "object",
      "required": [
        "canEnter",
        "space",
        "capacity",
        "warning",
        "count"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "canEnter": {
          "type": "boolean"
        },
        "space": {
          "type": "integer",
          "format": "int32"
        },
        "capacity": {
          "type": "integer",
          "format": "int32"
        },
        "warning": {
          "type": "integer",
          "format": "int32"
        },
        "count": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "CountEvent": {
      "type": "object",
      "required": [
        "timeStamp",
        "direction",
        "count",
        "countReference"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "timeStamp": {
          "type": "string",
          "format": "date-time"
        },
        "direction": {
          "$ref": "#/definitions/CounterDirection"
        },
        "count": {
          "type": "integer"
        },
        "countReference": {
          "$ref": "#/definitions/CountReference"
        }
      }
    },
    "CounterDirection": {
      "type": "integer",
      "description": "",
      "x-enumNames": [
        "Forward",
        "Backward",
        "Neutral"
      ],
      "enum": [
        0,
        1,
        2
      ]
    },
    "CountReference": {
      "type": "integer",
      "description": "",
      "x-enumNames": [
        "Relative",
        "Absolute"
      ],
      "enum": [
        0,
        1
      ]
    }
  },
  "securityDefinitions": {
    "Bearer": {
      "type": "apiKey",
      "description": "Use in header with: Bearer {token}",
      "name": "Authorization",
      "in": "header"
    }
  }
}