Downloading Tracks

Typically the ability to download files from your site is governed by user permissions to ensure that your music is safe. With the API, however, you can download any of your files automatically. That means that anyone with access to your API key can download your whole site, so do not share it. If you think your key has been compromised, please reset it.

There are two types of downloading we support in the API. Direct calls to the API which return the file itself, which is suitable for downloading to your own servers for backup. However, if you wish your users to be able to download your files from SourceAudio, you don’t want them to have your authentication token, so we also support the ability to create an authorized download link, that will stay active for a specified time (10s default, 24h max). The usage here is that we expect you to generate this link server-side when requested, then forward your user to the result. You can also generate longer timed links on page load.

/api/tracks/download
Param Required Description
track_id yes The id of the track you wish to download
format no The format you wish to download, defaults to mp3

* The expected response is the file itself.

/api/tracks/downloadAuth
Param Required Description
track_id yes The id of the track you wish to download
format no The format you wish to download, defaults to mp3
duration no The time in seconds that the link should remain active. Default is 10, max is 86400

Expected Response

{
path: "https://d1ombmsyi1byit.cloudfront.net/4/6/9/2/0/2/9/4692029-4.mp3",
params: "Expires=1471965144&Signature=nMya2p5fEcVqzqpBRmAxL3M2rK28ti0k-kAEAoDMBsUO1cXGAZZT0mv4ENRsDRXKw-e0uyK8THYcdlmE5gP18R-bFED0SgaheLsW9EZD6ENPiGe-B6p6jfJxH8U0R11~Hsf3dukNGIQng7FuCTfeGhtIpLRpHHHgKrGJfXYzc3IRrS~NcpZc7vESJE4SRIU4Zz2RSRtAaUOErIJSEXV1RI8ZWQqhCtKF1BdJyW5rnnCpjXhQQz8jo9jR~yOl6iu1SOr9JgNP0FfVu7jSsD7xkHOgkB9guEKwke-IMC1za5kb8f2QRe2SUlQFs6N~ccV5LQZB0db9uxOJ-Xv7tXM02w__&Key-Pair-Id=APKAJ7O34GU4D2LHPXGA",
fullPath: "https://d1ombmsyi1byit.cloudfront.net/4/6/9/2/0/2/9/4692029-4.mp3?Expires=1471965144&Signature=nMya2p5fEcVqzqpBRmAxL3M2rK28ti0k-kAEAoDMBsUO1cXGAZZT0mv4ENRsDRXKw-e0uyK8THYcdlmE5gP18R-bFED0SgaheLsW9EZD6ENPiGe-B6p6jfJxH8U0R11~Hsf3dukNGIQng7FuCTfeGhtIpLRpHHHgKrGJfXYzc3IRrS~NcpZc7vESJE4SRIU4Zz2RSRtAaUOErIJSEXV1RI8ZWQqhCtKF1BdJyW5rnnCpjXhQQz8jo9jR~yOl6iu1SOr9JgNP0FfVu7jSsD7xkHOgkB9guEKwke-IMC1za5kb8f2QRe2SUlQFs6N~ccV5LQZB0db9uxOJ-Xv7tXM02w__&Key-Pair-Id=APKAJ7O34GU4D2LHPXGA",
type: "mp3",
duration: 10
}