

The 7digital API gives developers and partners access to 7digital services and licensed catalogue of over 11m tracks allowing creation of new music applications ranging from simple music discovery websites to fully integrated download stores or full-length streaming services.
Most of the 7digital API is open to everyone and free for non-commercial use (with usage limits in place). Commercial/business use of the API requires a contract with 7digital.
API methods marked with PREMIUM icon also require a formal contract. If you’d like access to any of these methods please email us at api@7digital.com outlining the proposed usage and we'll get back to you.
API users will be given a unique API key (register here) that is used to access the API methods and can also be used to track any commissions due from sales that derive from API usage.


Access to the services provided by 7digital is provided through a REST style interface.
The production API is located at the following address:
http://api.7digital.com/1.2/A typical API request will look as follows:
http://api.7digital.com/1.2/artist/details?artistId=1&country=gb&oauth_consumer_key=YOUR_KEY_HERE
The supported HTTP method(s) are marked along each API method, e.g.
or
.
HTTP POST requests to the 7digital API require all their parameters (incl. country, page, etc parameters) to be supplied within the POST body in the application/x-www-form-urlencoded content type format, e.g.
POST http://api.7digital.com/1.2/user/signup emailaddress=test%2540test.com&password=123&country=gb&oauth_consumer_key=YOUR_KEY_HERE

Access to the 7digital API is controlled by a consumer key which needs to passed in parameter oauth_consumer_key with every request. API keys are issued upon request. To obtain one, please apply at developer.7digital.net.
API methods marked with the OAuth icon require requests to be signed using OAuth authentication protocol. For more details please see the OAuth Authentication section.


Standard responses will be returned in XML format.
A successful response will have the following format:
<response status="ok" version="1.2"> <response_content /> </response>

A response status of error means an error has occurred whilst processing a request. A failed request will instead of the results content contain an error message element:
<response status="error" version="1.2">
<error code="1001">
<errorMessage>Missing artist ID</errorMessage>
</error>
</response>
Error codes can be split into following categories:
1XXX - Invalid or missing input parameters
1001 - Required parameter missing
1002 - Invalid parameter value
1003 - Parameter value out of allowable range
1006 - Invalid enumeration value
1007 - Query string parameters are not permitted when performing HTTP Post. Please use Post body or header.
2XXX - Invalid resource reference
2001 - Resource cannot be found
2002 - Resource is not available in current context
2003 - Resource already exists
3XXX - User card errors
3001 - The user's card has expired
3002 - The user has no card details saved
3003 - Payment for this purchase has failed
7XXX - 7digital API application error
7001 - Unable to perform action
7002 - Application configuration error
7003 - Operation timed out
9xxx - Internal server error
9001 - Unexpected internal server error
Should you receive an error with error code 7000 and above please contact us with the details of the request that caused it and as much additional details as possible that might help us to reproduce it. Our API team will investigate the cause and respond to you promptly.

Should your API request fail authentication a response with HTTP Status Code 401 will be returned along with plain text message describing the reason of the authentication failure.
Please ensure you're using a valid api key and accessing the correct API endpoint.

Requests to some special methods will return a client redirect (e.g. basket/checkout) or serve a media file (e.g. track/streampreview) instead of an XML response.

For applications with high-volume usage or with frequent requests for the same data you are expected to store API responses in a local cache instead of making repeated requests.
The easiest way to enable caching in your application is by setting-up a proxy server between the application and 7digital API and make all API calls through this proxy. Alternatively you can implement caching directly in your code.
For convenience we provide HTTP cache control headers with each API response, which will provide you with information whether to cache a response from a particular API method and for how long (parameter max-age returns time in seconds). These are generally recommened values adjusted for each API method but you are free to use your own caching strategy should it suit your application better.
The following HTTP Cache control headers will be returned for methods that are recommended to be cached:
Cache-Control: private, max-age=432000 Last-Modified: Tue, 13 Apr 2010 15:03:49 GMT
For methods that are not recommended to be cached you will receive the bellow HTTP header:
Cache-Control: no-cache, no-store

Access to the 7digital API is rate limited. The limit currently applies to number of API requests made using a single api key per day (i.e. it is not split across end users or IP addresses). To find out what usage limits are in place for the free Public API please visit developer.7digital.net.
Responses from all rate limited API methods will include the following HTTP headers:
X-RateLimit-Limit: 4000 X-RateLimit-Current: 100 X-RateLimit-Reset: 123465Limit is the maximum number of requests allowed for your API key in given period, Current is the number of request already made in this period and Reset is number of seconds left until the end of the current period when the usage counters are reset.

You can minimize the size of all XML responses by using gzip compression. To get a compressed response you will need to provide the following header with your request:
Accept-Encoding: gzipThe max-age is recommended time in seconds to store the provided response in cache.

7digital download stores are available in several countries across the world. In order to be able to provide users with the maximum possible amount of content available in their country and display prices in their local currency whenever possible, all API methods accept a special parameter country. This parameter expects a 2 letter ISO country code (eg. GB, US, DE). If a country code is not supplied, all operations will be actioned on the default store - currently the UK one.
Commercial customers who have a dedicated shop with custom content set up should instead of country code use parameter shopId set to the id assigned to them. Please contact our business department to enquire about this option.

All API methods that return a list of items in the response accept the following paging parameters:
| name | type | use | description |
|---|---|---|---|
page | int | optional | Page number of the result set. If not supplied, defaults to 1 |
pageSize | int | optional | Number of items to be returned per page. If not supplied, defaults to 10. Maximum page size is 500 |
Paging information will also be included in the response as per the format bellow:
<page>1</page> <itemsPerPage>10</itemsPerPage> <totalItems>21</totalItems>

The size of images returned by any API response can be adjusted by adding imageSize parameter to the request
| name | type | use | description |
|---|---|---|---|
imageSize | int | optional | the requested width of the image in pixels |
For release cover art images the following sizes are supported:
Example
http://api.7digital.com/1.2/artist/releases?artistId=1&imageSize=350&oauth_consumer_key=YOUR_KEY_HERE
Artist pictures are available in these sizes::
Example
http://api.7digital.com/1.2/artist/details?artistId=1&imageSize=200&oauth_consumer_key=YOUR_KEY_HERE

Most of the API responses will consist of one or a list of standard objects as described below. The level of available detail in the response may vary depending on the method. In the examples below, all possible fields are included.

<artist id="14"> <name>The Charlatans</name> <sortName>Charlatans, The</sortName> <appearsAs>The Charlatans</appearsAs> <image>http://cdn.7static.com/static/img/artistimages/00/000/000/0000000014_50.jpg</image> <url>http://www.7digital.com/artists/the-charlatans/?partner=123</url> <popularity>0.53</popularity> </artist>Description of response fields:
| name | type | description |
|---|---|---|
artist@id | integer | unique identifier of artist in 7digital catalogue |
name | string | name of the artist (e.g. "The Pogues") |
appearsAs | string | name of the artist as it appears on the track or release (this field is only available when artist object is returned attached to a track or release, e.g. "The Pogues feat. Kirsty MacColl") |
sortName | string | name of the artist as used for sorting (e.g. "Pogues, The") |
image | URL | url of a picture of the artist |
url | URL | link to shop where artist's releases & tracks can be purchased |
popularity | decimal | a figure between 0 and 1 representing the artists popularity, currently only avaialble on the artist/search and artist/bytag/top endpoints |

Albums, singles and videos are all considered and referred to as releases.
Example response:<release id="155408">
<title>Dreams</title>
<version>UK</version>
<type>Album</type>
<barcode>00602517512078</barcode>
<year>2007</year>
<explicitContent>false</explicitContent>
<artist id="29755">
<name>The Whitest Boy Alive</name>
<appearsAs>The Whitest Boy Alive</appearsAs>
<url>http://www.7digital.com/artists/the-whitest-boy-alive/?partner=123</url>
</artist>
<image>http://cdn.7static.com/static/img/sleeveart/00/001/554/0000155408_50.jpg</image>
<url>http://www.7digital.com/artists/the-whitest-boy-alive/dreams-(1)/?partner=123</url>
<releaseDate>2007-10-22T00:00:00+01:00</releaseDate>
<addedDate>2007-10-11T12:18:29+01:00</addedDate>
<price>
<currency code="GBP">£</currency>
<value>5</value>
<formattedPrice>£5.00</formattedPrice>
<rrp>1.79</rrp>
<formattedRrp>£7.79</formattedRrp>
<isOnSale>true</isOnSale>
</price>
<formats availableDrmFree="True">
<format id="17">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>True</drmFree>
</format>
<format id="1">
<fileFormat>WMA</fileFormat>
<bitRate>192</bitRate>
<drmFree>False</drmFree>
</format>
</formats>
<label id="40">
<name>Universal-Island Records Ltd.</name>
</label>
<licensor id="1">
<name>Universal</name>
</licensor>
<popularity>0.38</popularity>
</release>
Description of response fields:
| name | type | description |
|---|---|---|
release@id | integer | unique identifier of the release in 7digital catalogue |
title | string | title of the release |
version | string | version title of the release |
type | enumeration | type of the release, one of: album/single/video |
barcode | string | barcode of the product (typically UPC) |
year | integer | year of the original release (as supplied to 7digital by the issuing label, where data is not available, year of the digital release) |
explicitContent | boolean | parental advisory - explicit content tag, as supplied to 7digital by the issuing label |
artist | artist object | primary artist of the release (subset of fields of the full artist details as described above) |
image | URL | url of the release cover picture |
url | URL | link to 7digital page where this release can be purchased |
releaseDate | datetime | date and time the release is available to download from |
addedDate | datetime | date and time the release has been added to 7digital catalogue |
price | price object | pricing information |
formats | list of format objects | list of formats the tracks appearing on this release are available in |
label | label object | contains 7digital id and name of the issuing label |
licensor | licensor object | id and name of the licensor who controls the rights to the release, currently only avaialble on the release/search endpoint |
popularity | decimal | a figure between 0 and 1 representing the release popularity, currently only avaialble on the release/search and release/bytag/* endpoints |

Each release contains 1 or more tracks. As the same track can appear on multiple releases to uniquely identify a track from a particular release you need to use both trackId and releaseId.
Example response:<track id="1628015">
<title>Burning</title>
<version />
<artist id="29755">
<name>The Whitest Boy Alive</name>
<appearsAs>The Whitest Boy Alive</appearsAs>
<url>http://www.7digital.com/artists/the-whitest-boy-alive/</url>
</artist>
<trackNumber>1</trackNumber>
<duration>189</duration>
<explicitContent>false</explicitContent>
<isrc>DED620600065</isrc>
<release id="155408">
<title>Dreams</title>
<version>UK</version>
<type>Album</type>
<artist id="29755">
<name>The Whitest Boy Alive</name>
<appearsAs>The Whitest Boy Alive</appearsAs>
<url>http://www.7digital.com/artists/the-whitest-boy-alive/?partner=123</url>
</artist>
<url>http://www.7digital.com/artists/the-whitest-boy-alive/dreams-1/?partner=123</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/001/554/0000155408_50.jpg</image>
</release>
<url>http://www.7digital.com/artists/the-whitest-boy-alive/dreams-1/01-Burning/?partner=123</url>
<price>
<currency code="GBP">£</currency>
<value>0.79</value>
<formattedPrice>£0.79</formattedPrice>
<rrp>0.79</rrp>
<formattedRrp>£0.79</formattedRrp>
<onSale>false</onSale>
</price>
</track>
Description of response fields:
| name | type | description |
|---|---|---|
track@id | integer | unique identifier of the track in 7digital catalogue |
title | string | title of the track |
version | string | version of the track (e.g. "Radio Edit") |
artist | artist object | the primary artist of the track |
order | integer | position the track appears on the release |
duration | integer | the length of the track in seconds |
explicitContent | boolean | parental advisory - explicit content tag, as supplied to 7digital by the issuing label |
isrc | string | ISRC code |
release | release object | release the track appears on |
url | URL | link to 7digital page where this release can be purchased |
price | price object | pricing information |

Both releases and tracks have prices. In some cases, the value is not specified and the formatted price shows "N/A". In this case, either the release is not purchasable (tracks have to be bought individually) or, conversely, if a track price doesn't have a value, the track is not available separately (the whole release has to be purchased).
Example response:<price> <currency code="GBP">£</currency> <value>1.79</value> <formattedPrice>£1.79</formattedPrice> <rrp>1.99</rrp> <formattedRrp>£1.99</formattedRrp> <onSale>true</onSale> </price>Description of response fields:
| name | type | description |
|---|---|---|
currency | string | currency symbol |
currency@code | string | code of the currency (ISO 4217) |
value | decimal | numerical value of the price |
formattedPrice | string | price pre-formatted to currencie's local format for easier displaying |
rrp | decimal | numerical value of recommended retail price |
formattedRrp | string | pre-formatted RRP |
onSale | boolean | specifies whether the item is currently on sale |

Format describes in what file format a track(s) is(are) available for download.
Example response:<format id="17"> <fileFormat>MP3</fileFormat> <bitRate>320</bitRate> <drmFree>True</drmFree> </format>Description of response fields:
| name | type | description |
|---|---|---|
format@id | integer | 7digital unique identifier of the format |
fileFormat | string | type of the media file format |
bitRate | integer | bitrate of the media file in kbit/s |
drmFree | boolean | specifies whether the format includes DRM protection |

All releases in 7digital's catalogue are associated with a label and licensor. Label is essentially a brand under which the release is issued, whereas licensor controls the recording rights for a release.
Although the label is typically more interesting to end consumers, 7digital only holds a contractual and commercial relationship with the licensor who determines when and how 7digital and its partners can sell the release.
Example response:<label id="32"> <name>Capitol Records</name> </label> <licensor id="13"> <name>EMI</name> </licensor>Description of response fields:
| name | type | description |
|---|---|---|
label id | integer | 7digital unique identifier of the label |
label name | string | name of the issuing label |
licensor id | integer | 7digital unique identifier of the licensor |
licensor name | string | name of the licensor |


status
This method returns the current server time.
Method specific parameters:None.
Example request:http://api.7digital.com/1.2/status?oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<serviceStatus>
<serverTime>2012-02-08T15:46:06Z</serverTime>
</serviceStatus>
</response>


artist/browse
This method returns a list of artists from the 7digital catalogue whose names match the start letter(s) supplied.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
letter | string | required | The first letter(s) of the artist name to browse. |
http://api.7digital.com/1.2/artist/browse?letter=p&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<artists>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>3256</totalItems>
<artist id="144641">
<name>P J Harvey</name>
<url>http://www.7digital.com/artists/p-j-harvey/?partner=123</url>
<sortName>P J Harvey</sortName>
<image>http://cdn.7static.com/static/img/artistimages/00/001/446/0000144641_50.jpg</image>
</artist>
<artist id="17168">
<name>P J Proby</name>
...
</artist>
...
</artists>
</response>
artist/chart
This method returns a chart of the most popular artists for given period.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
period | enumeration - one of: day/week/month | optional | The time period for which the chart is generated. Default value is a week. |
toDate | YYYYMMDD | optional | last day the chart includes data for, default value is yesterday's date |
http://api.7digital.com/1.2/artist/chart?period=week&toDate=20090601&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<chart>
<type>artist</type>
<fromDate>2009-03-24T00:00:00Z</fromDate>
<toDate>2009-03-30T00:00:00+01:00</toDate>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>20</totalItems>
<chartItem>
<position>1</position>
<change>Up</change>
<artist id="162872">
<name>The Last Shadow Puppets</name>
<url>http://www.7digital.com/artists/the-last-shadow-puppets/?partner=123</url>
</artist>
</chartItem>
<chartItem>
<position>2</position>
<change>Down</change>
...
</chartItem>
</chart>
</response>
artist/details
This method returns all available artist details.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
artistId | integer | required | unique identifier of the artist |
http://api.7digital.com/1.2/artist/details?artistid=1&country=GB&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<artist id="1">
<name>Keane</name>
<sortName>Keane</sortName>
<url>http://www.7digital.com/artists/keane/</url>
<image>http://cdn.7static.com/static/img/artistimages/00/000/000/0000000001_150.jpg</image>
</artist>
</response>
artist/releases
This method returns a list of releases by given artist. Releases can be filtered by type.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
artistId | integer | required | The unique identifier of the artist. |
type | enumeration - one of: album/single/video | optional | Releases can be of type album, single or video. If specified, results are filtered by release type. |
http://api.7digital.com/1.2/artist/releases?artistid=1&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<releases>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>42</totalItems>
<release id="172744">
<title>Live-Trailer</title>
<version />
<type>Video</type>
...
</release>
<release id="36567">
...
</release>
</releases>
</response>
artist/search
This method returns a list of artists from the 7digital catalogue that match the search query.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
q | string | required | The search query string. |
sort | string | optional | Orders the returned results. Supplied as a string in the format: "{sortColumn} {sortOrder}", for example: "popularity desc" will show most popular artists first regardless of search match score. Currently you can sort by name, popularity and score. If no sort is supplied, the default is "score desc". If no order is supplied the default is ascending. |
http://api.7digital.com/1.2/artist/search?q=pink&sort=score%20desc&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<searchResults>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>24</totalItems>
<searchResult>
<type>artist</type>
<score>21.4</score>
<artist id="226">
<name>Pink</name>
<url>http://www.7digital.com/artists/pink/?partner=123</url>
<sortName>Pink</sortName>
<image>http://cdn.7static.com/static/img/artistimages/00/000/002/0000000226_50.jpg</image>
<popularity>0.8</popularity>
</artist>
</searchResult>
<searchResult>
...
</searchResults>
</response>
artist/toptracks
This method returns a list of the most popular tracks by artist.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
artistId | integer | required | The unique identifier of the artist. |
pagesize | integer | optional | sets the number of releases that will be returned per page, the default is 10 |
page | integer | optional | sets the page to be returned in paged list of the customers releases and tracks, by default this is the first page. page=1 |
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
http://api.7digital.com/1.2/artist/toptracks?artistid=1&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<tracks>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>13</totalItems>
<track id="1628043">
<title>The Night Sky</title>
<version />
...
</track>
</tracks>
</response>
artist/similar
This method returns a list of artists similar to given artist.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
artistId | integer | required | The unique identifier of the artist. |
pagesize | integer | optional | sets the number of releases that will be returned per page, the default is 10 |
page | integer | optional | sets the page to be returned in paged list of the customers releases and tracks, by default this is the first page. page=1 |
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
http://api.7digital.com/1.2/artist/similar?artistid=1&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<?xml version="1.0" encoding="utf-8" ?>
<response status="ok" version="1.2">
<artists>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>28</totalItems>
<artist id="14">
<name>The Charlatans</name>
<sortName>Charlatans, The</sortName>
<url>http://www.7digital.com/artists/the-charlatans/?partner=1401</url>
<image>http://cdn.7static.com/static/img/artistimages/00/000/000/0000000014_150.jpg</image>
</artist>
<artist id="20">
<name>Coldplay</name>
<sortName>Coldplay</sortName>
<url>http://www.7digital.com/artists/coldplay/?partner=1401</url>
<image>http://cdn.7static.com/static/img/artistimages/00/000/000/0000000020_150.jpg</image>
</artist>
...
</artists>
</response>

release/bydate
This method returns release(s) by a specified date range.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
fromDate | date - format is YYYYMMDD | optional | The first day for which to include data. The default date is today's date. |
toDate | date - format is YYYYMMDD | optional | The last day for which to include data. The default date is today's date. |
http://api.7digital.com/1.2/release/bydate?fromDate=20090610&toDate=20090603&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<releases>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>10</totalItems>
<release id="445267">
<title>Devils Claws E.P</title>
<version></version>
<type>Album</type>
<barcode>5055285610081</barcode>
<year>2009</year>
...
<label id="21856">
<name>Brother Convention Records</name>
</label>
</release>
</releases>
</response>
release/chart
This method returns a chart of the most purchased releases for given period. Currently, only albums are included in this chart.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
period | enumeration - one of: week/month/year | optional | The time period for which the chart is generated. The default value is a week. |
toDate | date - format YYYYDDMM | optional | Last day the chart includes data for. The default value is yesterday's date. |
http://api.7digital.com/1.2/release/chart?period=month&todate=20080801&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2" >
<chart>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>20</totalItems>
<type>album</type>
<fromDate>2009-07-01T00:00:00+01:00</fromDate>
<toDate>2009-07-07T00:00:00+01:00</toDate>
<chartItem>
<position>1</position>
<change>New</change>
<release id="484694">
<title>Lungs</title>
<version></version>
<type>Album</type>
<barcode>00602527116761</barcode>
...
</release>
</chartItem>
</chart>
</response>
release/details
This method returns all available details for a given release.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
releaseId | integer | required | The unique identifier of the release. |
http://api.7digital.com/1.2/release/details?releaseid=155408&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2" >
<release id="155408">
<title>Dreams</title>
<version>UK</version>
<type>Album</type>
<barcode>00602517512078</barcode>
<year>2007</year>
<explicitContent>false</explicitContent>
<artist id="29755">
<name>The Whitest Boy Alive</name>
<appearsAs>The Whitest Boy Alive</appearsAs>
<url>http://www.7digital.com/artists/the-whitest-boy-alive/</url>
</artist>
<url>http://www.7digital.com/artists/the-whitest-boy-alive/dreams-1/</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/001/554/0000155408_50.jpg</image>
<releaseDate>2007-10-22T00:00:00+01:00</releaseDate>
<addedDate>2007-10-11T12:18:29+01:00</addedDate>
<price>
<currency code="GBP">£</currency>
<value>7.99</value>
<formattedPrice>£7.99</formattedPrice>
<rrp>7.99</rrp>
<formattedRrp>£7.99</formattedRrp>
<onSale>false</onSale>
</price>
<formats availableDrmFree="true">
<format id="17">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>true</drmFree>
</format>
</formats>
<label id="40">
<name>Universal-Island Records Ltd.</name>
</label>
</release>
</response>
release/recommend
This method returns list of recommended releases for given release or artist.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
releaseId / artistId | integer | required | The unique identifier of the recommended release or artist. Only ONE identifer can be specified in a request. |
http://api.7digital.com/1.2/release/recommend?releaseid=155408&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd" >
<recommendations>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>10</totalItems>
<recommendedItem>
<release id="34281">
<title>Sudden Rush</title>
<version></version>
<type>Single</type>
<barcode>0724355187055</barcode>
...
</release>
</recommendedItem>
</recommendations>
</response>
release/search
This method searches the 7digital catalogue for releases matching the search query. Results can be filtered by release type.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
q | string | required | The search query string. |
type | enumeration - one of: album/single/video | optional | If specified results are filtered by given release type (multiple types separated by commas can be passed). |
http://api.7digital.com/1.2/release/search?q=no%20surprises&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd" >
<searchResults>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>4393</totalItems>
<searchResult>
<type>release</type>
<score>1.9242628</score>
<release id="145882">
<title>No Surprises</title>
<version></version>
<type>Video</type>
<barcode>0094637383858</barcode>
...
</release>
</searchResult>
</searchResults>
</response>
release/tracks
This method will return a list of all tracks constituting the release.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
releaseId | integer | required | The unique ID of the release. |
http://api.7digital.com/1.2/release/tracks?releaseid=155408&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<tracks>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>10</totalItems>
<track id="1628015">
<title>Burning</title>
<version />
<artist id="29755">
<name>The Whitest Boy Alive</name>
<appearsAs>The Whitest Boy Alive</appearsAs>
...
</track>
</tracks>
</response>

track/chart
This method returns a chart of the most purchased tracks for given period.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
period | enumeration - one of: day/week/month | optional | The time period for which the chart is generated. Default value is a week. |
toDate | date - format is YYYYMMDD | optional | The last day the chart includes data for. Default value is yesterday's date. |
http://api.7digital.com/1.2/track/chart?period=week&toDate=20090301&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<chart>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>20</totalItems>
<type>track</type>
<fromDate>2009-02-23T00:00:00Z</fromDate>
<toDate>2009-03-01T00:00:00Z</toDate>
<chartItem>
<position>1</position>
<change>Down</change>
<track id="3540260">
<title>When I Grow Up</title>
<version />
<artist id="7059" >
...
</track>
</chartItem>
</chart>
</response>
track/details
This method returns various track details such as title and duration.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
trackId | integer | required | The unique identifier of the track. |
http://api.7digital.com/1.2/track/details?trackid=12345&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<track id="12345">
<title>I Love You</title>
<version />
<artist id="437">
<name>The Dandy Warhols</name>
<appearsAs>The Dandy Warhols</appearsAs>
<url>http://www.7digital.com/artists/the-dandy-warhols/?partner=123</url>
</artist>
<trackNumber>5</trackNumber>
<duration>252</duration>
<explicitContent>false</explicitContent>
<isrc>USCA29600191</isrc>
<type>audio</type>
<release id="1302">
<title>...The Dandy Warhols Come Down</title>
<version />
<type>Album</type>
...
</release>
</track>
</response>
track/preview
This method returns a link or redirects to a streamed preview clip of the track. The available length of the preview clip may vary between 30 to 60 seconds depnding on content provider.
Unless explicitly approved by 7digital and/or content providers any use of preview clips must be associated with a buy link to 7digital store or a buy option within your own app if you're Premium API consumer with integrated purchasing. Links must point directly to a page where the track/release can be purchased, generic links (e.g. to home page) are not acceptable. You must also ensure that the preview clips are not easily downloadable by end users (e.g. users should not be able to right click on a preview clip link in browser and choose "Save as.." to download the audio file).
Method specific parameters:| name | type | use | description |
|---|---|---|---|
trackId | integer | required | The unique identifier of the track to be streamed. |
redirect | true/false | optional | If set to true, a client redirect to the track download is returned - otherwise an XML response is returned. Default is true. |
http://api.7digital.com/1.2/track/preview?trackid=123Example response:
<response status="ok" version="1.2"> <url>http://stream.geo.7digital.com/clips/123/123456789.clip.mp3</url> </response>
track/search
This method will search for a track name that matches the supplied search query.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
q | string | required | The search query string. |
http://api.7digital.com/1.2/track/search?q=HappyExample response:
<response status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd">
<searchResults>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>4386</totalItems>
<searchResult>
<type>track</type>
<track id="2855447">
<title>Happy</title>
<version/>
...
</track>
</searchResult>
</searchResults>
</response>

tag
This method returns a list of all available tags.
Method specific parameters:None.
Example request:http://api.7digital.com/1.2/tag?oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd">
<tags>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>629</totalItems>
<tag id="pop">
<text>pop</text>
<url>http://www.7digital.com/tags/pop?partner=123</url>
<count>90847</count>
</tag>
<tag id="rock">
<text>rock</text>
<url>http://www.7digital.com/tags/rock?partner=123</url>
<count>52454</count>
</tag>
...
</tags>
</response>
artist/tags
This method returns all tags associated with the given artist.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
artistId | integer | required | The unique identifier of the artist. |
http://api.7digital.com/1.2/artist/tags?artistid=1&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<tags>
<tag id="rock">
<text>rock</text>
<url>http://www.7digital.com/tags/rock?partner=123</url>
</tag>
<tag id="united-kingdom">
<text>united kingdom</text>
<url>http://www.7digital.com/tags/united-kingdom?partner=123</url>
</tag>
...
</tags>
</response>
artist/bytag/top
This method returns a list of most popular artists tagged by a given tag or list of tags. If multiple tags are supplied only artists matching all of them will be returned.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
tags | string | required | A single or comma separated list of tags. |
http://api.7digital.com/1.2/artist/bytag/top?tags=rock,pop,2000s&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2">
<taggedResults>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>24</totalItems>
<taggedItem>
<type>artist</type>
<artist id="226">
<name>Pink</name>
<url>http://www.7digital.com/artists/pink/?partner=123</url>
<sortName>Pink</sortName>
<image>http://cdn.7static.com/static/img/artistimages/00/000/002/0000000226_50.jpg</image>
<popularity>0.53</popularity>
</artist>
</taggedItem>
<taggedItem>
...
</taggedItem>
</taggedResults>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
2001 | None of the provided tag(s) exist. | The tags you supplied do not exist |
release/tags
This method returns all tags associated with the given release.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
releaseId | integer | required | The unique identifier of the release. |
http://api.7digital.com/1.2/release/tags?releaseid=155408&oauth_consumer_key=YOUR_KEY_HERE&country=GBExample response:
<response status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd">
<tags>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>5</totalItems>
<tag id="rock">
<text>rock</text>
<url>http://www.7digital.com/tags/rock</url>
</tag>
<tag id="pop">
<text>pop</text>
<url>http://www.7digital.com/tags/pop</url>
</tag>
<tag id="electronic">
<text>electronic</text>
<url>http://www.7digital.com/tags/electronic</url>
</tag>
<tag id="indie-rock">
<text>indie rock</text>
<url>http://www.7digital.com/tags/indie-rock</url>
</tag>
<tag id="2000s">
<text>2000s</text>
<url>http://www.7digital.com/tags/2000s</url>
</tag>
</tags>
</response>
release/bytag/new
This method returns a list of new releases tagged by a given tag or list of tags. If multiple tags are supplied only releases matching all of them will be returned. The most recent releases are returned first.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
tags | string | required | tag or comma separated list of tags |
http://api.7digital.com/1.2/release/bytag/new?tags=rock&page=2&pageSize=100&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd" >
<taggedResults>
<page>2</page>
<pageSize>100</pageSize>
<totalItems>35451</totalItems>
<type>release</type>
<taggedItem>
<release id="416648">
<title>In Stereo</title>
<version></version>
<type>Album</type>
...
</release>
</taggedItem>
</taggedResults>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
2001 | None of the provided tag(s) exist. | The tags you supplied do not exist |
release/bytag/top
This method returns a list of most popular releases tagged by a given tag or list of tags. If multiple tags are supplied only releases matching all of them will be returned.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
tags | string | required | A single or comma separated list of tags. |
http://api.7digital.com/1.2/release/bytag/top?tags=rock&page=1&pageSize=10&oauth_consumer_key=YOUR_KEY_HEREExample response:
<?xml version="1.0" encoding="utf-8" ?>
<response status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd" >
<taggedResults>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>35451</totalItems>
<type>release</type>
<taggedItem>
<release id="398603">
<title>It's Blitz!</title>
<version></version>
<type>Album</type>
...
</release>
</taggedItem>
</taggedResults>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
2001 | None of the provided tag(s) exist. | The tags you supplied do not exist |

The Editorial API gives you access to content curated by the 7digital Editorial Team.


An editorial list containing multiple catalogue items. Some lists (e.g. seasonal promotions) may be empty at certain times in which case the list should not be displayed to user.
Example response:<list id="833">
<key>featured_albums</key>
<listItems>
<listItem id="123456">
<type>release</type>
<release id="1136112">
<title>Collapse Into Now</title>
<artist id="590">
<name>R.E.M.</name>
<appearsAs>R.E.M.</appearsAs>
<url>http://www.7digital.com/artists/r-e-m</url>
</artist>
<url>http://www.7digital.com/artists/r-e-m/collapse-into-now?partner=123</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/011/361/0001136112_50.jpg</image>
<explicitContent>false</explicitContent>
</release>
</listItem>
<listItem id="123457">
...
</listItem>
<listItem id="123458">
...
</listItem>
...
</listItems>
</list>
Description of response fields:
| name | type | description |
|---|---|---|
id | integer | Internal ID of the list. The "same" list can have different IDs in different countries, we recommend you allways refer to lists using their keys (see below) |
key | string | key used to refer to the same type of list (e.g. "Featured Albums") across different countries. |
listItems | ListItems list | list of ListItem objects |

individual item appearing in list
Example response:<listItem id="1136112">
<type>release</type>
<release id="1136112">
<title>Collapse Into Now</title>
<artist id="590">
<name>R.E.M.</name>
<appearsAs>R.E.M.</appearsAs>
<url>http://www.7digital.com/artists/r-e-m</url>
</artist>
<url>http://www.7digital.com/artists/r-e-m/collapse-into-now?partner=123</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/011/361/0001136112_50.jpg</image>
<explicitContent>false</explicitContent>
</release>
</listItem>
Description of response fields:
| name | type | description |
|---|---|---|
id | integer | internal ID identifying individual list item |
type | artist, release or track | defines type of an item |
artist/release/track | Artist, Release or Track object | depending on type, the list item will contain infromation on artist, release or track in standard 7digital API format. |

editorial/list
Returns a curated list of artists, releases or tracks. Avaiable editorial lists are described in the table below.
Please note that some lists might be empty for certain countries and/or at certain times in which case the list should not be displayed to users and we recommend to replace the empty list with the next editorial list in prominence order.
The following lists are currently published by our team:
| Title | Key | Num of items | Update frequency | Prominence | Description | Comment |
|---|---|---|---|---|---|---|
| Albums of the week | featured_albums | 2-6 | weekly | Highest | A list of handpicked albums which are considered as highlights of the week. | |
| New releases | new_releases | 12-24 | weekly | Highest | A longer list of priority new releases. Still handpicked, this list covers a broad selection of genres. | |
| On promotion | promo_selection | 0-48 | seasonal | Highest | A list of reduced albums and promotions. Attractive prices and seasonal catalogue designed to appeal to new customers. | Not allways available and not available in all countries |
| Pre-orders | preorders | 1-6 | weekly-fortnightly | High | A list of handpicked pre-orders, often major upcoming releases at promotional price. Sometimes future releases exclusive to 7digital. | |
| 7digital staff recommends | staff_recommendations | 6-12 | weekly | Lower | The 7digital staff is made up of true music lovers. This lists is what makes their heart beat. Often more obscure catalogue, less popular, off the beaten tracks. |
| name | type | use | description |
|---|---|---|---|
key | string | required | unique key referencing the list to be returned as provided by 7digital. See list of available editorial list and their keys. |
country | ISO 2-character country code | optional | For a localized list of content please provide a country code. The country will default to GB (UK) if it is not provided. |
http://api.7digital.com/1.2/editorial/list?key=featured_albums&country=GB&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<list id="833">
<key>featured_albums</key>
<listItems>
<listItem id="1136112">
<type>release</type>
<release id="1136112">
<title>Collapse Into Now</title>
<artist id="590">
<name>R.E.M.</name>
<appearsAs>R.E.M.</appearsAs>
<url>http://www.7digital.com/artists/r-e-m</url>
</artist>
<url>http://www.7digital.com/artists/r-e-m/collapse-into-now?partner=123</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/011/361/0001136112_50.jpg</image>
<explicitContent>false</explicitContent>
</release>
</listItem>
<listItem id="1165337">
<type>release</type>
<release id="1165337">
<title>Queens Of The Stone Age</title>
<artist id="5845">
<name>Queens Of The Stone Age</name>
<appearsAs>Queens Of The Stone Age</appearsAs>
<url>http://www.7digital.com/artists/queens-of-the-stone-age?partner=123</url>
</artist>
<url>http://www.7digital.com/artists/queens-of-the-stone-age/queens-of-the-stone-age-1?partner=123</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/011/653/0001165337_50.jpg</image>
<explicitContent>false</explicitContent>
</release>
</listItem>
</listItems>
</list>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
1001 | Required parameter missing | Not all mandatory parameters have been provided. |
2001 | The list was not found | List with given key has not been found. |

The basket API allows creation of 7digital hosted baskets which can be populated with items (tracks and releases) from the 7digital catalogue.
Please note: At the moment the baskets can only be checked out by using the Purchasing API method user/purchase/basket.

All methods dealing with baskets will upon successful execution return a basket object that can contain several basketItem objects. Structure of these response objects is described below.

<basket id="00000000-0000-0000-0000-000000000000">
<itemCount>1</itemCount>
<price>
<currency code="EUR">€</currency>
<value>0.99</value>
<formattedPrice>0,99€</formattedPrice>
</price>
<amountDue>
<currency code="EUR">€</currency>
<amount>0.99</amount>
<formattedAmount>0,99€</formattedAmount>
</amountDue>
<basketItems>
<basketItem id="15284882">
...
</basketItem>
<basketItem id="15284883">
...
</basketItem>
</basketItems>
</basket>
Description of response fields:
| name | type | description |
|---|---|---|
basket id | GUID | unique identifier of a basket |
itemCount | int | number of items in basket |
price | Price | Sum of catalogue prices of all items in the basket without any applicable discounts applied. This price does not need to be displayed to the end user. |
amountDue | AmountDue | Total amount to be paid at basket checkout. This price takes into account any applicable discounts and should always be used to dispay basket total to the end user. |
basketItems | BasketItems list | list of basketItem objects |

<basketItem id="15284882">
<type>track</type>
<itemName>Test</itemName>
<artistName>Ghetto</artistName>
<trackId>2458384</trackId>
<releaseId>224820</releaseId>
<price>
<currency code="EUR">€</currency>
<value>0.99</value>
<formattedPrice>0,99€</formattedPrice>
</price>
<amountDue>
<amount>0.99</amount>
<formattedAmount>0,99€</formattedAmount>
</amountDue>
<discount>
<type>Voucher</type>
</discount>
</basketItem>
Description of response fields:
| name | type | description |
|---|---|---|
basketItem id | int | unique identifier of the basketItem |
type | track, release | tracks or whole releases can be added to basket |
itemName | string | title of the item (track) in the basket |
artistName | string | name of the artist for the item in the basket |
trackId | int | ID of the track |
releaseId | int | ID of the release the track come from |
price | Price | The catalogue price of the item in the basket. This price does not reflect any discounts applied to the basket item and does not need to be displayed to the end user. |
amountDue | AmountDue | The amount the user will be charged for this item at basket checkout. This price takes into account any applicable discounts and should always be used to dispay basket item prices to the end user. |
discount | string | this element will be present only if a discount has been applied to the basket item. At the moment the only available discount type is "Voucher" |

basket
This method retrieves an existing basket and its contents.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
basketId | GUID | required | The unique identifier of the basket as acquired by basket/create method |
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
http://api.7digital.com/1.2/basket?basketId=00000000-0000-0000-0000-000000000000&country=DE&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<basket id="00000000-0000-0000-0000-000000000000">
<itemCount>1</itemCount>
<price>
<currency code="EUR">€</currency>
<value>0.99</value>
<formattedPrice>0,99€</formattedPrice>
</price>
<amountDue>
<currency code="EUR">€</currency>
<amount>0.99</amount>
<formattedAmount>0,99€</formattedAmount>
</amountDue>
<basketItems>
<basketItem id="15284882">
<type>track</type>
<itemName>Test</itemName>
<artistName>Ghetto</artistName>
<trackId>2458384</trackId>
<releaseId>224820</releaseId>
<price>
<value>0.99</value>
<formattedPrice>0,99€</formattedPrice>
</price>
<amountDue>
<amount>0.99</amount>
<formattedAmount>0,99€</formattedAmount>
</amountDue>
</basketItem>
</basketItems>
</basket>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
1001 | Missing parameter "parameter name" | Not all mandatory parameters have been provided. |
1002 | Value of parameter "parameter name" is not valid | Value for parameter in error message is not valid. |
2001 | Basket with basketId not found. | Basket with given ID does not exist. |
2002 | Basket with basketId is unavailable in this country / shop. | The basket has been created in different country and can only be accessed in the country where it was created. |
basket/create
This method creates an empty basket and returns the new basket with it's basketId.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
http://api.7digital.com/1.2/basket/create?country=DE&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<basket id="00000000-0000-0000-0000-000000000000">
<itemCount>0</itemCount>
<price>
<currency code="GBP">£</currency>
<value>0</value>
<formattedPrice>£0.00</formattedPrice>
</price>
<amountDue>
<currency code="GBP">£</currency>
<amount>0</amount>
<formattedAmount>£0.00</formattedAmount>
</amountDue>
<basketItems/>
</basket>
</response>
basket/addItem
This method adds a track or release to a basket.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
basketId | GUID | required | identifier of the basket as acquired by basket/create method |
releaseId | int | required | identifier of the release to add to the basket |
trackId | int | optional | identifier of the track being added to the basket. You must also specify the releaseId that the track belongs to. |
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
affiliatePartner | int | optional | Overrides affiliate tracking id when adding an item to the basket. |
http://api.7digital.com/1.2/basket/additem?basketid=00000000-0000-0000-0000-000000000000&releaseid=160553&trackid=1693930&country=GB&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<basket id="00000000-0000-0000-0000-000000000000">
<itemCount>1</itemCount>
<price>
<currency code="EUR">€</currency>
<value>0.99</value>
<formattedPrice>0,99€</formattedPrice>
</price>
<amountDue>
<currency code="EUR">€</currency>
<amount>0.99</amount>
<formattedAmount>0,99€</formattedAmount>
</amountDue>
<basketItems>
<basketItem id="15284882">
<type>track</type>
<itemName>Test</itemName>
<artistName>Ghetto</artistName>
<trackId>2458384</trackId>
<releaseId>224820</releaseId>
<price>
<value>0.99</value>
<formattedPrice>0,99€</formattedPrice>
</price>
<amountDue>
<amount>0.99</amount>
<formattedAmount>0,99€</formattedAmount>
</amountDue>
</basketItem>
</basketItems>
</basket>
</response>
basket/removeItem
This method removes an item from a basket.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
basketId | GUID | required | The unique identifier of the basket as acquired by basket/create method |
itemId | int | required | basketItem ID of the item to be removed |
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
http://api.7digital.com/1.2/basket/removeitem?basketid=00000000-0000-0000-0000-000000000000&itemid=15965085&country=DE&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<basket id="00000000-0000-0000-0000-000000000000">
<itemCount>0</itemCount>
<price>
<currency code="EUR">€</currency>
<value>0.00</value>
<formattedPrice>0,00€</formattedPrice>
</price>
<amountDue>
<currency code="EUR">€</currency>
<amount>0.00</amount>
<formattedAmount>0,00€</formattedAmount>
</amountDue>
<basketItems/>
</basket>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
1001 | Missing parameter "parameter name" | Not all mandatory parameters have been provided. |
1002 | Value of parameter "parameter name" is not valid | Value for parameter in error message is not valid. |
2001 | Basket with basketId not found. | Basket with given ID does not exist. |
2001 | Basket item with id not found. | Basket does not contain an item with given ID. |
2002 | Basket with basketId is unavailable in this country / shop. | The basket has been created in different country and can only be accessed in the country where it was created. |
basket/applyVoucher



This method applies a voucher to a basket. If a valid voucher code has been applied the response will return an updated basket with the applied discount reflected in the amountDue element of the basket item the voucher has been applied to. The amountDue element of the basket total will be updated accordingly as well. The price element will remain unchanged and will reflect the original catalogue price of the item and basket.
To finalize purchase the basket needs to be checked-out using user/purchase/basket method.
If the voucher code cannot be redeemed against any items in the basket an error response will be returned.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
basketId | GUID | required | The unique identifier of the basket as acquired by basket/create method |
voucherCode | string | required | Voucher code that will be redeemed against items in the basket. |
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
https://api.7digital.com/1.2/basket/applyvoucher?basketid=00000000-0000-0000-0000-000000000000&vouchercode=ABC123&oauth_consumer_key=YOUR_KEY_HEREExample response:
<response status="ok" version="1.2">
<basket id="00000000-0000-0000-0000-000000000000">
<itemCount>1</itemCount>
<price>
<currency code="EUR">€</currency>
<value>0.99</value>
<formattedPrice>0,99€</formattedPrice>
</price>
<amountDue>
<currency code="EUR">€</currency>
<amount>0</amount>
<formattedAmount>0,00€</formattedAmount>
</amountDue>
<basketItems>
<basketItem id="15284882">
<type>track</type>
<itemName>Test</itemName>
<artistName>Ghetto</artistName>
<trackId>2458384</trackId>
<releaseId>224820</releaseId>
<price>
<value>0.99</value>
<formattedPrice>0,99€</formattedPrice>
</price>
<amountDue>
<amount>0</amount>
<formattedAmount>0,00€</formattedAmount>
</amountDue>
<discount>
<type>Voucher</type>
</discount>
</basketItem>
</basketItems>
</basket>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
1001 | Missing parameter "parameter name" | Not all mandatory parameters have been provided. |
1002 | Value of parameter "parameter name" is not valid | Value for parameter in error message is not valid. |
2001 | Basket with basketId not found. | Basket with given ID does not exist. |
2002 | Basket with basketId is unavailable in this country / shop. | The basket has been created in different country and can only be accessed in the country where it was created. |
3012 | Voucher not applied | Voucher was not applied for any of the following reasons: - the voucher code is not valid - the voucher has expired - it cannot be redeemed against any items in the basket - it has been fully redeemed already |

7digital API uses OAuth protocol to control access to some premium and user related API methods.
Several OAuth libraries for various programming languages are availble, some of them can be found at here: http://oauth.net/code/.

2-legged OAuth authentication is used to control access to methods thad do not involve 7digital users.
In addition to method specific parameters each OAuth signed API requests will need to include additional OAuth protocol parameters and the full URL has to be signed using your consumer secret.
| name | type | use | description |
|---|---|---|---|
oauth_consumer_key | string | required | your API access key you have been assigned by 7digital |
oauth_nonce | string | required | a random string uniquely generated for each request |
oauth_timestamp | integer | required | timestamp of the request (number of seconds since Jan 1 1970 0:00:00 GMT) |
oauth_signature_method | string | required | signature method used to sign the request (currently only HMAC-SHA1 supported) |
oauth_signature | string | required | generated from the API request URL and all the parameter name/value pairs of the request (inc. other OAuth params) using oauth_consumer_secret you have been assigned. Full proccess is described in OAuth Core 1.0 document |
oauth_version | string | optional | version of OAuth protocol in use. If present, value must be 1.0 |
If you're not using an existing OAuth library (you really should be) and you're trying to implement OAuth signature generation yourself note that in 2-legged OAuth the signature key used to generate the oauth_signature is comprised of your consumer secret and empty token secret (since no user token is involved). The format of the key is: "<consumer secret>&" (the ampersand needs to be present). The full specification can be found in the OAuth Consumer Request 1.0 Draft 1 memo.
A fully signed 2-legged OAuth request will look like this:
http://api.7digital.com/1.2/method?oauth_consumer_key=YOUR_KEY_HERE&oauth_nonce=4279849&oauth_signature_method=HMAC-SHA1 &oauth_timestamp=1249989128&methodparameter=somevalue&oauth_signature=Fop%Fdgw35qDr83VQME97rBEnxs8%3D


Three legged OAuth is a mechanism that allows you (the 7digital API consumer) to access standard 7digital user accounts and act on behalf of the users. Instead of using usernames and passwords 7digital assigns you a token for the user (explicitly authorized for you by the user), which then allows you to make user related requests without the need for the user to authenticate each request/session.
A good starting place for learning how 3-legged OAuth works is the Beginner's Guide To OAuth published by Hueniverse. It has a useful introduction to the workflow process of 3-legged OAuth: www.hueniverse.com/hueniverse/2007/10/beginners-gui-1.html.
In terms of the 7digital API, there are two sides to 3-legged authentication:

All requests made to authenticate a user must be OAuth signed by the consumer. The steps for authenticating a user are:
1. The API consumer requests a ‘request token’ from the 7digital API using oauth/requesttoken
2. The API consumer directs the user to the 7digital authentication page located at: ???
3. The user is redirected back to the API consumer’s website
4. The API consumer makes a request to exchange the authorised request token for an access token using oauth/accesstoken

Once an API consumer has an access token for a user, it can be used to sign requests to allow the API consumer to request user resources (locker, checkout, etc.)
The primary difference between 3-legged OAuth requests and 2-legged OAuth requests is how the request is signed:
1. The access token must be provided as 'oauth_token' along with the other OAuth parameters. Format: http://api.7digital.com/a/resource?<standard oauth params>&oauth_token=D3432KG5O9opT563Fe5ijnE4I9LmJJ32
2. The signature key is comprised of the consumer secret and the token secret. Format: "<consumer secret>&<token secret>"

oauth/requesttoken


Requests a new request token for 3-legged authentication
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_consumer_key | string | required | The only requirement for this method is that the request is OAuth signed. |
xoauth_client_identifier | string | optional | An arbitrary string that will be stored with the token. This string will be displayed to the user along with the token for easier reference to an account or device that the token is linked to. The identifier has to be meaningful to the end user, e.g. "IMEI: 1234564546" (device serial number), "john2004" (user's login name on your website). |
https://api.7digital.com/1.2/oauth/requesttoken?oauth_consumer_key=YOUR_KEY_HERE&oauth_nonce=ABCDEF&oauth_timestamp=1234567890&oauth_signature_method= HMAC-SHA1&oauth_signature=4KO5478ghJ49Olsp3kJ3L589Ssslg5o5Example response:
<response status="ok" version="1.2">
<oauth_request_token>
<oauth_token>ABCD123456</oauth_token>
<oauth_token_secret>d2I8uj7yaoa39KKdu3upasybu98f89fln</oauth_token_secret>
</oauth_request_token>
</response>
User authentication - authorising a request token

This is not an API method, but the URL that displays the form that a user will authenticate themselves to 7digital with.
After authenticating the user, the request will be redirected back to the API consumer's website (if returnUrl has been supplied).
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | required | The oauth_token value returned to the API consumer from an oauth/requesttoken request. |
oauth_callback | URL | optional | The URL that 7digital will use to hand the user authentication back to the requesting API consumer. |
https://account.7digital.com/YOUR_KEY_HERE/oauth/authorise?oauth_token=AAAAAAA&oauth_callback=http%3a%2f%2fapi-consumer.com%2fhandback%3fconsumerparam%3dvalueExample response:
HTTP/1.x 302 Found Location: http://api-consumer.com/handback?consumerparam=value?oauth_token=AAAAAA&status=Authorised
oauth/accesstoken


Grants an access token in exchange for an authorised request token. This method must be OAuth signed, using the original request token key and signature as described above.
Although not expiring automatically after a certain period of time, access tokens (and also autohrised request tokens) can be revoked by users at any time.
In the near future we will also enforce a limit of maximum of 3 access tokens that can be active at the same time per one 7digital user account, api consumer key and xoauth_client_identifier combination. If a user has already approved 3 access tokens for your service, the next time you acquire another access token for this same user the first access token will automatically expire.
If the nature of your service allows/requires users to maintain multiple connections to a single 7digital account you are advised to use a distinct xoauth_client_identifier for each connection. E.g. if a user of your service has registered 5 different accounts ("joe_home", "joe_work", etc) and they want to link all these accounts to a single 7digital account you need to provide an xoauth_client_identifier (xoauth_client_identifier=joe_home, xoauth_client_identifier=joe_work, etc) at the stage of acquiring an oauth/requesttoken. For device based integrations we recommend to use device names (if available) or serial numbers or IMEIs for mobiles as the identifier.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | required | The original request token. |
https://api.7digital.com/1.2/oauth/accesstoken?oauth_consumer_key=YOUR_KEY_HERE&oauth_nonce=ABCDEF&oauth_timestamp=1234567890&oauth_signature_method= HMAC-SHA1&oauth_token=yu87230J29DT7tyuGslO98wrR43e39Of&oauth_signature=lth409pPr989rmMjaE9po3h34oKER89eExample response:
<response status="ok" version="1.2">
<oauth_access_token>
<oauth_token>E3w4FV3oirRfj4KfT7alOpa893mmn4HJ</oauth_token>
<oauth_token_secret>923kj3Kspa304n4Oamd3201pLkgjeM32</oauth_token_secret>
</oauth_access_token>
</response>

user/locker


Returns a paged list of all releases and tracks with download URLs from a User's locker (library of all purchased tracks). This method must be OAuth signed.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | integer | required | user's OAuth accesstoken |
pagesize | integer | optional | sets the number of releases that will be returned per page, the default is 10 |
page | integer | optional | sets the page to be returned in paged list of the customers releases and tracks, by default this is the first page. page=1 |
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
releaseId | integer | optional | The 7digital ID of the release to be that we are interested in. You will use this to filter out and return a specific release from the user's locker. Will return an empty locker response if no match is found. |
trackId | integer | optional | If supplied together with the releaseId, will returned only that specific track (provided it exists in user locker). Will return an empty locker response if no match is found. |
purchaseId | integer | optional | If supplied will return only the releases and tracks for that basket. Will return an error if no tracks are found. |
sort | string | optional | Orders the returned results. Supplied as a string in the format: "{sortColumn} {sortOrder}", for example: "purchaseDate desc" will show recent purchases first. Currently you can sort by releaseTitle (asc or desc), purchaseDate (asc or desc) and artistName (asc or desc). If no sort is supplied, the default is "releaseTitle asc". If no order is supplied the default is ascending. |
http://api.7digital.com/1.2/user/locker?sort=purchaseDate%20desc&oauth_token=...Example response:
<response status="ok" version="1.2">
<locker>
<lockerReleases>
<page>1</page>
<pageSize>10</pageSize>
<totalItems>1</totalItems>
<lockerRelease>
<release id="302123">
<title>Original Album Classics</title>
<version/>
<type>Album</type>
<artist id="1194">
<name>Patti Smith</name>
<appearsAs>Patti Smith</appearsAs>
<url>http://www.7digital.com/artists/patti-smith/?partner=123</url>
</artist>
<url>http://www.7digital.com/artists/patti-smith/original.../?partner=123</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/003/021/0000302123_50.jpg</image>
<releaseDate>2008-06-16T00:00:00+01:00</releaseDate>
</release>
<lockerTracks>
<lockerTrack>
<track id="3544116">
<title>Gloria</title>
<version>Digitally Remastered 1996</version>
<artist id="1194">
<name>Patti Smith</name>
<appearsAs>Patti Smith</appearsAs>
<url>http://www.7digital.com/artists/patti-smith/?partner=123</url>
</artist>
<url>http://www.7digital.com/artists/patti-smith/original.../01-Gloria?partner=123</url>
</track>
<remainingDownloads>355</remainingDownloads>
<purchaseDate>2009-07-22T11:41:41+01:00</purchaseDate>
<downloadUrls>
<downloadUrl>
<url>http://media.geo.7digital.com/media/user/downloadtrack...</url>
<format id="17">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>true</drmFree>
</format>
</downloadUrl>
</downloadUrls>
</lockerTrack>
</lockerTracks>
</lockerRelease>
</lockerReleases>
</locker>
</response>

The Purchasing API allows 3rd parties to deliver digital content to individual users. The API offers 2 ways of handling user payements for the delivered content:

Users' payments for all delivered content are handled by 7digital.
Users will need to have a valid payment method set up on their 7digital account. Due to security and legal reasons this cannot be done by a 3rd party via the API but only by the user directly on a page hosted by 7digital. They can do so either at the payments page at account.7digital.com which can be skinned (for details see separate 7digital account website documentation) or 7digital users can do so also on any 7digital consumer website (e.g. www.7digital.com).
The only available payment method at the moment is credit/debit card payments.
user/purchase/item



This method allows a user to purchase an item at the price as advertised on 7digital.com. It will return the download URL of each item purchased. For example, if a release consisting of multiple tracks was purchased, then the download URL of each item constituting the release will be returned.
For a user purchase to be processed, the user should already have a default debit or credit card set up for payments.
This method allows users to take advantage of 7digital.com promotional offers and is only available to selected partners building 7digital branded integrations. For white-label integrations please use user/purchase/rrpItem or user/purchase/pricedItem.
| name | type | use | description |
|---|---|---|---|
oauth_token | integer | required | user's OAuth accesstoken |
releaseId | integer | required | The unique ID of the release being purchased. If a track is being purchased, this needs to identify the release the track appears on. |
trackId | integer | optional | The unique ID of the track being purchased. If supplied, only the track is delivered - otherwise the full release is delivered. |
price | decimal | required | The price that has been displayed to the user prior to purchase. If the actual 7digital.com price is different to the supplied value the purchase is aborted and 3004 error message is returned instead. This is used to ensure the users cannot be charged a different amount than the advertised price (e.g. if the price was cached and/or has changed after it was displayed.) |
country | ISO 2-character country code | optional | The code of the country the end user resides in. The country will default to GB if not provided. |
shopid | integer | optional | The shop ID that all basket items were selected from. The shop ID will default to the 7digital UK shop if it is not provided. If the shop ID is provided, the country parameter will be ignored. |
tag_*key* | string | optional | Additional data to be stored with successful transactions, for the purposes such as tagging affiliated or marketing information. up to 10 tags can be stored. A tag key can be a maximum of 50 characters, and a tag value a maximum of 100 characters. E.g. tag_MyPartner=MagazinePromoABC&tag_ApplicationVersion=1.5. This data will only be available to API clients subscribing to customized sales reports service. |
http://api.7digital.com/1.2/user/purchase/item?releaseid=786&trackid=6598&price=0.99&oauth_token=...Example response:
<response status="ok" version="1.2">
<purchase id="123">
<purchaseDate>2009-08-10T11:00:00+01:00</purchaseDate>
<lockerReleases>
<lockerRelease>
<release id="1">
<title>Ill Communication</title>
<version/>
<type>Album</type>
<artist id="357">
<name>Beastie Boys</name>
<appearsAs>Beastie Boys</appearsAs>
<url>http://www.7digital.com/artists/beastie-boys</url>
</artist>
<url>http://www.7digital.com/artists/beastie-boys</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/004/915/0000491573_350.jpg</image>
</release>
<lockerTracks>
<lockerTrack>
<track id="456">
<title>Sabotage</title>
<version/>
<artist id="0">
<name>Beastie Boys</name>
<appearsAs>Beastie Boys</appearsAs>
<url>http://www.7digital.com/artists/beastie-boys</url>
</artist>
<url>http://www.7digital.com/artists/beastie-boys/ill.../06-Sabotage-(2009-Digital-Remaster)/</url>
</track>
<remainingDownloads>3</remainingDownloads>
<purchaseDate>2009-08-10T11:00:00+01:00</purchaseDate>
<downloadUrls>
<downloadUrl>
<url>http://media.geo.7digital.com/media/user/downloadtrack...</url>
<format id="1">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>true</drmFree>
</format>
</downloadUrl>
</downloadUrls>
</lockerTrack>
</lockerTracks>
</lockerRelease>
</lockerReleases>
</purchase>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
3001 | The user's card has expired | The user's default payment hard has expired. |
3002 | The user has no card details saved | User did not register a payment method. Before making a purchase on user's behalf they need to register a payment card. |
3003 | Payment for this purchase has failed | The payment with the default payment card have been declined by the bank (e.g. card details not valid, insufficient funds, etc). The card used will be automatically marked as inactive and user will have to re-enter new payment card. |
3004 | Price supplied is out of date | The price displayed to the user and supplied in price parameter is no longer valid. The user has not been charged. You can retrieve the updated price, notify the user of the change and repeat the purchase request. |
user/purchase/rrpItem



This method allows a user to purchase an item at 7digital recommended retail price (RRP). It will return the download URL of each item purchased. For example, if a release consisting of multiple tracks was purchased, then the download URL of each item constituting the release will be returned. For a user purchase to be processed, the user should already have a default debit or credit card set up for payments.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | integer | required | user's OAuth accesstoken |
releaseId | integer | required | The unique ID of the release being purchased. If a track is being purchased, this needs to identify the release the track appears on. |
trackId | integer | optional | The unique ID of the track being purchased. If supplied, only the track is delivered - otherwise the full release is delivered. |
price | decimal | required | The price that has been displayed to the user prior to purchase. If the actual 7digital recommended retail price is different to the supplied value the purchase is aborted and 3004 error message is returned instead. This is used to ensure the users cannot be charged a different amount than the advertised price (e.g. if the price was cached and/or has changed after it was displayed.) |
country | ISO 2-character country code | optional | The country that all basket items were selected from. The country will default to UK if it is not provided. Provide this if you are purchasing from a territory other than the UK. |
shopid | integer | optional | The shop ID that all basket items were selected from. The shop ID will default to the 7digital UK shop if it is not provided. If the shop ID is provided, the country parameter will be ignored. |
tag_*key* | string | optional | Additional data to be stored with successful transactions, for the purposes such as tagging affiliated or marketing information. up to 10 tags can be stored. A tag key can be a maximum of 50 characters, and a tag value a maximum of 100 characters. E.g. tag_MyPartner=MagazinePromoABC&tag_ApplicationVersion=1.5. This data will only be available to API clients subscribing to customized sales reports service. |
http://api.7digital.com/1.2/user/purchase/rrpItem?releaseid=786&trackid=6598&price=0.99&oauth_token=...Example response:
<response status="ok" version="1.2">
<purchase id="123">
<purchaseDate>2009-08-10T11:00:00+01:00</purchaseDate>
<lockerReleases>
<lockerRelease>
<release id="1">
<title>Ill Communication</title>
<version/>
<type>Album</type>
<artist id="357">
<name>Beastie Boys</name>
<appearsAs>Beastie Boys</appearsAs>
<url>http://www.7digital.com/artists/beastie-boys</url>
</artist>
<url>http://www.7digital.com/artists/beastie-boys</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/004/915/0000491573_350.jpg</image>
</release>
<lockerTracks>
<lockerTrack>
<track id="456">
<title>Sabotage</title>
<version/>
<artist id="0">
<name>Beastie Boys</name>
<appearsAs>Beastie Boys</appearsAs>
<url>http://www.7digital.com/artists/beastie-boys</url>
</artist>
<url>http://www.7digital.com/artists/beastie-boys/ill.../06-Sabotage-(2009-Digital-Remaster)/</url>
</track>
<remainingDownloads>3</remainingDownloads>
<purchaseDate>2009-08-10T11:00:00+01:00</purchaseDate>
<downloadUrls>
<downloadUrl>
<url>http://media.geo.7digital.com/media/user/downloadtrack...</url>
<format id="1">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>true</drmFree>
</format>
</downloadUrl>
</downloadUrls>
</lockerTrack>
</lockerTracks>
</lockerRelease>
</lockerReleases>
</purchase>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
3001 | The user's card has expired | The user's default payment hard has expired. |
3002 | The user has no card details saved | User did not register a payment method. Before making a purchase on user's behalf they need to register a payment card. |
3003 | Payment for this purchase has failed | The payment with the default payment card have been declined by the bank (e.g. card details not valid, insufficient funds, etc). The card used will be automatically marked as inactive and user will have to re-enter new payment card. |
3004 | Price supplied is out of date | The price displayed to the user and supplied in price parameter is no longer valid. The user has not been charged. You can retrieve the updated price, notify the user of the change and repeat the purchase request. |
user/purchase/basket



This method allows a user to purchase a basket with items that have been added via basket/additem or basket/addpriceditem. It will return the download URL of each item purchased. For example, if a release consisting of multiple tracks was purchased, then the download URL of each item constituting the release will be returned.
If total amount due for a basket is greater than 0, the user will need to have a valid debit or credit card set up for payments otherwise a 300X error will be returned. Upon receiving a 300X error you should redirect the user to a new payment method registration screen (see Adding a payment card)
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | integer | required | user's OAuth accesstoken |
basketid | GUID | required | This is the session ID for the basket that contains the items to purchase. This is the basketid returned from basket/create. |
country | ISO 2-character country code | optional | The country that all basket items were selected from. The country will default to UK if it is not provided. Provide this if you are purchasing from a territory other than the UK. |
shopid | integer | optional | The shop ID that all basket items were selected from. The shop ID will default to the 7digital UK shop if it is not provided. If the shop ID is provided, the country parameter will be ignored. |
tag_*key* | string | optional | Additional data to be stored with successful transactions, for the purposes such as tagging affiliated or marketing information. up to 10 tags can be stored. A tag key can be a maximum of 50 characters, and a tag value a maximum of 100 characters. E.g. tag_MyPartner=MagazinePromoABC&tag_ApplicationVersion=1.5. This data will only be available to API clients subscribing to customized sales reports service. |
http://api.7digital.com/1.2/user/purchase/basket?basketid=00000000-0000-0000-0000-000000000000&country=FR&oauth_token=...Example response:
<response status="ok" version="1.2">
<purchase id="123">
<purchaseDate>2009-08-10T11:00:00+01:00</purchaseDate>
<lockerReleases>
<lockerRelease>
<release id="1">
<title>Ill Communication</title>
<version/>
<type>Album</type>
<artist id="357">
<name>Beastie Boys</name>
<appearsAs>Beastie Boys</appearsAs>
<url>http://www.7digital.com/artists/beastie-boys</url>
</artist>
<url>http://www.7digital.com/artists/beastie-boys</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/004/915/0000491573_350.jpg</image>
</release>
<lockerTracks>
<lockerTrack>
<track id="456">
<title>Sabotage</title>
<version/>
<artist id="0">
<name>Beastie Boys</name>
<appearsAs>Beastie Boys</appearsAs>
<url>http://www.7digital.com/artists/beastie-boys</url>
</artist>
<url>http://www.7digital.com/artists/beastie-boys/ill-communication-remastered-version/06-Sabotage-(2009-Digital-Remaster)/</url>
</track>
<remainingDownloads>3</remainingDownloads>
<purchaseDate>2009-08-10T11:00:00+01:00</purchaseDate>
<downloadUrls>
<downloadUrl>
<url>http://media.geo.7digital.com/media/user/downloadtrack?formatid=1&oauth_consumer_key=YOUR_KEY_HERE&...</url>
<format id="1">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>true</drmFree>
</format>
</downloadUrl>
</downloadUrls>
</lockerTrack>
<lockerTrack>
<track id="789">
<title>Root Down</title>
<version/>
<artist id="0">
<name>Beastie Boys</name>
<appearsAs>Beastie Boys</appearsAs>
<url>http://www.7digital.com/artists/beastie-boys</url>
</artist>
<url>http://www.7digital.com/artists/beastie-boys/ill-communication-remastered-version/05-Root-Down-(2009-Digital-Remaster)/</url>
</track>
<remainingDownloads>3</remainingDownloads>
<purchaseDate>2009-08-10T11:00:00+01:00</purchaseDate>
<downloadUrls>
<downloadUrl>
<url>http://media.geo.7digital.com/media/user/downloadtrack?formatid=1&oauth_consumer_key=YOUR_KEY_HERE&...</url>
<format id="1">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>true</drmFree>
</format>
</downloadUrl>
</downloadUrls>
</lockerTrack>
</lockerTracks>
</lockerRelease>
</lockerReleases>
</purchase>
</response>
Method specific errors:
| code | message | description |
|---|---|---|
3001 | The user's card has expired | The user's default payment hard has expired. |
3002 | The user has no card details saved | User did not register a payment method. Before making a purchase on user's behalf they need to register a payment card. |
3003 | Payment for this purchase has failed | The payment with the default payment card have been declined by the bank (e.g. card details not valid, insufficient funds, etc). The card used will be automatically marked as inactive and user will have to re-enter new payment card. |
Adding a payment card


Due to security reasons this is not a standard API method, but a 7digital hosted secure web page that displays a form for adding payment card details directly by the user.
We recommend you direct users to this page only after attempting a purchase first and receiving one of the payment failed errors. This improves user experience by asking for payment details only when they're actually needed (rather than e.g. during registration) and also deals with situations when user has already registered a payment card previously through one of 7digital services (no need to ask for card details again) or when your application is aware that given user has registered payment card but this card has expired in the mean time or has insufficient funds, etc (user will need to enter new card details).
After successfully adding a card it will be set as default payment method for any subsequent user/purchase/* calls and the user will be redirected back to the API consumer's website or application (if returnUrl has been supplied).
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | optional | user's OAuth accesstoken, if provided and the requests has a valid OAuth signature the user will be automatically signed in. Otherwise the user will be presented with a sign in page before reaching the add card form |
country | ISO 3166-1 Alpha-2 code | optional | ISO 3166-1 Alpha-2 code of the country the user resides in. If not supplied defaults to UK. |
lang | ISO 639-1 code | optional | ISO 639-1 code of the language the add card form will be displayed in. Currently supported languages are: en, es, it, de, nl, pt and fr. If not provided the language will be picked according to the country parameter. |
returnUrl | URL | optional | Once the card has been added successfully user will be redirected to this URL. If not provided user will be redirected to a page listing all registered payment methods. |
https://account.7digital.com/YOUR_KEY_HERE/payment/addcard?oauth_token=AAAAAAA&returnUrl=http%3a%2f%2fapi-consumer.com%2fhandback%3fconsumerparam%3dvalueExample response:
HTTP/1.x 302 Found Location: http://api-consumer.com/handback?consumerparam=value
Displaying a list of active payment cards


Like the above this is not a standard API method, but a 7digital hosted secure web page that displays a list of active cards for given user. User's can set any of their cards as default payment method as well as delete any of the cards on file. Users can also register additional card directly form this page.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | optional | user's OAuth accesstoken, if provided and the requests has a valid OAuth signature the user will be automatically signed in. Otherwise the user will be presented with a sign in page before reaching the page with list of their cards |
country | ISO 3166-1 Alpha-2 code | optional | ISO 3166-1 Alpha-2 code of the country the user resides in. If not supplied defaults to UK. |
lang | ISO 639-1 code | optional | ISO 639-1 code of the language the add card form will be displayed in. Currently supported languages are: en, es, it, de, nl, pt and fr. If not provided the language will be picked according to the country parameter. |
https://account.7digital.com/YOUR_KEY_HERE/payment?oauth_token=AAAAAAA&returnUrl=http%3a%2f%2fapi-consumer.com%2fhandback%3fconsumerparam%3dvalue

The below methods allow you to customize the price items are being sold for to the cusomters. 7digital will charge the user price specified by you, report the sale price to labels and invoice you the difference between the wholesale prices and the prices the items have been sold for.
basket/addpriceditem



This method allows an item to be added to a basket with a specified price. The specified price can be higher or lower than the 7digital catalogue price, including a price of 0.00 to make an item free.
For a full description of the basket responses, please refer to the Basket API section in the 7digital public API documentation.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
basketId | guid | required | The unique identifier of the basket generated by the basket/create method |
price | decimal | required | The custom price for the item to add to the basket e.g. "11.95". The price cannot be negative and must not be more than 2 decimal places. The price should not include any commas (","). |
releaseId | int | required | The unique identifier of the release |
trackId | int | optional | The unique identifier of the track. If supplied, you must also supply the releaseId that the track belongs to. |
http://api.7digital.com/1.2/basket/addpriceditem?basketid=00000000-0000-0000-0000-000000000000&releaseid=123&price=12.30Example response:
<response status="ok" version="1.2">
<basket id="00000000-0000-0000-0000-000000000000">
<itemCount>1</itemCount>
<price>
<currency code="GBP">£</currency>
<value>12.3</value>
<formattedPrice>£12.30</formattedPrice>
</price>
<amountDue>
<currency code="GBP">£</currency>
<value>12.3</value>
<formattedAmount>£12.30</formattedAmount>
</amountDue>
<basketItems>
<basketItem id="17590164">
<type>release</type>
<itemName>Even Better Than The Real Thing (Remix)</itemName>
<artistName>U2</artistName>
<trackId></trackId>
<releaseId>123</releaseId>
<price>
<value>12.3</value>
<formattedPrice>£12.30</formattedPrice>
</price>
<amountDue>
<value>12.3</value>
<formattedAmount>£12.30</formattedAmount>
</amountDue>
</basketItem>
</basketItems>
</basket>
</response>
user/purchase/priceditem



This method allows a user to purchase a product or track at a specified price. The specified price can be higher or lower than the 7digital catalogue price, including a price of 0.00 to make an item free.
It will return the download URL of each item purchased. For example, if a release consisting of multiple tracks was purchased, then the download URL of each item constituting the release will be returned.
The user should already have a default debit or credit card set up for payments.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | required | user's OAuth accesstoken |
price | decimal | required | The custom price for the item to add to the basket e.g. "11.95". The price cannot be negative and must not be more than 2 decimal places. The price should not include any commas (","). |
releaseId | integer | required | The unique ID of the release being purchased. If a track is being purchased, this needs to identify the release the track appears on. |
trackId | integer | optional | The unique ID of the track being purchased. If supplied, only the track is delivered - otherwise the full release is delivered. |
country | ISO 2-character country code | optional | The country that all basket items were selected from. The country will default to UK if it is not provided. Provide this if you are purchasing from a territory other than the UK. |
shopid | integer | optional | The shop ID that all basket items were selected from. The shop ID will default to the 7digital UK shop if it is not provided. If the shop ID is provided, the country parameter will be ignored. |
http://api.7digital.com/1.2/user/purchase/priceditem?releaseid=10147&trackid=103818&price=2.00&country=FR&oauth_token=...Example response:
<response status="ok" version="1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://localhost/api/static/7digitalAPI.xsd">
<purchase id="49193524">
<purchaseDate>2009-11-25T18:29:08Z</purchaseDate>
<lockerReleases>
<lockerRelease>
<release id="10147">
<title>Siamese Dream</title>
<version />
<type>Album</type>
<artist id="7041">
<name>The Smashing Pumpkins</name>
<appearsAs>The Smashing Pumpkins</appearsAs>
<url>http://www.7digital.com/artists/the-smashing-pumpkins/?partner=123</url>
</artist>
<url>http://www.7digital.com/artists/the-smashing-pumpkins/siamese-dream/?partner=123</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/000/101/0000010147_50.jpg</image>
<releaseDate>2005-04-05T00:00:00+01:00</releaseDate>
</release>
<lockerTracks>
<lockerTrack>
<track id="103818">
<title>Cherub Rock</title>
<version />
<artist id="7041">
<name>The Smashing Pumpkins</name>
<appearsAs>The Smashing Pumpkins</appearsAs>
<url>http://www.7digital.com/artists/the-smashing-pumpkins/?partner=123</url>
</artist>
<url>http://www.7digital.com/artists/the-smashing-pumpkins/siamese-dream/01-Cherub-Rock?partner=123&partner=123</url>
</track>
<remainingDownloads>225</remainingDownloads>
<purchaseDate>2009-11-24T14:51:56Z</purchaseDate>
<downloadUrls>
<downloadUrl>
<url>http://media.geo.7digital.com/media/user/downloadtrack?formatid=17&oauth_consumer_key=test-api-extUsers&oauth_nonce=5954041&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1259173749&oauth_token=12345678&releaseid=10147&shopid=34&trackid=103818&oauth_signature=FAo3MI%2Bn%2FoVjm7AX8GJ2otA3fp8%3D</url>
<format id="17">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>true</drmFree>
</format>
</downloadUrl>
</downloadUrls>
</lockerTrack>
</lockerTracks>
</lockerRelease>
</lockerReleases>
</purchase>
</response>

If you have an existing online store which can already handle payments and you would like to integrate digital downloads you can use the bellow API methods. 7digital will deliver the content to the user on your request and you will be invoiced for all deliveries made. Depending on your contract 7digital will also handle all labels and charts reporting.
user/deliveritem



This method will deliver a track or release to user and return a purchase id identifying the transaction at 7digital's end and release and track information along with download URL for each track from the transaction.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | required | user's OAuth accesstoken |
emailAddress | string | optional | The email address of the User. |
releaseId | integer | required | The 7digital ID of the release being delivered to the user. If a track is being delivered, this needs to identify the release the track appears on. |
trackId | integer | optional | If supplied, only the track is delivered - otherwise the full release is delivered. |
country/shopId | country code/integer | optional | A Country Code needs to be provided if you are delivering content from a 7digital international shop. Provide a shop ID if you have a dedicated pool of content and you have been assigned a shop ID by 7digital. |
transactionId | string | required | The transaction ID provided will be stored along with a 7digital purchase ID in the 7digital transactions log. |
retailPrice | decimal | optional | Compulsory if you are charging your users different prices than 7digital RRP. If you're giving away items for free please use retailPrice=0, if you're using vouchers or you're not sure what to report please contact our sales team. |
http://api.7digital.com/1.2/user/deliveritem?country=US&trackId=4648051&releaseid=415019&transactionid=test4343&oauth_token=...Example response:
<response status="ok" version="1.2">
<purchase id="50454737">
<purchaseDate>2009-11-10T14:59:39Z</purchaseDate>
<lockerReleases>
<lockerRelease>
<release id="415019">
<title>Perfect Symmetry</title>
<version>US Album</version>
<type>Album</type>
<artist id="1">
<name>Keane</name>
<appearsAs>Keane</appearsAs>
<url>http://us.7digital.com/artists/keane/</url>
</artist>
<url>http://us.7digital.com/artists/keane/perfect-symmetry-6/</url>
<image>http://cdn.7static.com/static/img/sleeveart/00/004/150/0000415019_50.jpg</image>
<releaseDate>2008-10-14T00:00:00+01:00</releaseDate>
</release>
<lockerTracks>
<lockerTrack>
<track id="4648051">
<title>Spiralling</title>
<version></version>
<artist id="1">
<name>Keane</name>
<appearsAs>Keane</appearsAs>
<url>http://us.7digital.com/artists/keane/</url>
</artist>
<url>http://us.7digital.com/artists/keane/perfect-symmetry-6/01-Spiralling/</url>
</track>
<remainingDownloads>15</remainingDownloads>
<purchaseDate>2009-11-10T14:47:11Z</purchaseDate>
<downloadUrls>
<downloadUrl>
<url>
http://media.geo.7digital.com/media/user/downloadtrack?formatid=17&
</url>
<format id="17">
<fileFormat>MP3</fileFormat>
<bitRate>320</bitRate>
<drmFree>true</drmFree>
</format>
</downloadUrl>
</downloadUrls>
</lockerTrack>
</lockerTracks>
</lockerRelease>
</lockerReleases>
</purchase>
</response>

Media delivery API allows end users to download or stream previously purchased content.
Please note that the location of the Media deliver API is different:
https://media.geo.7digital.com/media

Media delivery is different to most API methods, in that generally they are requested directly by the user's browser or device, and the resulting media file is returned directly to the user (bypassing your servers).
Because of this, in case of an error the Media delivery API doesn't return XML data, but instead sends a redirect request to a URL of your choosing, with the error information appended as query string parameters. By redirecting back to a URL on your server you can handle media errors in the most suitable way for your application.
In the event of an error the server always returns a 302 HTTP status code and a Location header starting with the errorUrl you supplied.
If no errorUrl parameter is supplied, the Location header will point to a standard 7digital error page.
If you are ingesting downloads within your own application and want to handle errors, you can have the application watch the status codes returned. In the event of a `302` status code, check the location header. If it starts with the errorUrl you supplied then treat this response as an error. You can then parse the location header for the 'errorCode' query string parameter.
Example error redirect:
HTTP/1.x 302 Found Location: http://example.com/error/?errorCode=1001&errorMsg=Error%3a+Missing+%27trackId%27+query+parameter.

user/downloadtrack

Allows the user to download a previsouly purchased track.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | required | user's OAuth access token |
trackId | int | required | The unique identifier of the track to be downloaded |
releaseId | integer | required | The 7digital ID of the release the track that is being delivered appears on. |
formatId | integer | required | 7digital unique identifier of the format (from the list provided for each track by the purchasing API or locker response) |
errorUrl | url | optional | Callback URL in the event of an error |
http://media.geo.7digital.com/media/user/downloadtrack?trackid=123456&releaseid=123456&formatid=17&errorUrl=http%3a%2f%2fexample.com%2ferrorExample response:
HTTP/1.1 200 OK Date: Thu, 19 Nov 2009 11:27:47 GMT Content-Length: 7256280 Content-Disposition: attachment; filename="David Hasselhoff - Jump In My Car.mp3"; Content-Type: audio/x-mp3
user/streamtrack


Allows user to stream a previsouly purchased track. Acquiring the track using this method will not decrement user's remaining downloads for this track.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | required | user's OAuth access token |
trackId | int | required | The unique identifier of the track to be downloaded |
releaseId | integer | required | The 7digital ID of the release the track that is being delivered appears on. |
formatId | integer | required | 7digital unique identifier of the requested stream format. For 64kbps streams please us formatId=50 and for 128kbps streams use formatId=26. |
errorUrl | url | optional | Callback URL in the event of an error |
http://stream.geo.7digital.com/media/user/streamtrack?trackid=123456&releaseid=123456&formatid=50&errorUrl=http%3a%2f%2fexample.com%2ferrorExample response:
HTTP/1.1 200 OK Date: Thu, 19 Nov 2009 11:27:47 GMT Content-Length: 7256280 Content-Disposition: attachment; filename="David Hasselhoff - Jump In My Car.mp3"; Content-Type: audio/x-mp3
user/download/release


Allows user to download a ZIP file of a previously purchased release. Acquiring the release using this method will decrement user's remaining downloads for each track in the release.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | required | user's OAuth access token |
releaseId | int | required | The 7digital ID of the previously purchased release by the user to be downloaded |
formatId | int | optional | 7digital unique identifier of the format (from the list provided for each track by the purchasing API or locker response) |
errorUrl | url | optional | Callback URL in the event of an error |
http://media.geo.7digital.com/media/user/download/release?releaseid=123456&errorUrl=http%3a%2f%2fexample.com%2ferrorExample response:
HTTP/1.1 200 OK Date: Thu, 19 Nov 2009 11:27:47 GMT Content-Length: 7256280 Content-Disposition: attachment; filename="Dardem - Nada.zip"; Content-Type: application/zip
user/download/purchase


Allows user to download a ZIP file of a previously purchased basket. Acquiring the contents of the basket using this method will decrement user's remaining downloads for each track in the basket.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token | string | required | user's OAuth access token |
purchaseId | int | required | This is the ID of the purchase as returned by the user/purchase/* or user/deliveritem methods |
errorUrl | url | optional | Callback URL in the event of an error |
http://media.geo.7digital.com/media/user/download/purchase?purchaseId=123456&errorUrl=http%3a%2f%2fexample.com%2ferrorExample response:
HTTP/1.1 200 OK Date: Thu, 19 Nov 2009 11:27:47 GMT Content-Length: 7256280 Content-Disposition: attachment; filename="7digital_Downloads_21-10-2010.zip"; Content-Type: application/zipMethod specific errors:
| code | message | description |
|---|---|---|
1001 | Error: Missing "parameter name" query parameter. | User did not specify all mandatory parameters. |
1002 | Invalid value for "parameter name": parameter value | Value for parameter in error message is not valid. |
2002 | No licences available for download request. | All of the licences for the files have expired. |
2002 | No licences found for the download request. | Either the purchase Id supplied does not exist or does not belong to the User supplied, or the User does not exist. |

These methods will give you direct access to media files provided by 7digital. Unlike user/downloadtrack or user/streamtrack these do not require user to own given track in their locker.
track/stream


This method allows the streaming of any track within the 7digital catalogue. The track does not need to be previously purchased. Only tracks available (and past their release date) in user's country will be available for streaming.
This method is not intended to be requested by users directly in a browser and as such does NOT redirect to an errorUrl in the event of an error.
Important: For security reasons this method can only be used when 7digital API access credentials (consumer key and secret) are only stored within a secure infrastructure, i.e. on your servers. The streaming links cannot be generated by client apps directly.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
oauth_token / userId | string | required | If you hold a 7digital oauth access token for the user streaming the track this needs to be provided. If not, you can pass your own identifier of the user (ID, GUID, username, etc). For streaming services that don't require users to sign, please contact us for alternative options of providing user identification (e.g. device IDs, autogenerated IDs stored in a cookie) |
trackId | int | required | The unique identifier of the track to be downloaded |
releaseId | integer | optional | The 7digital ID of the release the track that is being delivered appears on. |
formatId | integer | optional | 7digital unique identifier of the requested stream format. For 64kbps MP3 streams please us formatId=50 and for 128kbps MP3 streams use formatId=26. The default formatId is 26 (128kbps MP3). |
country | string | optional | Two character country code. If not supplied, this request will default to GB |
http://stream.geo.7digital.com/media/track/stream?trackid=123456&releaseid=123456&formatid=50&country=DEExample response:
HTTP/1.1 200 OK
Date: Thu, 19 Nov 2009 11:27:47 GMT
Content-Length: 7256280
Content-Disposition: inline; filename="David Hasselhoff - Jump In My Car.mp3";
Content-Type: audio/x-mp3
Method specific errors:
| code | message | description |
|---|---|---|
1001 | Error: Missing "parameter name" query parameter. | User did not specify all mandatory parameters. |
1002 | Invalid value for "parameter name": parameter value | Value for parameter in error message is not valid. |
2001 | Track not found | Track does not exist in the catalogue. |
2002 | Track is not available in this country/shop | Track exists in the catalogue but is not available at the moment, this might be because it is not licensed in the country specified; it has been taken off on the label's request; it is on pre-order. |
track/download


This method will allow you to download any track from 7digital catalogue without the need to deliver the track to user first.
Method specific parameters:| name | type | use | description |
|---|---|---|---|
trackId | integer | required | 7digital ID of the track to be served for download |
formatId | integer | required | 7digital unique identifier of the requested download format (as provided by Catalogue API) |
userId | string | optional | your unique ID of the user the track is to be downloaded by. This is used purely for reporting (and might possibly be required depending on your contract with 7digital) |
country | string | optional | Two character country code. If not supplied, this request will default to GB |
errorUrl | string | optional | If supplied, the error response will be a redirect to the supplied errorUrl. When not supplied, an HTTP status code is returned |
http://media.geo.7digital.com/media/track/download?trackid=123456&formatid=50&country=DEExample response:
HTTP/1.1 200 OK Date: Thu, 19 Nov 2009 11:27:47 GMT Content-Length: 7256280 Content-Disposition: attachment; filename="David Hasselhoff - Jump In My Car.mp3"; Content-Type: audio/x-mp3Method specific errors:
| code | message | description |
|---|---|---|
1001 | Error: Missing "parameter name" query parameter. | User did not specify all mandatory parameters. |
1002 | Invalid value for "parameter name": parameter value | Value for parameter in error message is not valid. |
2001 | Track not found | Track does not exist in the catalogue. |
2002 | Track is not available in this country/shop | Track exists in the catalogue but is not available at the moment, this might be because it is not licensed in the country specified; it has been taken off on the label's request; it is on pre-order. |

For commercial customers, we also offer premium functionality subject to contract. This includes management of own pool of user or direct access to media file streaming and downloads. Please contact us for more information.