Playlist.addTrack

From MeeMixWiki

Jump to: navigation, search

Contents

Overview

Add a given track to the playlist. By adding a track, the user can better direct the playlist to match their musical taste.


Request

Parameters:

Required Name Type Description
required partnerId string your assigned partner ID.
required partnerKey string your assigned 32-character partner key.
required userId string unique user ID.
required playlistId string the playlistId provided earlier by calling either the user.getPlaylists operation or the user.createPlaylistBy* operations.
optional libId string add a track based on media library created with lib.create. Should be used only if using the libTrackId.
optional libTrackId string add a track based on your local track id submitted with lib.submitTrack.
optional trackId string add an artist by MeeMix artist ID.
optional trackName string add a track by its track name. If there is more than one result for the track name, or there is a spelling mistake, a response with Track Suggestions will be sent.
optional artistName string in case you are trying to add a track using the trackName option, it is recommended to send the artistName as well.

Note: either libTrackId, trackName or trackId must be presented in the request. In case you are using libTrackId, libId must be presented as well.


REST request example:

http://ws.shadow.meemix.com:8080/mxws/services/mxws/playlist.addTrack?partnerId=1001&partnerKey=...&userId=jim&playlistId=17&trackName=Comfortebly%20numb

SOAP request example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:q0="http://ws.meemix.com:8080/mxws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance">
   <soapenv:Body>
       <q0:playlistAddTrackRequest>
           <partnerId>1001</partnerId>
           <partnerKey>...</partnerKey>
           <userId>jim</userId>
           <playlistId>17</playlistId>
           <trackName>Comfortebly numb</trackName>
       </q0:playlistAddTrackRequest>
   </soapenv:Body>
</soapenv:Envelope>

Response

In case of there is more than one result that matched the requested track name, a Track Suggestions data type will be sent in the response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
       <playlistAddTrackResponse xmlns:ns1="http://ws.meemix.com:8080/mxws/">
           <trackSuggestions>
               <track>
                   <trackId>13835</trackId>
                   <trackName>Comfortably Numb</trackName>
                   <artist>
                       <artistId>651</artistId>
                       <artistName>Scissor Sisters</artistName>
                   </artist>
                   <album>
                       <albumId>1045</albumId>
                       <albumName>Scissor Sisters</albumName>
                   </album>
               </track>
               <track>
                   <trackId>70618</trackId>
                   <trackName>Comfortably Numb</trackName>
                   <artist>
                       <artistId>330</artistId>
                       <artistName>Pink Floyd</artistName>
                   </artist>
                   <album>
                       <albumId>5037</albumId>
                       <albumName>The Wall</albumName>
                   </album>
               </track>
               <track>
                   <trackId>1670975</trackId>
                   <trackName>Comfortably Numb</trackName>
                   <artist>
                       <artistId>65</artistId>
                       <artistName>David Gilmour</artistName>
                   </artist>
                   <album>
                       <albumId>113505</albumId>
                       <albumName>Live In Gdansk (2 CD)</albumName>
                   </album>
               </track>
               ..
               ..
             </trackSuggestions>
         </playlistAddTrackResponse>
 </soapenv:Body>
</soapenv:Envelope>

Faults

Code Description
1 Invalid partner ID
2 Invalid partner key
4 Invalid user ID
6 Invalid playlist ID
9 Track name was not found
10 Track ID was not found
17 Invalid input (either trackId or trackName must be specified in the request)


For a full faults list and example of soapFault please visit the Faults page.

Personal tools
        © 2009 MeeMix ltd