Downloading a file
To download a file, you must first ask the File API for a pre-signed download URL. See below for examples of doing this.
Once you have retrieved the download
URL, you may fetch the URL and write to a file, open a new
browser window with that URL, embed the URL in a button in a web page, etc.
Pre-signed download URLs will be valid for 30 minutes, and do not require the regular Authorization
header like other
Seequent Evo API calls do.
Download file by path/UUID
By path
GET https://<service_host>/file/v2/orgs/<org_id>/workspaces/<workspace_id>/files/path/<file_path>?version=<version_id>
By UUID
GET https://<service_host>/file/v2/orgs/<org_id>/workspaces/<workspace_id>/files/<file_id>?version=<version_id>
You can retrieve a file's data by its path or UUID. This will include a pre-signed URL to download the file from blob storage.
Parameters:
version
: a version ID, in order to retrieve a specific version of a file. If not provided, the latest version will be used.include_versions
: the response will include a complete list of available file versions.
file_path = "path_to_my_file.txt"
url = f"https://<service_host>/file/v2/orgs/{org_uuid}/workspaces/{workspace_uuid}/files/path/{file_path}"
result = requests.get(url, { "Authorization": "Bearer [yourtokenhere]" }).json()
A successful response will include the file's metadata, as well as a pre-signed download URL:
{
"name": "path_to_my_file.txt",
"path": "/",
"file_id": "13771ee0-c399-4b52-8ccb-ed3a114dcc0d",
"version_id": 1701303763589905104,
"size": 191,
"created_at": "2023-11-30T00:22:46",
"etag": "\"0x8DBF13A7A4ECB68\"",
"author": {
"id": "fb224065-b853-4daa-8332-60cf41cd5231",
"name": "Leslie Lawless",
"email": "leslie.lawless@example.com"
},
"download": "https://<service_host>/file/efda2f60-a80b-45c0-a484-4001bfe7b3cb/956f86b3-384d-412f-913f-c0bdfac96108/13771ee0-c399-4b52-8ccb-ed3a114dcc0d/1701303763589905104?se=2023-11-30T00%3A53%3A30Z&sp=rt&sv=2023-08-03&sr=b&rscd=attachment%3B+filename%2A%3DUTF-8%27%27path_to_file.txt&skoid=e5e6494a-6b97-403b-8dfd-30d5b24d8ca7&sktid=067e9632-ea4c-4ed9-9e6d-e294956e284b&skt=2023-11-30T00%3A22%3A35Z&ske=2023-11-30T01%3A22%3A35Z&sks=b&skv=2023-08-03&sig=9dLrqxcxsdEUYvgRWe1ydaRYIyTtBcoDEy7a4BoJDFY%3D",
"self": "https://<service_host>/file/v2/orgs/efda2f60-a80b-45c0-a484-4001bfe7b3cb/workspaces/956f86b3-384d-412f-913f-c0bdfac96108/files/13771ee0-c399-4b52-8ccb-ed3a114dcc0d?version_id=1701303763589905104&include_versions=false"
}