{
    "openapi": "3.0.0",
    "info": {
        "title": "Download API",
        "description": "Download file(s) from a downloadable GeoResource.\n\nBy using Download API, you declare to have read and to agree to viageo.ch <a href=\"/conditions-generales\" target=\"_blank\">terms and conditions</a>,\nAND the downloaded GeoResource conditions (\"Acc\u00e8s et utilisation\" section of each metadata).\n\nIf the GeoResource is not public, you need an authenticated user account who can download the requested GeoResource.\n\nSecurity recommandations for accounts :\n* Use a minimal access account for this task, who can't create or edit GeoResources.\n* Use <a href=\"/api/personal_access_token/doc\">access tokens</a> instead of username and passwords.\n* Generate an <a href=\"/api/personal_access_token/doc\">access token</a> for each application or script, for ease of revocation.\n",
        "termsOfService": "https://viageo.ch/conditions-generales",
        "contact": {
            "name": "ASIT Support",
            "url": "https://viageo.ch/support",
            "email": "support@viageo.ch"
        },
        "version": "1.0.0"
    },
    "paths": {
        "/api/download/{uuid}": {
            "get": {
                "summary": "Download a GeoResource (simple)",
                "description": "For GeoResources where download is enabled,\nuse URL as below, where 11111111-2222-3333-4444-555555555555 is the metadata GUID (see `uuid`).\n\nExample : /api/download/11111111-2222-3333-4444-555555555555",
                "operationId": "get_catalog_api_download.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream of the file to download"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted download"
                    },
                    "403": {
                        "description": "Access Denied"
                    },
                    "404": {
                        "description": "File not found. Causes may be : wrong uuid, download not enabled, wrong mapCode, wrong formatCode, remote file or server not available."
                    }
                }
            },
            "head": {
                "summary": "Download a GeoResource (simple)",
                "description": "For GeoResources where download is enabled,\nuse URL as below, where 11111111-2222-3333-4444-555555555555 is the metadata GUID (see `uuid`).\n\nExample : /api/download/11111111-2222-3333-4444-555555555555",
                "operationId": "head_catalog_api_download.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream of the file to download"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted download"
                    },
                    "403": {
                        "description": "Access Denied"
                    },
                    "404": {
                        "description": "File not found. Causes may be : wrong uuid, download not enabled, wrong mapCode, wrong formatCode, remote file or server not available."
                    }
                }
            }
        },
        "/api/download/{uuid}/{mapCode}": {
            "get": {
                "summary": "Download a GeoResource over a specific area",
                "description": "For GeoResources where download is enabled and requires area to be specified,\nuse URL as below, where 11111111-2222-3333-4444-555555555555 is the metadata GUID (see `uuid`)\nand 5586 is a \"Commune\" BFS number (\"num\u00e9ro OFS\", Lausanne in this example, see `mapCode`).\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/5586\n\nThe mapCode can also be a Kilometer Grid identifier (e.g. \"2537_1154\") depending on the GeoResource\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/2537_1154",
                "operationId": "get_catalog_api_download_by_map_code.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "mapCode",
                        "in": "path",
                        "description": "A BFS number (e.g. \"5586\") or a Kilometer Grid identifier (e.g. \"2537_1154\") depending on the GeoResources",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-zA-Z0-9_\\-]+"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream of the file to download"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted download"
                    },
                    "403": {
                        "description": "Access Denied"
                    },
                    "404": {
                        "description": "File not found. Causes may be : wrong uuid, download not enabled, wrong mapCode, wrong formatCode, remote file or server not available."
                    }
                }
            },
            "head": {
                "summary": "Download a GeoResource over a specific area",
                "description": "For GeoResources where download is enabled and requires area to be specified,\nuse URL as below, where 11111111-2222-3333-4444-555555555555 is the metadata GUID (see `uuid`)\nand 5586 is a \"Commune\" BFS number (\"num\u00e9ro OFS\", Lausanne in this example, see `mapCode`).\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/5586\n\nThe mapCode can also be a Kilometer Grid identifier (e.g. \"2537_1154\") depending on the GeoResource\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/2537_1154",
                "operationId": "head_catalog_api_download_by_map_code.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "mapCode",
                        "in": "path",
                        "description": "A BFS number (e.g. \"5586\") or a Kilometer Grid identifier (e.g. \"2537_1154\") depending on the GeoResources",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-zA-Z0-9_\\-]+"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream of the file to download"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted download"
                    },
                    "403": {
                        "description": "Access Denied"
                    },
                    "404": {
                        "description": "File not found. Causes may be : wrong uuid, download not enabled, wrong mapCode, wrong formatCode, remote file or server not available."
                    }
                }
            }
        },
        "/api/download/{uuid}/format/{formatCode}": {
            "get": {
                "summary": "Download a GeoResource in a specific format",
                "description": "For GeoResources where download is enabled and requires format to be specified,\nuse URL as below, where 11111111-2222-3333-4444-555555555555 is the metadata GUID (see `uuid`)\nand DXF is a format code (see `formatCode`)\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/format/DXF",
                "operationId": "get_catalog_api_download_by_format.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "formatCode",
                        "in": "path",
                        "description": "The desire format for download",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-zA-Z0-9_\\-\\.]+",
                            "enum": [
                                "ASCII.grid",
                                "ASCII.xyz",
                                "CSV",
                                "DGN",
                                "DWG",
                                "DXF",
                                "PDF_PLUS_DXF",
                                "DXF Geobat MD.01",
                                "ECW",
                                "EPS",
                                "ESRI_geodatabase",
                                "FBX",
                                "GCM",
                                "GEOJSON",
                                "GEOTIFF",
                                "GPKG",
                                "GLTF",
                                "GTFS",
                                "IFC",
                                "INTERLIS-CH",
                                "INTERLIS-VD",
                                "INTERLIS-2",
                                "JPG",
                                "LAS",
                                "LAZ",
                                "MIF_MID",
                                "OBJ",
                                "PAPER",
                                "PDF",
                                "PNG",
                                "Points MD.01",
                                "SHP",
                                "SKP",
                                "SpatiaLite",
                                "STL",
                                "SVG",
                                "TIFF",
                                "TXT",
                                "XLS",
                                "XYZ"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream of the file to download"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted download"
                    },
                    "403": {
                        "description": "Access Denied"
                    },
                    "404": {
                        "description": "File not found. Causes may be : wrong uuid, download not enabled, wrong mapCode, wrong formatCode, remote file or server not available."
                    }
                }
            },
            "head": {
                "summary": "Download a GeoResource in a specific format",
                "description": "For GeoResources where download is enabled and requires format to be specified,\nuse URL as below, where 11111111-2222-3333-4444-555555555555 is the metadata GUID (see `uuid`)\nand DXF is a format code (see `formatCode`)\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/format/DXF",
                "operationId": "head_catalog_api_download_by_format.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "formatCode",
                        "in": "path",
                        "description": "The desire format for download",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-zA-Z0-9_\\-\\.]+",
                            "enum": [
                                "ASCII.grid",
                                "ASCII.xyz",
                                "CSV",
                                "DGN",
                                "DWG",
                                "DXF",
                                "PDF_PLUS_DXF",
                                "DXF Geobat MD.01",
                                "ECW",
                                "EPS",
                                "ESRI_geodatabase",
                                "FBX",
                                "GCM",
                                "GEOJSON",
                                "GEOTIFF",
                                "GPKG",
                                "GLTF",
                                "GTFS",
                                "IFC",
                                "INTERLIS-CH",
                                "INTERLIS-VD",
                                "INTERLIS-2",
                                "JPG",
                                "LAS",
                                "LAZ",
                                "MIF_MID",
                                "OBJ",
                                "PAPER",
                                "PDF",
                                "PNG",
                                "Points MD.01",
                                "SHP",
                                "SKP",
                                "SpatiaLite",
                                "STL",
                                "SVG",
                                "TIFF",
                                "TXT",
                                "XLS",
                                "XYZ"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream of the file to download"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted download"
                    },
                    "403": {
                        "description": "Access Denied"
                    },
                    "404": {
                        "description": "File not found. Causes may be : wrong uuid, download not enabled, wrong mapCode, wrong formatCode, remote file or server not available."
                    }
                }
            }
        },
        "/api/download/{uuid}/{mapCode}/format/{formatCode}": {
            "get": {
                "summary": "Download a GeoResource over a specific area in a specific format",
                "description": "For GeoResources where download is enabled and requires area and format to be specified,\nuse URL as below, where 11111111-2222-3333-4444-555555555555 is the metadata GUID (see `uuid`), 5586 is a \"Commune\" BFS number (\"num\u00e9ro OFS\", Lausanne in this example, see `mapCode`)\nand DXF is a format code (see `formatCode`)\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/5586/format/DXF\n\nThe mapCode can also be a Kilometer Grid identifier (e.g. \"2537_1154\") depending on the GeoResource\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/2537_1154/format/DXF",
                "operationId": "get_catalog_api_download_by_map_code_and_format.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "mapCode",
                        "in": "path",
                        "description": "A BFS number (e.g. \"5586\") or a Kilometer Grid identifier (e.g. \"2537_1154\") depending on the GeoResources",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-zA-Z0-9_\\-]+"
                        }
                    },
                    {
                        "name": "formatCode",
                        "in": "path",
                        "description": "The desire format for download",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-zA-Z0-9_\\-\\.]+",
                            "enum": [
                                "ASCII.grid",
                                "ASCII.xyz",
                                "CSV",
                                "DGN",
                                "DWG",
                                "DXF",
                                "PDF_PLUS_DXF",
                                "DXF Geobat MD.01",
                                "ECW",
                                "EPS",
                                "ESRI_geodatabase",
                                "FBX",
                                "GCM",
                                "GEOJSON",
                                "GEOTIFF",
                                "GPKG",
                                "GLTF",
                                "GTFS",
                                "IFC",
                                "INTERLIS-CH",
                                "INTERLIS-VD",
                                "INTERLIS-2",
                                "JPG",
                                "LAS",
                                "LAZ",
                                "MIF_MID",
                                "OBJ",
                                "PAPER",
                                "PDF",
                                "PNG",
                                "Points MD.01",
                                "SHP",
                                "SKP",
                                "SpatiaLite",
                                "STL",
                                "SVG",
                                "TIFF",
                                "TXT",
                                "XLS",
                                "XYZ"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream of the file to download"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted download"
                    },
                    "403": {
                        "description": "Access Denied"
                    },
                    "404": {
                        "description": "File not found. Causes may be : wrong uuid, download not enabled, wrong mapCode, wrong formatCode, remote file or server not available."
                    }
                }
            },
            "head": {
                "summary": "Download a GeoResource over a specific area in a specific format",
                "description": "For GeoResources where download is enabled and requires area and format to be specified,\nuse URL as below, where 11111111-2222-3333-4444-555555555555 is the metadata GUID (see `uuid`), 5586 is a \"Commune\" BFS number (\"num\u00e9ro OFS\", Lausanne in this example, see `mapCode`)\nand DXF is a format code (see `formatCode`)\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/5586/format/DXF\n\nThe mapCode can also be a Kilometer Grid identifier (e.g. \"2537_1154\") depending on the GeoResource\n\nExample : /api/download/11111111-2222-3333-4444-555555555555/2537_1154/format/DXF",
                "operationId": "head_catalog_api_download_by_map_code_and_format.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "mapCode",
                        "in": "path",
                        "description": "A BFS number (e.g. \"5586\") or a Kilometer Grid identifier (e.g. \"2537_1154\") depending on the GeoResources",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-zA-Z0-9_\\-]+"
                        }
                    },
                    {
                        "name": "formatCode",
                        "in": "path",
                        "description": "The desire format for download",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-zA-Z0-9_\\-\\.]+",
                            "enum": [
                                "ASCII.grid",
                                "ASCII.xyz",
                                "CSV",
                                "DGN",
                                "DWG",
                                "DXF",
                                "PDF_PLUS_DXF",
                                "DXF Geobat MD.01",
                                "ECW",
                                "EPS",
                                "ESRI_geodatabase",
                                "FBX",
                                "GCM",
                                "GEOJSON",
                                "GEOTIFF",
                                "GPKG",
                                "GLTF",
                                "GTFS",
                                "IFC",
                                "INTERLIS-CH",
                                "INTERLIS-VD",
                                "INTERLIS-2",
                                "JPG",
                                "LAS",
                                "LAZ",
                                "MIF_MID",
                                "OBJ",
                                "PAPER",
                                "PDF",
                                "PNG",
                                "Points MD.01",
                                "SHP",
                                "SKP",
                                "SpatiaLite",
                                "STL",
                                "SVG",
                                "TIFF",
                                "TXT",
                                "XLS",
                                "XYZ"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream of the file to download"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted download"
                    },
                    "403": {
                        "description": "Access Denied"
                    },
                    "404": {
                        "description": "File not found. Causes may be : wrong uuid, download not enabled, wrong mapCode, wrong formatCode, remote file or server not available."
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "description": "Personal Access Token, you can generate one in your account",
                "name": "Personal Access Token",
                "bearerFormat": "Personal Access Token",
                "scheme": "bearer"
            },
            "basicAuth": {
                "type": "http",
                "description": "Basic Authentication with an ASIT username/email and password",
                "name": "Basic Authentication",
                "scheme": "basic"
            }
        }
    },
    "security": [
        {
            "bearer": []
        },
        {
            "basicAuth": []
        }
    ]
}