This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Tracks in Spotify



Overview

The following operations allow you to work with Tracks in Spotify. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with Tracks, see Sample configuration.

OperationDescription
getATrackGet a track.
getSeveralAlbumsRetrieves several albums.

Operation details

This section provides the details on each operation related to Tracks.

Get information of a single Track

To get the Spotify catalog information for a single track identified by its unique Spotify ID, use spotify.getATrack operation.

getATrack
<spotify.getATrack>
    <trackId>0eGsygTp906u18L0Oimnem</trackId>
</spotify.getATrack>
Properties
  • trackId: Spotify Id of the track.

Sample request

Following is a sample REST/JSON request that can be handled by the getATrack operation.

Sample Request for getATrack
{
"trackId":"0eGsygTp906u18L0Oimnem"
}

Get information of a several Tracks

To get the Spotify catalog information for several Tracks based on their Spotify IDs, use spotify.getSeveralTracks operation.

getSeveralTracks
<spotify.getSeveralTracks>
    <trackIds>0eGsygTp906u18L0Oimnem,1lDWb6b6ieDQ2xT7ewTC3G</trackIds>
</spotify.getSeveralTracks>
Properties
  • tarackIds: All Spotify Ids of the tracks to get the information of those tracks. Ids must be comma separated.

Sample request

Following is a sample REST/JSON request that can be handled by the getSeveralTracks operation.

Sample Request for getSeveralTracks
{
"trackIds":"0eGsygTp906u18L0Oimnem,1lDWb6b6ieDQ2xT7ewTC3G"
}

Sample configuration

Following is a sample proxy service that illustrates how to connect to Spotify with the init operation to use the getATrack operation. The sample request for this proxy can be found in getATrack sample request.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="spotify_getATrack"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
    <target>
        <inSequence>
            <spotify.init/>
            <property name="trackId" expression="json-eval($.trackId)"/>
            <spotify.getATrack>
                <trackId>{$ctx:trackId}</trackId>
            </spotify.getATrack>
            <respond/>
        </inSequence>
        <outSequence>
            <log/>
            <send/>
        </outSequence>
    </target>
    <description/>
</proxy>