{
  "swagger": "2.0",
  "info": {
    "version": "1.0.0",
    "title": "BMW CarData API Specification"
  },
  "host": "api.bmwgroup.com",
  "tags": [
    {
      "name": "BMW CarData API (v1)",
      "description": "use these methods for productive calls"
    }
  ],
  "schemes": [
    "https"
  ],
  "securityDefinitions": {
    "API Key": {
      "description": "API Key",
      "type": "apiKey",
      "in": "header",
      "name": "KeyId"
    }
  },
  "security": [
    {
      "API Key": []
    }
  ],
  "paths": {
    "/otpclearance/api/thirdparty/v1/applications/containers/{containerId}/vehicles/{vin17}/clearances": {
      "post": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Create a data access clearance request",
        "description": "Creates a data access clearance request for the given container and vin.",
        "operationId": "createDataAccessClearanceRequestForVin",
        "produces": [
          "application/json",
          "application/xml"
        ],
        "parameters": [
          {
            "name": "containerId",
            "in": "path",
            "description": "The business id of the container.",
            "required": true,
            "type": "string"
          },
          {
            "name": "vin17",
            "in": "path",
            "description": "The 17-digit vehicle identification.",
            "required": true,
            "type": "string"
          },
          {
            "in": "body",
            "name": "body",
            "description": "The request body.",
            "required": false,
            "schema": {
              "$ref": "#/definitions/ClearanceDataRequestDO"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The request was created.",
            "schema": {
              "$ref": "#/definitions/DataAccessClearanceRequestDO"
            }
          },
          "400": {
            "description": "The value of the correlation ID must not exceed 100 characters ",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "No permission for parameter/body. Details in payload.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "An entity was not found. Details in payload.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpclearance/api/thirdparty/v1/applications/containers/{containerId}/vehicles/{vin17}/clearances/consent": {
      "post": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Create a data access clearance request",
        "description": "Creates a data access clearance request for the given container and vin via the consent portal.",
        "operationId": "createDataAccessClearanceRequestForVinConsent",
        "produces": [
          "application/json",
          "application/xml"
        ],
        "parameters": [
          {
            "name": "containerId",
            "in": "path",
            "description": "The business id of the container.",
            "required": true,
            "type": "string"
          },
          {
            "name": "vin17",
            "in": "path",
            "description": "The 17-digit vehicle identification.",
            "required": true,
            "type": "string"
          },
          {
            "name": "useFallback",
            "in": "query",
            "description": "useFallback",
            "required": false,
            "type": "boolean",
            "default": "true",
            "allowEmptyValue": false
          },
          {
            "in": "body",
            "name": "body",
            "description": "The request body.",
            "required": false,
            "schema": {
              "$ref": "#/definitions/ClearanceDataRequestDO"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The request was created.",
            "schema": {
              "$ref": "#/definitions/DataAccessClearanceRequestDO"
            }
          },
          "400": {
            "description": "The value of the correlation ID must not exceed 100 characters ",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "No permission for parameter/body. Details in payload.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "An entity was not found. Details in payload.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpclearance/api/thirdparty/v1/applications/clearances/{clearanceId}": {
      "delete": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Delete a specific clearance",
        "description": "This method is called by the 3rdParty to delete a specific clearance.",
        "operationId": "deleteDataAccessClearance",
        "produces": [
          "application/json",
          "application/xml"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The business id of the clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "The data access clearance was successfully deleted."
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Forbidden! No permission for specified 'clearanceId'.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "412": {
            "description": "Change state is not allowed for the provided clearance.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "422": {
            "description": "Invalid clearance access.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      },
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Request clearance status a specific clearance",
        "description": "Method to request the current status of a specific clearance.",
        "operationId": "getClearanceStatus",
        "produces": [
          "application/json",
          "application/xml"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The business id of the clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "The provided clearance status of a given clearanceId successfully",
            "schema": {
              "$ref": "#/definitions/ClearanceStatusResponseDO"
            }
          },
          "400": {
            "description": "Format of parameter 'clearanceId' is invalid"
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Forbidden! No permission for specified 'clearanceId'.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "No permission for specified 'clearanceId'.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/dtcReadoutConfirmed": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Request diagnostic trouble codes (DTC) data for a specific clearance.",
        "description": "The 3rd party calls this method to request a DTCs of a specific clearance.",
        "operationId": "getConfirmedDtcsForClearanceId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The id of the data clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "A clearance specific list of confirmed DTCs is returned, list can also be empty.",
            "schema": {
              "$ref": "#/definitions/DTCResponseDO"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Access forbidden",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/telematicdata": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Request telematic data for a specific clearance",
        "description": "The 3rd party calls this method to request telematic data of a specific clearance, for the specified vehicle. If the OTP 3rd Party API decides that the telematic data can be delivered immediately (synchronous) this method returns the telematic key/value datastructure otherwise this method returns a requestId for later retrieval.",
        "operationId": "getTelematicDataForClearanceId",
        "produces": [
          "application/json",
          "application/xml"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The id of the data clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "A clearance specific list of telematic key and values was returned.",
            "schema": {
              "$ref": "#/definitions/ThirdpartyFetchDataResponseDO"
            }
          },
          "202": {
            "description": "Creation of the response took too long. Request is processed asychronously."
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Not allowed to fetch telematic data.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "412": {
            "description": "Not allowed to fetch telematic data.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal error occurred",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/telematicdata/{requestId}": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "deprecated": true,
        "summary": "Request telematic data for a request id",
        "description": "The 3rd party calls this method to request telematic data of a specific clearance, that was previously decided to be processed asynchronously.",
        "operationId": "getDataForRequestId",
        "produces": [
          "application/json",
          "application/xml"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The id of the data clearance.",
            "required": true,
            "type": "string"
          },
          {
            "name": "requestId",
            "in": "path",
            "description": "The id of the request.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "A clearance specific list of telematic key and values was returned.",
            "schema": {
              "$ref": "#/definitions/ThirdpartyFetchDataResponseDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "412": {
            "description": "Not allowed to fetch telematic data.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal error occurred",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/vehicleInformation": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Request basic vehicle data for a specific clearance.",
        "description": "Call this method to request vehicle data of a specific clearance.",
        "operationId": "getVehicleInformationForClearanceId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The business id of the clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "A clearance specific list of basic vehicle data attributes is returned.",
            "schema": {
              "$ref": "#/definitions/VehicleInformationResponseDO"
            }
          },
          "202": {
            "description": "Creation of the response took too long. Request is processed asynchronously."
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Forbidden ",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal error occurred",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/vehicleImage": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Request a vehicle image for a specific clearance",
        "description": "Call this method to request a vehicle image of a specific clearance.",
        "operationId": "getVehicleImageForClearanceId",
        "produces": [
          "image/png,application/json"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The id of the data clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "A clearance specific vehicle image is provided",
            "schema": {
              "type": "file"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Forbidden",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "No image available for this vehicle",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpcapability/api/thirdparty/v1/getCapabilities": {
      "post": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Get capabilities requested by 3rd parties",
        "description": "Returns capabilities",
        "operationId": "getCapabilities",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "requestDTO",
            "required": true,
            "schema": {
              "$ref": "#/definitions/RequestDTO"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The returned capabilities",
            "schema": {
              "$ref": "#/definitions/ResponseDTO"
            }
          },
          "400": {
            "description": "Constraint violation | VIN not found | container not found",
            "schema": {
              "$ref": "#/definitions/ApiClientErrorResponseDTO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Forbidden access to container | VIN is blacklisted",
            "schema": {
              "$ref": "#/definitions/ApiClientErrorResponseDTO"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/ApiServerErrorResponseDTO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/chargingHistory": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Request charging history data for a specific clearance.",
        "description": "Method to request the charging history of a specific clearance.",
        "operationId": "getChargingHistoryForClearanceId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The business id of the clearance.",
            "required": true,
            "type": "string"
          },
          {
            "name": "nextToken",
            "in": "query",
            "description": "Optional pagination token",
            "required": false,
            "type": "string",
            "format": "uuid"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Parameter to set the 'from' date, e.g. '2020-06-01T06:15:30+0200'",
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Optional parameter to set the 'to' date, e.g. '2020-08-31T23:59:59Z'",
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "A clearance specific list of charging history entries is returned, list can also be empty.",
            "schema": {
              "$ref": "#/definitions/ChargingHistoryResponseDO"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Access forbidden",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "429": {
            "description": "Too Many Requests",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "503": {
            "description": "Service unavailable.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/learningNavigation": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Method to create a request for learning navigation data of a specific clearance.",
        "description": "Asynchronously request to download profile data. Once data is downloaded, polling interface returns status \"success\" and data download can be requested. Following call will not start new download process for same clearance if one is already in progress and will return 429.",
        "operationId": "getLearningNavigationForClearanceId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The clearance id of the clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns status and status id for a specific Learning Navigation data request",
            "schema": {
              "$ref": "#/definitions/LearningNavigationCreatedDO"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Access forbidden",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "429": {
            "description": "Too Many Requests",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "503": {
            "description": "Service unavailable.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/smartMaintenanceTyreDiagnosis": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "Request Smart Maintenance Tyre Diagnosis data for a specific clearance.",
        "description": "Get Digital Tyre Diagnosis data of a vehicle. A vehicle can have mounted and unmounted tyre sets. A mounted tyre set can have tyre wear, defect and age service demand information. A tyre sets consists of four tyres (front left, front right, rear left and rear right). Each tyre provides detail information like tread, dimension, etc.",
        "operationId": "getSmartMaintenanceTyreDiagnosisForClearanceId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The id of the data clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "The available Tyre Diagnosis data was successfully returned.",
            "schema": {
              "$ref": "#/definitions/TelematicKeyValueDO"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Access forbidden",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "429": {
            "description": "Too Many Requests",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "503": {
            "description": "Service unavailable.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/learningNavigation/status/{statusId}": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "This method returns a status update for the availability of the Learning Navigation data download",
        "operationId": "getLearningNavigationStatusForClearanceIdAndStatusId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The clearance id of the clearance.",
            "required": true,
            "type": "string"
          },
          {
            "name": "statusId",
            "in": "path",
            "description": "The status id of the learning navigation request.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Availability status of Learning Navigation data request",
            "schema": {
              "$ref": "#/definitions/LearningNavigationStatusResponseDO"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Access forbidden",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "429": {
            "description": "Too Many Requests",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "503": {
            "description": "Service unavailable.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    },
    "/otpdatadelivery/api/thirdparty/v1/clearances/{clearanceId}/learningNavigation/data": {
      "get": {
        "tags": [
          "BMW CarData API (v1)"
        ],
        "summary": "This method returns the downloaded Learning Navigation data for a clearance",
        "operationId": "getLearningNavigationDataForClearanceId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "clearanceId",
            "in": "path",
            "description": "The clearance id of the clearance.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Clearance specific learning navigation data.",
            "schema": {
              "type": "object"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "401": {
            "description": "Unauthorized request. Please authorize using your API Key."
          },
          "403": {
            "description": "Access forbidden",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "429": {
            "description": "Too Many Requests",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          },
          "503": {
            "description": "Service unavailable.",
            "schema": {
              "$ref": "#/definitions/ErrorDO"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "ApiClientErrorResponseDTO": {
      "type": "object",
      "properties": {
        "errorCode": {
          "type": "string",
          "example": "TP-100",
          "description": "The error code"
        },
        "message": {
          "type": "string",
          "example": "Format of parameter 'VIN' is invalid",
          "description": "The error message"
        },
        "parameterErrors": {
          "type": "array",
          "description": "The list of erroneous params",
          "items": {
            "$ref": "#/definitions/ParameterError"
          }
        }
      },
      "description": "Object holding information about client errors (HTTP code 4xx)."
    },
    "ApiServerErrorResponseDTO": {
      "type": "object",
      "properties": {
        "errorCode": {
          "type": "string",
          "example": "TP-100",
          "description": "The error code"
        },
        "message": {
          "type": "string",
          "example": "Format of parameter 'VIN' is invalid",
          "description": "The error message"
        }
      },
      "description": "Object holding information about internal server errors (HTTP code 5xx)."
    },
    "ParameterError": {
      "type": "object",
      "required": [
        "errorCode",
        "message"
      ],
      "properties": {
        "errorCode": {
          "type": "string",
          "example": "TP-100",
          "description": "The error code"
        },
        "message": {
          "type": "string",
          "example": "Format of parameter 'VIN' is invalid",
          "description": "The error message"
        }
      },
      "description": "Object holding error code and error message for an erroneous param"
    },
    "RequestDTO": {
      "type": "object",
      "properties": {
        "vin": {
          "type": "string"
        },
        "containerId": {
          "type": "string"
        }
      },
      "description": "Holds the request info"
    },
    "ResponseDTO": {
      "type": "object",
      "required": [
        "vehicleBrandIsSupported",
        "vehicleHasActivatedSim",
        "vehicleIsMappedToCustomer",
        "vehicleIsTelematicsCapable",
        "vehicleMarketIsSupported"
      ],
      "properties": {
        "vehicleIsTelematicsCapable": {
          "type": "boolean",
          "example": false,
          "description": "The vehicle is telematics capable"
        },
        "vehicleHasActivatedSim": {
          "type": "boolean",
          "example": false,
          "description": "The vehicle has the sim activated"
        },
        "vehicleIsMappedToCustomer": {
          "type": "boolean",
          "example": false,
          "description": "The vehicle is mapped to customer"
        },
        "vehicleMarketIsSupported": {
          "type": "boolean",
          "example": false,
          "description": "The vehicle market is supported"
        },
        "vehicleBrandIsSupported": {
          "type": "boolean",
          "example": false,
          "description": "The vehicle brand is supported"
        },
        "containerVinCapability": {
          "type": "array",
          "description": "The capabilities for the vin",
          "items": {
            "type": "object"
          }
        }
      },
      "description": "Holds the capability info"
    },
    "ClearanceDataRequestDO": {
      "type": "object",
      "properties": {
        "correlationId": {
          "type": "string"
        }
      }
    },
    "DataAccessClearanceRequestDO": {
      "type": "object",
      "properties": {
        "clearanceId": {
          "type": "string"
        }
      },
      "xml": {
        "name": "clearancerequest"
      }
    },
    "DTCResponseDO": {
      "type": "object",
      "properties": {
        "asyncStatus": {
          "type": "string"
        },
        "messageTimestamp": {
          "type": "string",
          "description": "Timestamp when the data in the message was received"
        },
        "vehicleId": {
          "type": "string",
          "description": "Is the specified clearanceId"
        },
        "dtcData": {
          "type": "array",
          "description": "List of confirmed DTC(s) or empty list.",
          "items": {
            "$ref": "#/definitions/DTCResponseDataDO"
          }
        }
      }
    },
    "DTCResponseDataDO": {
      "type": "object",
      "properties": {
        "ecuAddress": {
          "type": "string",
          "description": "Identifier of the ECU address where the DTC occurred"
        },
        "ecuVariantName": {
          "type": "string",
          "description": "Identifier of the ECU variant where the DTC occurred, ISO20080 compliant property name."
        },
        "dtcId": {
          "type": "string",
          "description": "Identifier of the DTC. ISO20080 compliant property name. Hexadecimal formatted value."
        },
        "status": {
          "type": "string",
          "description": "Reflects the status of the DTC. ISO20080 compliant property name.",
          "enum": [
            "ACTIVE",
            "PENDING",
            "PREVIOUSLY_ACTIVE"
          ]
        }
      }
    },
    "ErrorDO": {
      "type": "object",
      "properties": {
        "errorCode": {
          "type": "string",
          "description": "The OTP error code in the form <2-chars>-<3-digits>"
        },
        "message": {
          "type": "string",
          "description": "The error message"
        }
      }
    },
    "ClearanceStatusResponseDO": {
      "type": "object",
      "properties": {
        "clearanceId": {
          "type": "string",
          "description": "id of clearance"
        },
        "clearanceState": {
          "type": "string",
          "description": "status of clearance",
          "enum": [
            "REQUESTED",
            "APPROVED",
            "REJECTED",
            "REVOKED",
            "TIMED_OUT"
          ]
        }
      }
    },
    "TelematicKeyValueAsyncResponseDO": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "fetchIn": {
          "type": "integer",
          "format": "int64"
        },
        "timeToLive": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "TelematicKeyValueDO": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "unit": {
          "type": "string"
        },
        "timestamp": {
          "type": "string"
        }
      }
    },
    "ThirdpartyFetchDataResponseDO": {
      "type": "object",
      "properties": {
        "telematicKeyValues": {
          "type": "array",
          "description": "This is the list of the telematic key values",
          "items": {
            "$ref": "#/definitions/TelematicKeyValueDO"
          }
        },
        "asyncResponse": {
          "description": "This is the async response",
          "$ref": "#/definitions/TelematicKeyValueAsyncResponseDO"
        }
      },
      "xml": {
        "name": "telematicdata"
      }
    },
    "VehicleInformationResponseDO": {
      "type": "object",
      "properties": {
        "saList": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "basicAttributes": {
          "$ref": "#/definitions/BasicAttributesResponseDO"
        }
      },
      "required": [
        "saList",
        "basicAttributes"
      ]
    },
    "BasicAttributesResponseDO": {
      "type": "object",
      "properties": {
        "brand": {
          "type": "string",
          "enum": [
            "BMW",
            "BMW_I",
            "MINI"
          ]
        },
        "seriesDevt": {
          "type": "string"
        },
        "series": {
          "type": "string"
        },
        "modelName": {
          "type": "string"
        },
        "modelKey": {
          "type": "string"
        },
        "bodyType": {
          "type": "string"
        },
        "numberOfDoors": {
          "type": "integer",
          "minimum": 2,
          "maximum": 5
        },
        "hasNavi": {
          "type": "boolean"
        },
        "headUnit": {
          "type": "string"
        },
        "hasSunRoof": {
          "type": "boolean"
        },
        "countryCode": {
          "type": "string",
          "description": "provided as ISO 3166-1 alpha-2"
        },
        "steering": {
          "type": "string",
          "enum": [
            "LL",
            "RL"
          ]
        },
        "engine": {
          "type": "string"
        },
        "driveTrain": {
          "type": "string",
          "enum": [
            "MHEV",
            "CONV",
            "BEV",
            "HEV",
            "BEV_REX",
            "PHEV"
          ]
        },
        "chargingModes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "AC_HIGH",
              "DC",
              "AC_LOW"
            ]
          },
          "uniqueItems": true
        },
        "propulsionType": {
          "type": "string",
          "enum": [
            "DI",
            "BE",
            "EL"
          ]
        },
        "colourDescription": {
          "type": "string"
        },
        "colourCodeRAW": {
          "type": "string"
        },
        "constructionDate": {
          "type": "string",
          "format": "date",
          "pattern": "yyyy-mm-dd"
        }
      },
      "required": [
        "brand",
        "seriesDevt",
        "series",
        "modelName",
        "modelKey",
        "bodyType",
        "numberOfDoors",
        "hasNavi",
        "headUnit",
        "hasSunRoof",
        "countryCode",
        "steering",
        "engine",
        "driveTrain",
        "propulsionType",
        "colourDescription",
        "colourCodeRAW",
        "constructionDate"
      ]
    },
    "ChargingHistoryResponseDO": {
      "type": "object",
      "properties": {
        "nextToken": {
          "type": "string",
          "format": "uuid"
        },
        "data": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/definitions/ChargingSessionDO"
          }
        }
      },
      "required": [
        "data"
      ]
    },
    "ChargingSessionDO": {
      "type": "object",
      "properties": {
        "publicChargingPoint": {
          "$ref": "#/definitions/PublicChargingPointDO"
        },
        "displayedSoc": {
          "type": "integer",
          "format": "int32"
        },
        "displayedStartSoc": {
          "type": "integer",
          "format": "int32"
        },
        "businessErrors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BusinessErrorDO"
          }
        },
        "timeZone": {
          "type": "string"
        },
        "startTime": {
          "type": "integer",
          "format": "int64",
          "description": "UTC time in seconds from 01.01.1970"
        },
        "endTime": {
          "type": "integer",
          "format": "int64",
          "description": "UTC time in seconds from 01.01.1970"
        },
        "totalChargingDurationSec": {
          "type": "integer",
          "format": "int32"
        },
        "energyConsumedFromPowerGridKwh": {
          "type": "number",
          "format": "float"
        },
        "isPreconditioningActivated": {
          "type": "boolean"
        },
        "mileage": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "mileageUnits": {
          "type": "string",
          "enum": [
            "KM",
            "MI"
          ]
        },
        "chargingCostInformation": {
          "$ref": "#/definitions/ChargingCostInformationDO"
        },
        "chargingLocation": {
          "$ref": "#/definitions/ChargingLocationDO"
        },
        "chargingBlocks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ChargingBlockDO"
          }
        }
      }
    },
    "ChargingLocationDO": {
      "type": "object",
      "properties": {
        "municipality": {
          "type": "string"
        },
        "formattedAddress": {
          "type": "string"
        },
        "streetAddress": {
          "type": "string"
        },
        "mapMatchedLatitude": {
          "type": "number",
          "format": "float"
        },
        "mapMatchedLongitude": {
          "type": "number",
          "format": "float"
        }
      }
    },
    "ChargingCostInformationDO": {
      "type": "object",
      "properties": {
        "currency": {
          "type": "string"
        },
        "calculatedChargingCost": {
          "type": "number",
          "format": "float"
        },
        "calculatedSavings": {
          "type": "number",
          "format": "float"
        }
      }
    },
    "PublicChargingPointDO": {
      "type": "object",
      "properties": {
        "potentialChargingPointMatches": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/definitions/PublicChargingPointMatchesDO"
          }
        }
      }
    },
    "PublicChargingPointMatchesDO": {
      "type": "object",
      "properties": {
        "postalCode": {
          "type": "string"
        },
        "streetAddress": {
          "type": "string"
        },
        "providerName": {
          "type": "string"
        },
        "city": {
          "type": "string"
        }
      }
    },
    "BusinessErrorDO": {
      "type": "object",
      "properties": {
        "creationTime": {
          "type": "string",
          "format": "date-time"
        },
        "hint": {
          "type": "string"
        }
      }
    },
    "LearningNavigationCreatedDO": {
      "type": "object",
      "properties": {
        "statusId": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      }
    },
    "LearningNavigationStatusResponseDO": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string"
        }
      }
    },
    "ChargingBlockDO": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "integer",
          "format": "int64",
          "description": "UTC time in seconds from 01.01.1970"
        },
        "endTime": {
          "type": "integer",
          "format": "int64",
          "description": "UTC time in seconds from 01.01.1970"
        },
        "averagePowerGridKw": {
          "type": "number",
          "format": "float"
        }
      }
    }
  }
}
