Where should you start?

Explore our catalogue or learn about our streaming API documentation, jump to our API usage and brand guidelines or check the full Open API Terms & Conditions

Like what you see?

SIGN UP TO OUR API

Affilliate links

Creating affiliate links to 7digital on web and mobile

Linking to 7digital web store

All 7digital API responses automatically include affiliated "buy" links to our (desktop) web store at 7digital.com. All you need to do is display these links to your users and any purchases made after following these links will be tracked under your 7digital affiliate account.

E.g. for an artist details API call

http://api.7digital.com/1.2/artist/details?artistid=1&oauth_consumer_key...

the response will look like this (see the buy URL highlighted):

<response status="ok" version="1.2">
  <artist id="1">
    <name>Keane</name>   
    <sortName>Keane</sortName>   
    <url>http://www.7digital.com/artists/keane/?partner=1234</url>
    <image>http://cdn.7static.com/static/img/artistimages/00/000/000/0000000001_150...
  </artist>
</response>

Your 7digital Partner ID

Whilst links to mobile store or apps are not included in the API responses it's easy to create them yourself. Before starting you'll need to know your 7digital partner ID which you can find in your  API registration email received from us after signing up for an API key (if you've signed up after Jun 11 2013).

Alternatively you can also find out what it is by making any API request using your 7digital API key as described above and look for ?partner=XXXX in the buy links (<url>) generated for you. In our example above your partner ID would be 1234.

Once you know your partner ID you can choose one from one of the mobile linking options below:

7digital Buy button

Check-out the 7digital Buy button instructions page for an easy way to embed music purchasing buttons into your website or mobile app. It provides streamlined checkout experience and is optimized for both desktop and mobile devices.

7digital Android Affiliate SDK

The easiest way to link to 7digital on Android is to use our 7digital Android Affiliate SDK available on GitHub.

This SDK contains a simple library that provides 'shortcuts' to perform common actions on the 7digital Android app.

7digital Android App Intents

The 7digital Music app for Android offers an integrated player and MP3 music store. That means you can discover, buy and listen to music anywhere, and sync and play any music you have previously purchased.

Download the 7digital Android app directly to your phone from Google Play.

The 7digital Android App supports following intents:

VIEW_ARTIST - opens artist screen

Intent i = new Intent();
i.setClassName("uk.co.sevendigital.android", "uk.co.sevendigital.android.library.shop.SDIExternalActionActivity");
i.setAction("uk.co.sevendigital.android.intent.action.VIEW_ARTIST");
i.putExtra("uk.co.sevendigital.android.intent.extra.PARTNER", partnerId);
i.putExtra("ARTISTID",artistId);
startActivity(i);

partnerId is your 7digital partner ID as described above
artistId is the 7digital artist ID

VIEW_RELEASE - opens release screen (with optional track highlighting)

Intent i = new Intent();
i.setClassName("uk.co.sevendigital.android", "uk.co.sevendigital.android.library.shop.SDIExternalActionActivity");
i.setAction("uk.co.sevendigital.android.intent.action.VIEW_RELEASE");
i.putExtra("uk.co.sevendigital.android.intent.extra.PARTNER", partnerId);
i.putExtra("RELEASEID",releaseId);
i.putExtra("TRACKID",trackId);
startActivity(i);

partnerId is your 7digital partner ID as described above
releaseId is the 7digital release ID
trackId - optional parameter - if provided the selected track is highlighted on the release screen

SEARCH - opens search results screen

Intent i = new Intent("uk.co.sevendigital.android.intent.action.SEARCH");
i.putExtra(SearchManager.QUERY, searchQuery);
i.putExtra("uk.co.sevendigital.android.intent.extra.PARTNER", partnerId);
startActivity(i);

partnerId is your 7digital partner ID as described above
searchQuery is the query string that's being searched for

For every intent you will need to catch an exception for the case where the 7digital application is not installed.

Here's an example how you can handle this by replacing startActivity with your own custom start7digitalActivity:

/**
 *  Start the 7digital application. On failure, go to the Google Play if it is installed.
 *  @param i The Intent used to start the Activity
 */
protected void start7digitalActivity(Intent i) {
  try {
    startActivity(i);
  } catch (ActivityNotFoundException e) {
    Toast.makeText(this,
      R.string.the_7digital_not_installed_please_install_it_from_google_play_,
      Toast.LENGTH_LONG).show();
    // Take user to market
    String marketQuery = "market://details?id=uk.co.sevendigital.android";
    Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(marketQuery));
    try {
      startActivity(intent);
    } catch (ActivityNotFoundException e1) {
      Toast.makeText(this,
        R.string.google_play_not_found_please_install_the_7digital_app_manually_,
        Toast.LENGTH_LONG).show();
    }
  }
}

7digital Buy button

We aim to make buying tracks as convenient as possible.

Our nifty little tool allows our partners to embed a 7digital Buy Button into a website in 3 simple steps.  The button will allow users to purchase a track/release without leaving the website they’re on.

See it in action right here:



Or, take a look at our demo blog.

Please note that the 7digital Buy Button is still under beta. You may notice variations in the look and feel of the checkout process whilst we're working out the best user experience based on customers' feedback. If you do use the buttons on your site, or have any feedback, please reach out with the 7digital API Community.

Add it to your blog or website

The 7digital Buy button is very simple to set-up and can be done in 3 easy steps:

  1. Copy & paste the code into the HTML on your site
  2. Replace the CAPITALISED_TEXT with the desired track/release IDs and your partner ID
  3. Include JavaScript library (if necessary*)

OPTION 1 - Embedded iframe

Music bloggers will love this simple way of creating a button:

<iframe src="https://instant.7digital.com/iframe.htm?releaseid=RELEASE_ID&trackid=TRA..." seamless="seamless" frameborder="0" height="40" scrolling="no"></iframe>

*If you’re using the iframe version you do not need to include the JavaScript library.

OPTION 2 - CSS class

This option gives you full control of the look and feel of the button but requires you to be able to include JavaScript libraries (listed below) to all pages where the buy buttons are used.

Creating a buy button for a track:

<button class="7d-buynow" data-trackid="TRACK_ID" data-partner="YOUR_PARTNER_ID">BUY</button>

Creating a buy button for a release (album):

<button class="7d-buynow" data-releaseid="RELEASE_ID" data-partner="YOUR_PARTNER_ID">BUY</button>

You must then include the following script tag at the end of your html page:

<script type="text/javascript" src="https://instant.7digital.com/scripts/dist/7d-buyitnow.min.js"></script>

Then - any element you click on with the correctly specified class (7d-buynow) will become a 7digital Buy Button.

More examples

Couple of more examples can be found on GitHub:

  • Basic buttons
  • Top tracks Chart
  • Top albums Chart
  • Search for tracks
  • Search for releases

 

All come with a full source code.

Add it to your desktop or mobile app

You can also integrate the Buy Button into a native application by opening the following URLs in a webview within the app:

https://instant.7digital.com/purchase/track/TRACK_ID?partnerId=YOUR_PARTNER_ID

https://instant.7digital.com/purchase/release/RELEASE_ID?partnerId=YOUR_PARTNER_ID

For a sample implementation with source code check-out our Android Buy Button demo app on Github. It will show you how the 7digital Buy Button can be added to an Android app to enable users to purchase a track or release without leaving your app.