Get a signed download URL for a stored file
Exchanges a stored-file reference for a short-lived signed storage URL, valid for 5 minutes. This is the route automations should use to download a file.
Fetch the returned url with no Authorization header. The signature travels in the query string, and storage rejects a presigned request that also carries an auth header. Most HTTP clients reuse headers across calls, so send your token to this endpoint only.
The typical use is a redo. When a reviewer sends an output back with a comment, the automation that produced it has already finished and no longer holds the source file. It can get it back:
- Read the output's
attachmentsarray, from the webhook payload orGET /api/logs/{id}. Use thekeyfrom there, not the key returned byPOST /api/uploads- an upload key is consumed once an output references it, and answers404afterwards. - Exchange that attachment's
keyorurlhere for a signed link, then download it. - Rerun the AI with the reviewer's comment.
- Resubmit with
revisionOfset andattachments: [{ source: "stored", key }], so the same document carries onto the new version without being uploaded again.
https://www.tracira.com/api/media-urlWorkspace webhook token from Settings -> Integrations.
In: header
Query Parameters
The file to sign. Accepts the bare key from an attachment, the relative /api/media/{key} path, or the absolute url from an attachment - all three name the same object.
Optional. Renames the file in the signed URL's content disposition. Defaults to the name it was stored under.
Use 1 for attachment disposition instead of inline preview.
Value in
- "1"
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/media-url?source=1f4a8c60-92d7-4b3e-8a51-c27e6d90f3b2%2Flog-42%2F0-ab12cd34-invoice-april.pdf"{ "url": "http://example.com", "expiresAt": "2019-08-24T14:15:22Z", "key": "string", "filename": "string", "contentType": "string", "sizeBytes": 0}