Download

Get Download

GetDownload returns download tokens which can be downloaded immediately or sends a download link directly to specified email.

Whenever download tokens are returned use the AssetUrls.DirectDownloadUrl URL regardless of type of download (To access AssetURLs see getserviceinfo).


POST /getmusicdownload/{serviceToken}

Parameter Type Status
ServiceToken String Mandatory
Request Body XML Mandatory

Request body

The following are mandatory for a POST request
<downloadextended>  
<membertoken>{membertoken}</membertoken> This element should contain the memberToken
<downloadtype>track</downloadtype> This element should be

 

  • track
  • playlist
  • album
  • favourites
  • workspace
  • tags
<identifier>01f85a9be3d626e0</identifier> Identifier should be:

 

  • track:
    • one track id (encrypted)
    • multiple track ids, separated by commas
  • playlist:
    • encrypted playlist id
  • album:
    • encrypted album id
  • favourites:
    • zero, one, or multiple content ids. Encrypted and comma separated if multiple. If none are provided, all of the member’s favourites will be downloaded, otherwise only the specified
<format>19b8f5935503adde</format>

Format should be an encrypted format identifier returned from getserviceinfo

Alternatively specify "wav" or "aiff" or "mp3" in the fileformat field to get the best available formats for these types.



<trimstartsecs>0</trimstartsecs><trimendsecs>0</trimendsecs> Trim values are in seconds only and are only used for single track downloads. Use 0 for both values otherwise

<email></email> Recipient of the download email

<isshare>true/false</isshare>

Setting isshare to true will use the "share music" email templates to send an email. If set to true, no attempt is made to get a download token for immediate use.

 

<forceemail>true/false</forceemail> Always send an email, do not attempt to get a download token for immediate use.
<message></message>

This element should contain the message body for the email isshare or forceemail

<senderemail></senderemail> This is the member email that the download is sent from. 
<includeversions>true/false</includeversions>

If you would like to request a download with all versions related to the requested tracks (used in track, playlist and favourite downloads), set the "includeversions" parameter to true in the requestDownload body. This will result in the zip containing related versions.

NOTE: when the downloadtype is album,includeversions parameter will be ignored and always return track versions.

<versionfoldername></versionfoldername>

Version can be saved into a sub folder called. Define this using versionfoldername.

<downloadfilename>myfilename</downloadfilename>

The downloaded file name can be set using downloadfilename.

The track download filename convention can be configured in the admin.

Currently the other download tracks are formatted as follows:

  • Playlists is {playlist.name}.zip
  • Albums uses {album.displaytitle}.zip
  • Favorites uses myfavourites.zip
  • Workspace uses workspace.zip
  • Multiple track ids is {accountcode}_download_{ddmmyyyy}_{counter} 
</downloadextended>  

Successful Response (isshare= “false” and forceemail= “false”)

The responsedownload returns an array of token objects. In most cases, there will be just one token, but where the download contains many tracks (typically in WAV or AIFF formats), there will be multiple parts to the download. In these cases, the package is split into multiple ZIP archives (up to 2GB in size each), and each token represents one of these ZIP files, and the corresponding part represents the ZIP file’s order within the package set.

Merge each TokenValue from the response object with AssetUrls.DirectDownloadUrl and make a request to it. You will need to launch a download for each token/part pair in this array.

Where multiple download tokens are returned, we recommend simultaneous requests to each link as these tokens have a very brief expiry time.

 
<responsemusicdownload>
<requestsent>false</requestsent>
<downloadtokens>
<downloadtoken>
<tokenvalue>
da498241aa0faac2338835d6e830499c
</tokenvalue>
<part>1</part>
</downloadtoken>
<downloadtoken>
<tokenvalue>
ac2338835d6e830499cda498241aa0fa
</tokenvalue>
<part>2</part>
</downloadtoken>
</downloadtokens>
</responsemusicdownload>

Successful Response (isshare= “true” or forceemail="true)

If the response body returns “requestsent=true” then the download will be sent using the email process. The member will receive an email with a download link. 

 

<responsemusicdownload>
<requestsent>true</requestsent>

</responsemusicdownload>

Error Response:

<responsemusicdownload>

 

<error>

<code>5</code>

<description>Invalid Token</description>

</error>

</responsemusicdownload>

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.