Download Files
Interacting with the API
All files that you upload to Echo can also be download at any point, as long as the reference to that file has not been deleted. For instance, if a traffic file is uploaded, it can be downloaded until you manually delete that traffic from the Platform. The endpoint below provides support for file downloads:
GET /p-{project_id}/files/{name}/download
Note that name
is composed by the ID of the element you want to download, followed by the extension of the file. As an example, if a .csv
traffic file was uploaded and Echo assigned the ID 5 to it, its name will be defined as 5.csv
.
The endpoint also accepts the following path parameters:
Element | Type | Presence | Unit | Description | Observations |
---|---|---|---|---|---|
asset_type |
string |
Mandatory | - | Type of file to be downloaded | Values traffics , airport_data and aircraft_data are accepted |
logs |
boolean |
Optional | - | If set to True, the endpoint will download the logs that resulted from the file's validation. Defaults to False | This .txt log file will be empty if no validation errors/warnings were found |
Below you can find an example on how to get the logs file of a traffic file that has been uploaded before.
import requests
def download_traffic_logs_file(base_url: str, project_id: int, headers: dict):
# Set asset type
asset_type = "traffics"
# Set traffic name
traffic_name = "5.csv"
# Decide whether the actual traffic file or the logs are needed
logs = "true"
# Download logs
download_response = requests.get(
f"{base_url}/p-{project_id}/files/{traffic_name}/download" + f"?asset_type={asset_type}&logs={logs}",
headers=headers
)
Using the Website
DOCUMENTATION TO BE ADDED SOON
The documentation for this section has not been completed yet.