Spotify

Spotify is the world's leading music streaming platform, with developer access to track and artist metadata, audio features, personalised recommendations, playlists, and global top charts.

MoEngage <> Spotify

The MoEngage <> Spotify integration allows you to personalise music and entertainment app campaigns with live track, artist, and playlist data at send time. Common use cases include recommending new releases by an artist a user follows, surfacing a user's top tracks in a re-engagement campaign, or promoting chart-topping content based on a user's genre preferences.

Integration

library_add_check

Prerequisites

Ensure you have a Spotify developer account with an active app. Register at developer.spotify.com/dashboard. Spotify uses OAuth 2.0 for authentication.

Step 1: Get your Spotify credentials

  1. Navigate to developer.spotify.com/dashboard and log in with your Spotify account.
  2. Click Create app, fill in the required details, and save. Your Client ID and Client Secret are displayed on the app dashboard.
  3. Spotify uses OAuth 2.0 Client Credentials flow for non-user-specific data. Exchange your Client ID and Client Secret for an access token via POST https://accounts.spotify.com/api/token. If this API requires OAuth 2.0, enable the OAuth toggle and configure your credentials there. New to OAuth 2.0? See Authorization Configuration with OAuth 2.0.

Step 2: Set up the Content API on MoEngage

  • Navigate to Dashboard > Settings > APIs and open the Content API tab.
  • Click Add Content API.
  • Fill in the details using the table below as a reference.
Key Value
Name Choose a descriptive name, for example Spotify New Releases.
Method GET
API URL

https://api.spotify.com/v1/browse/new-releases

Other useful endpoints: /v1/artists/{id}/top-tracks for an artist's top tracks, or /v1/browse/featured-playlists for featured playlists. Refer to the Spotify Web API documentation.

Headers
Header Value
Authorization Bearer YOUR_ACCESS_TOKEN
Key Value Parameters
Parameter Example value Notes
country @user.country Two-letter ISO country code to localise chart results.
limit 3 Number of results to return.
  • Click Validate to confirm the platform returns a response, then click Save.

Once saved, refer to the MoEngage documentation on using Content APIs in campaigns to learn how to reference response fields inside your campaign templates.

Understanding the API response

For new releases, the response contains an albums.items array. Each object represents one album.

Response field Template variable example Description
albums.items[0].name {{ContentApi.albums.items[0].name}} Album name.
albums.items[0].artists[0].name {{ContentApi.albums.items[0].artists[0].name}} Primary artist name.
albums.items[0].images[0].url {{ContentApi.albums.items[0].images[0].url}} Album cover image URL.
albums.items[0].release_date {{ContentApi.albums.items[0].release_date}} Release date in YYYY-MM-DD format.
albums.items[0].external_urls.spotify {{ContentApi.albums.items[0].external_urls.spotify}} Direct Spotify link to the album — use as a CTA.

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?