Building a Social Media Service (MassiveMusic managed content delivery)
This guide is aimed at helping you build music into a social media service, or other similar scale B2C products. It will take you through the relevant concepts and API endpoints to help you integrate with the MassiveMusic platform.
In this guide, we will focus on a scenario where MassiveMusic manages content delivery for you, If you prefer to manage content delivery yourself click here.\
High-level integration overview
1. Building your own search functionality
The catalogue of music you have licensed will change over time. New releases will be added, but content can also be updated and removed by the rightsholders - therefore it is important that your search functionality reflects theses changes on an ongoing basis. To achieve this, and understand what content is available from MassiveMusic, you will maintain a copy of MassiveMusic catalogue.
The catalogue is published and updated by MassiveMusic using the Catalogue Events API. You will need to ingest the events to get all relevant information and maintain a comprehensive catalogue.
1.1 Catalogue events
Catalogue Events allows you to retrieve constant updates for the global MassiveMusic catalogue as new and updated content is ingested onto the MassiveMusic platform. 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.
1.2 Publisher availability
MassiveMusic integrates with Publishing Administrators, such as Blokur, Music Reports Inc. and Harry Fox Agency, to confirm publisher licensing for your catalogue. You will need a separate agreement and direct integration with a publishing administrator to achieve this.
Publishing Administrators receive our catalogue updates daily via the Events API mechanism described above. For each track that MassiveMusic makes available, they match the track to their database to determine publisher ownership. They work to obtain clearances and report back track-by-track data back to you.
When building search, you must maintain a daily updated copy of all availability data from both labels and publishers, and check a track’s eligibility against this data in order to remain compliant.\
2. Streaming Content
2.1 Video Creations
When your users create a new video, you can present available tracks to them via your own search functionality. Once a track has been chosen it can be streamed directly from the MassiveMusic platform to the users device. The user is then able to select which portion of the track they would like included in their video (dependent on your own product experience and licensing deals).
Use the following endpoint to stream tracks for video creation purposes:
Attribute | Type | Description |
|---|---|---|
trackId* | integer | The MassiveMusic ID of the track to be streamed. |
formatId* | integer | The MassiveMusic ID of the format requested. Please contact us for available formats. |
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 - Invalid 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.
2.2 Video Views
Once a video has been created by a user, both the track snippet and video should be merged into a single asset and stored within your own infrastructure. A reference to the MassiveMusic Track ID should also be associated with this asset as this is required for reporting purposes each time the video is viewed by one of your users.
3. Reporting
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 via the Preview Log API.\
3.1 Preview Log API
Multiple plays can be batched into a single JSON-formatted POST to this endpoint. The maximum batch size should be 100 logs, and requests should be limited to 10 requests per second.
A country parameter is required in the query string. This is for OAuth authorisation, and MassiveMusic recommends can be fixed to any territory, eg. UK, for these requests. The country property in the POST body is the location in which the user played the clip.
Any HTTP non-200 response means MassiveMusic has not saved any logs. When a 1008 error code is returned, one or more logs contains invalid data. In this scenario, no logs are processed, and the batch must be resubmitted when the error is resolved. Please refer to the error message and the error index to know which log failed in a batch, and for what reason.
{
"logs": [
{
"country": "US",
"trackId": 123456,
"dateTimePlayed": "2014-03-13T11:39:28.8981203Z",
"totalTimePlayed": 12,
"userAgent": "Device version 3, App version 6",
"userId": "ef6d126b-183e-42e3-9885-1aad11e262fe",
"playMode":"online"
"playType":"view"
}
]
}Use the following endpoint to log Preview Clip usage data back to MassiveMusic:
A collection of sample requests for the Logging APIs using Postman can be accessed here
Attribute | Type | Description |
|---|---|---|
userId* | integer | The identifier of the user that played that track. Please note this must be in the body and is not a user id for authorisation purposes (as this endpoint is 2-leg OAuth signed). It's just for reporting purposes. The User ID value can be anything you want but it must be unique to each user and used consistently |
country* | string | The 2 letter ISO 3166 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: the query string parameter is for authorisation only and doesn't get logged, whilst the country in the body is for reporting purposes. These values can differ if you send multiple countries at once. |
trackId* | integer | The MassiveMusic ID of the track that was streamed. |
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. Needs to be in the ISO 8601 format, UTC time and should not be a date in the future or more than two months into the past. |
totalTimePlayed* | integer | The total time the track was streamed, in seconds. Must be between 0 and 60 inclusive - 0 if it was only pre-fetched and never played. |
playMode* | string | Either "online", "offline", or "online-cached". Logs should always be reported as “online”. |
playType | string | Either “view” or “creation”. Indicates if the play was associated to a video creation or video view. Defaults to "view" if nothing is supplied |
Error codes
- 1008 - One or more logs are invalid. Refer to the index field to know which logs failed and why.
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.
Licensor Reporting Specifications
Labels and Publisher Administrators will share a reporting specification with you, which MassiveMusic's Reporting team will use to process and format the submitted usage data.
Updated 5 months ago
