Skip to content
TriedDocs
Public endpoints

Get public asset

Download an uploaded audio asset through its signed url.

GEThttps://api.tried.com.au/public/assets/{asset_id}

Returns the file of an uploaded asset, such as hold music. Use the url field from Create asset, Get asset or List assets rather than building the URL. The link is signed, so it works without an API key until it expires.

The url looks like https://api.tried.com.au/public/assets/<asset_id>?exp=<ms>&sig=<hex>.

  • exp is the expiry in Unix ms, 1 hour after the asset object was returned.
  • sig is an HMAC-SHA256 of the asset ID and exp, keyed with the API's session secret.

Call Get asset again for a fresh link.

Request#

Path parameters#

Parameter Type Required Description
asset_id string Yes The asset, starting with asset_.

Query parameters#

Parameter Type Required Description
exp string Yes Expiry from the signed link.
sig string Yes Signature from the signed link.

Example request#

curl -o hold-music.mp3 "$ASSET_URL"
const asset = await (await fetch("https://api.tried.com.au/get-asset/asset_3c8e1a5f7b9d2e4a6c0f1b3d", {
  headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
})).json();
const audio = await (await fetch(asset.url)).arrayBuffer();
import os, requests

asset = requests.get(
    "https://api.tried.com.au/get-asset/asset_3c8e1a5f7b9d2e4a6c0f1b3d",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
).json()
audio = requests.get(asset["url"]).content

Response#

200 OK with the file bytes. Content-Type is the asset's mime_type, for example audio/mpeg, and Cache-Control is private, max-age=300.

Errors#

Status When
403 Invalid or expired link: exp or sig is missing, exp is in the past, or the signature does not match.
404 Asset <asset_id> not found (deleted), or Asset <asset_id> is not available (the stored file could not be read from S3).
429 Per-IP rate limit exceeded. See Rate limits.

See Errors for the body format.