Building a Subscription Streaming Service

This guide is aimed at helping you get started with creating a Subscription Streaming Service. It will guide you to the relevant API endpoints to help you integrate with the MassiveMusic platform.\

Postman public workspace

A collection of sample requests for each endpoint using Postman can be accessed here under Integration Guides.

High-level integration overview

941


1. Accessing the Catalogue Metadata

1.1 Catalogue Events

The first integration step is to access the standard metadata for the catalogue. You should integrate with the Catalogue Events product, which pushes real time updates to the catalogue. The catalogue can then be stored and maintained within your own infrastructure for management of discovery and curation in your service.

Catalogue events are delivered as they're ingested by MassiveMusic, and therefore each event represents a snapshot of the release details at that time. Subsequent events should 'overwrite' the original event as they represent more recent updates to that release. There is a single event type, a Release Event. Each release event will contain metadata relating to the Artist(s), Release and Track(s) contained within that release, as well as availability data about the release.

Technical details on how to integrate with the Catalogue Events product can be found here.

2. Setting up your users

2.1 Creating users

For each user of your Subscription Streaming Service, you need to create a user with MassiveMusic. When creating a user simply use a unique identifier as MassiveMusic will not store any other identifiable or login information (e.g. passwords, usernames).

Use the following endpoint to create a new user:

Attribute

Type

Description

userId *

string

Your 3rd party user identifier can be an arbitrary string up to 255 chars. The userId is permanent and cannot be changed once created.

country*

string

ISO 2-character code of the country the end user resides in.

🚧

Error Codes

1001 - Missing parameter - A required parameter is missing
1002 - Invalid parameter value - A parameter has been supplied with invalid value
2003 - User already exists - A user with this user id has already been created


2.2 Setting up Subscriptions

To grant your users permission to stream music, you will need to set up a subscription against each user created with MassiveMusic.

MassiveMusic does not manage the billing process for subscription services or facilitates any payments related to user subscriptions. As such, you will need to process the billing yourself and notify MassiveMusic of new subscriptions or changes to existing accounts.

Use the following endpoint to create a subscription:

When creating subscriptions, it is essential to set the content type to application/x-www-form-urlencoded.

Attribute

Type

Description

userID*

string

The unique identifier of the user. For information on creating users click here.

planCode*

string

The current subscription type. Please contact your Client Success Manager for more details on how to supply the correct planCode.

status*

string

The status of the subscription must be set as active.

currency*

string

ISO 4217 currency code, relating to the currency in which the subscriber is paying

recurringFee*

integer

The amount in cents charged to the subscriber for the current subscription. If a voucher has been used then recurringFee should be 0.

postcode

string

The postcode of the subscriber if applicable.

country*

string

ISO 2-character country code where the subscriber is located.

activatedAt*

string

ISO 8601 UTC date-time format. The date and time when the user first activated any type of subscription. activatedAt must be now or earlier.

currentPeriodStartDate*

string

ISO 8601 UTC date-time format. The date and time when the current subscription started.CurrentPeriodStartDate must be no more than 1 day from now, and the same as or later than activatedAt.

trialEndsAt

string

ISO 8601 UTC date-time format. This is the date and time of when a trial period ends. If you are using a trail plan code, then this value must be populated. Otherwise this parameter must not be supplied. Please contact your Client Success Manager for more details on how to supply the correct planCode.

Otherwise this parameter must not be supplied. TrialEndsAt must be later than currentPeriodStartDate and no more than 100 days from currentPeriodStartDate.

expiryDate*

string

ISO 8601 UTC date-time format. The date and time when the subscription is due to expire.

ExpiryDate must be no more than 1 month from currentPeriodStartDate. If the subscription is a trial, expiryDate must also be the same as or later than trialEndsAt.

In the exceptional case that trialEndsAt is more than 1 month from currentPeriodStartDate, expiryDate must be equal to trialEndsAt.

Header

Type

Description

Content-Type*

String

Set to: "application/x-www-form-urlencoded"


2.3 Managing Offline Access

For your users who have been assigned a offline access planCode, you can authorise them to listen to music offline. Please contact your Client Success Manager for more details on how to supply the correct planCode. Tracks will be cached to the user's device, which will enable them to listen to music when there is no active internet connection.

Use the following endpoint to enable offline streaming:

The POST body can be sent in either XML or JSON formats.

Attribute

Type

Description

userId*

integer

The unique identifier of the user. For information on creating users click here.

clientId*

integer

A unique identifier for the current device wanting to go offline

offlineEnabled*

boolean

  • *true** if the device is being enabled for offline streaming
  • *false** if it’s being disabled

country*

string

ISO 2-character country code which the end user resides in.

🚧

Error Codes

1002 - “parameter name”:”reason” - User did not specify valid value for mandatory parameter. Check the message for more details.
1003 - This account type cannot register offline device/Maximum number of offline devices registered - Client was not successfully registered for offline playback. Check the message for more details.




3. Creating playlists

3.1 Service Curated Playlists

To populate your service with curated playlists, you can use:

  1. MassiveMusic Playlist Tool - contact us if you would like to create your playlist using the Playlist Tool.
  2. MassiveMusic Playlist API

Use the following endpoint to create a partner playlist via the MassiveMusic API.

Attribute

Type

Description

country*

string

The ISO 2-character code of the country to which your oauth_consumer_key has access.

userId

string

The unique identifier of the user. For information on creating users click here.

FORM DATA

Data

Type

Description

name*

string

The name of the playlist

status

string

The status of the subscription must be set as active

visibility

string

The visibility of the playlist. Supported values are privateand public.

description

string

A description for the playlist

tracks

string

An array of objects, each of which can contain:
trackId (string, optional): a unique identifer for the playlist item

trackTitle (string, optional): the name of the playlist item

trackVersion (string, optional): the version of the item e.g. deluxe

artistAppearsAs (string, optional): the artist name

releaseId (string, optional): a unique identifier for the release

releaseTitle (string, optional): the title of the release

releaseArtistAppearsAs (string, optional): The artist of the release e.g. Various Artists

releaseVersion (string, optional): The version of the release

annotations

string

A hash of any additional parameters to be saved

📘

Locating tracks for your playlists

To locate tracks for your playlists, you can use the MassiveMusic Catalogue API to search for artists, releases or tracks.


3.2 User Playlists

You can use the same endpoint listed above to create a personal user playlists by specifying the user's userId. The "visibility" of this playlist can be set to "private" so that it is only visible to the user creating it and not available service wide.\


4. Streaming tracks to your subscribers

4.1 Streaming Online

Users can stream any track that is available for streaming in their applicable region, as long as they have a valid subscription set up with MassiveMusic.

Use the following endpoint to stream any track to your subscriber:

Attribute

Type

Description

userId

string

The unique identifier of the user. For information on creating users click here.

trackId

integer

The MassiveMusic track ID of the track to be streamed.

formatId*

integer

The MassiveMusic format ID of the format requested. For a list of available formats click here

clientId

string

A unique identifier for the current device streaming the track.

Generally a music label requirement, this will allow us to block multiple devices from streaming on the same user account (see above for more information).

country*

  • string**

ISO 2-character code of the country the end user resides in.

🚧

Error Codes

1001 - Error: Missing “parameter name” query parameter - Not all mandatory parameters were specified in the request.
1002 - Invaild value for “parameter name”: parameter value - Value for parameter in error message is not valid.
2001 - Track not found - This track isn’t available for streaming in your country or shop.
2002 - Pre-release or subscription availability - Either the user does not have a valid subscription account with us, or the track is not available for streaming (note that streaming release dates may differ from download or catalogue streaming release dates).
3201 - Simultaneous stream requests from multiple locations - streaming access temporarily disabled - When the clientId parameter is supplied, multiple devices will not be allowed to stream concurrently (see endpoint description above for more information).


4.2 Streaming Offline

For subscribers who you have authorised for offline listening , tracks can be cached (in an encrypted format) directly on their device. This will enable them to listen to the tracks when there is no active internet connection.

Use the following endpoint to cache tracks on an authorised device:

Attribute

Type

Description

userId*

string

The unique identifier of the user. For information on creating users click here .

trackId*

integer

The MassiveMusic track ID of the track to be streamed.

formatId*

integer

The MassiveMusic format ID of the format requested. For a list of available formats click here

clientId*

string

A unique identifier for the current device streaming the track.

This should be the same clientId used to register the device for offline play with the unlimitedStreaming/offline
endpoint

country*

string

ISO 2-character code of the country the end user resides in.

🚧

Error Codes

1001 - Error: Missing “parameter name” query parameter - Not all mandatory parameters were specified in the request.
1002 - Invaild value for “parameter name”: parameter value - Value for parameter in error message is not valid.
2001 - Track not found - This track isn’t available for streaming in your country or shop.
2002 - Pre-release or subscription availability - Either the user does not have a valid subscription account with us, or the track is not available for streaming (note that streaming release dates may differ from download or catalogue streaming release dates).

📘

Preventing concurrent playback

When the clientId parameter is supplied, multiple devices will NOT be allowed to stream concurrently. Device A can start streaming, but if Device B starts, Device A will finish its current track then be blocked from playing again for a short time period. After that time period, Device A can play again, and Device B will become blocked.

View all formats that are available for subscription streaming\



5. Reporting usage back to rightsholders

Labels and Publishers require usage data to be reported back to them, as determined by your licensing agreements. To enable MassiveMusic to manage rightsholder reporting, you must log usage data back to MassiveMusic.

📘

Information about logging activity

  • Tracks which are streamed both online and offline should be reported to MassiveMusic.
  • For online streaming if your label or publisher agreements require reporting on tracks using pre-fetched functionality but are never played on the device, they should be logged with a zero second play time.
  • All tracks listened to when the device is offline must be reported as soon as Internet connectivity is restored.
  • When using the offline/subscription endpoint where the track is being downloaded for later play but not actively playing from this particular endpoint, do not log this data to the subscription/log endpoint.

Use the following endpoint to log usage data back to MassiveMusic:

Multiple plays can be batched into a single POST to the subscription/log endpoint and the body can be sent in either XML or JSON formats, subject to acceptable usage.

Attribute

Type

Description

userId*

string

The unique identifier of the user. For information on creating users click here .

country*

string

The 2 letter ISO country code, as with our other endpoints. Should be the country where the user originated the stream from (e.g. set to US if the stream was played by a US user).

Please note it can only be placed as a query string parameter, not in the POST body, or authorisation headers if those are used.

trackId*

integer

The MassiveMusic track ID of the track that was streamed.

releaseId*

integer

The MassiveMusic release ID of the release that was streamed.

formatId

integer

The MassiveMusic format ID of the format requested. For a list of available formats click here

userAgent*

string

Details of the device model and application version used to play the track.

Values over 256 characters will be truncated.

dateTimePlayed*

string

The date and time when the track was played. Should be in the ISO 8601 format.

totalTimePlayed*

integer

The total time the track was streamed in seconds.

playMode

string

Either “online”, “offline”, or “online-cached”. Indicates if the play was with an active or inactive network connection and if the network connection was active, whether or not it was read from the device cache


📘

S3 bucket logger

  • Alternatively, rather than using the API endpoint, you can use the S3 bucket logger to submit usage logs in Parquet format. See more details here.