{
  "openapi": "3.0.3",
  "info": {
    "title": "PTV Flows Network API",
    "description": "The PTV Flows Network API provides the network data of your product instance.",
    "version": "1.0.1-SNAPSHOT"
  },
  "tags": [
    {
      "name": "Network"
    },
    {
      "name": "Tile"
    },
    {
      "name": "Configuration"
    }
  ],
  "paths": {
    "/streets": {
      "get": {
        "tags": [
          "Network"
        ],
        "summary": "Network streets data",
        "description": "Get network street data of your product instance in Protobuf format.",
        "operationId": "getMapData",
        "parameters": [
          {
            "name": "tiles",
            "in": "query",
            "description": "Comma-separated list of tiles. If present, it returns only the network data of the specified tiles. If empty, the network data of all tiles of your product instance will be provided.",
            "required": false,
            "schema": {
              "maxItems": 30,
              "minItems": 0,
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "The response contains protocol buffers binary data.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/gzip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified. There are no updated data.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "description": "Bad Request. The request needs to be paginated by tiles since it involves a bounding box that is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access rights. The network data API must be purchased.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Network data are not available or none of the required tiles exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tiles": {
      "get": {
        "tags": [
          "Tile"
        ],
        "summary": "Network tiles data",
        "description": "Get network tile data of your product instance in JSON format.",
        "operationId": "getTiles",
        "responses": {
          "200": {
            "description": "Success. The response contains the tiles of your product instance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TileObject"
                }
              }
            }
          },
          "404": {
            "description": "Network data are not available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ConfigObject": {
        "type": "object",
        "properties": {
          "productInstanceId": {
            "type": "string",
            "readOnly": true,
            "example": "139a6cda42064ede919d4b1a97e81f36"
          },
          "configuration": {
            "properties": {
              "canExportMap": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "TileObject": {
        "type": "object",
        "properties": {
          "productInstanceId": {
            "type": "string",
            "readOnly": true,
            "example": "139a6cda42064ede919d4b1a97e81f36"
          },
          "mapVersion": {
            "type": "string",
            "readOnly": true,
            "example": "20240430072803"
          },
          "tiles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "u0yw",
              "u0yt"
            ]
          }
        }
      },
      "ErrorResponse": {
        "required": [
          "description",
          "errorCode",
          "traceId"
        ],
        "type": "object",
        "properties": {
          "description": {
            "description": "A human readable message that describes the error.",
            "type": "string"
          },
          "errorCode": {
            "description": "A constant string that can be used to identify this error class programmatically. An errorCode can have **details** to provide information on additional properties which are described with the code they apply to. They are of type string unless otherwise specified.  \n\nNote that additional errorCodes as well as the **details** of existing errorCodes may be added at any time. Furthermore, the **description** may change at any time.  \n\n**HTTP status code: 400**  \n* `GENERAL_VALIDATION_ERROR` - The validation of the request failed. Details can be found in **causes**.  \n* `GENERAL_PARSING_ERROR` - The JSON syntax is invalid.  \n\n**HTTP status code: 401**  \n* `GENERAL_UNAUTHENTICATED` - Invalid or missing authentication credentials.  \n  * `message` - An additional error message.  \n\n**HTTP status code: 403**  \n* `GENERAL_FORBIDDEN` - Insufficient access rights.  \n* `GENERAL_QUOTA_EXCEEDED` - The transaction limit is exceeded.  \n  * `message` - An additional error message.  \n\n**HTTP status code: 404**  \n* `GENERAL_RESOURCE_NOT_FOUND` - A requested resource does not exist.  \n  * `message` - An additional error message.  \n\n**HTTP status code: 429**  \n* `GENERAL_RATE_LIMIT_EXCEEDED` - The rate limit is exceeded.  \n\n**HTTP status code: 500**  \n* `GENERAL_INTERNAL_SERVER_ERROR` - The request could not be processed due to an internal error.  \n  * `message` - An additional error message.  \n  * `hint` - A hint on how to solve the problem.  \n\n**HTTP status code: 503**  \n* `GENERAL_SERVICE_UNAVAILABLE` - The service is temporarily unavailable.",
            "type": "string"
          },
          "traceId": {
            "description": "A unique identifier of the corresponding trace forest. It can be used to trace errors by the support team.",
            "type": "string"
          },
          "errorId": {
            "description": "A unique identifier specific to this error instance. It can be used to trace errors by the support team.",
            "type": "string"
          },
          "causes": {
            "description": "A list of affected parameters and/or properties that caused this error.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CausingError"
            }
          },
          "details": {
            "description": "Additional properties specific to this error class.",
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CausingError": {
        "required": [
          "description",
          "errorCode"
        ],
        "type": "object",
        "properties": {
          "description": {
            "description": "A human readable message that describes the error.",
            "type": "string"
          },
          "errorCode": {
            "description": "A constant string that can be used to identify this error class programmatically. An errorCode can have **details** to provide information on additional properties which are described with the code they apply to. They are of type string unless otherwise specified. \n\nNote that additional errorCodes as well as the **details** of existing errorCodes may be added at any time. Furthermore, the **description** may change at any time.  \n\n**Error codes for** `GENERAL_VALIDATION_ERROR`\n* `GENERAL_INVALID_VALUE` - A parameter is set to an invalid value.  \n  * `value` - The invalid value.  \n* `GENERAL_UNRECOGNIZED_PARAMETER` - A parameter is unknown.  \n* `GENERAL_DUPLICATE_PARAMETER` - A parameter is duplicated.  \n* `GENERAL_MINIMUM_VALUE_VIOLATED` - The minimum value restriction is violated.  \n  * `minimumValue` - The minimum value (integer or double).  \n* `GENERAL_MAXIMUM_VALUE_VIOLATED` - The maximum value restriction is violated.  \n  * `maximumValue` - The maximum value (integer or double).",
            "type": "string"
          },
          "parameter": {
            "description": "The name of the affected query or path parameter or a JSON path to the affected property of the request.",
            "type": "string"
          },
          "details": {
            "description": "Additional properties specific to this error class.",
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    },
    "headers": {
      "ETag": {
        "description": "An Etag is an identifier for a specific version of data. You should retain the latest ETag value you receive. The next time you call the same API to get data, you should use the If-None-Match request header along with the retained ETag value, so that the API will send back a full response if and only if the data changes.",
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "apiKey"
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api.ptvgroup.tech/flows/map/v1"
    }
  ]
}