Playlist.addArtist
From MeeMixWiki
Contents |
Overview
Add an artist to the playlist. By adding an artist, 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 an artist based on media library created with lib.create. Should be used only if using the libArtistId. |
| optional | libArtistId | string | add an artist based on your local artist id submitted with lib.submitTrack. |
| optional | artistId | String | add an artist by MeeMix artist ID. |
| optional | artistName | string | add an artist by its artist name. If there is more than one result for the artist name, or there is a spelling mistake, a response with Artist Suggestions will be sent. |
NOTE: either libArtistId, artistId or artistName must be specified in the request. In case you are using libArtistId, libId must be presented as well.
REST request example:
http://ws.shadow.meemix.com:8080/mxws/services/mxws/playlist.addArtist?partnerId=1001&partnerKey=...&userId=jim&playlistId=17&artistName=David%20Gilmour
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:playlistAddArtistRequest> <partnerId>1001</partnerId> <partnerKey>...</partnerKey> <userId>jim</userId> <playlistId>17</playlistId> <artistName>David Gilmour</artistName> </q0:playlistAddArtistRequest> </soapenv:Body> </soapenv:Envelope>
Response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <playlistAddArtistResponse xmlns:ns1="http://ws.meemix.com:8080/mxws/"> <artistSuggestions /> </playlistAddArtistResponse> </soapenv:Body> </soapenv:Envelope>
In case there is more than one result that matched the requested track name, an Artist Suggestions will be sent in the response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <playlistAddArtistResponse xmlns:ns1="http://ws.meemix.com:8080/mxws/"> <artistSuggestions> <artist> <artistId>7844</artistId> <artistName>Metalium</artistName> </artist> <artist> <artistId>3037</artistId> <artistName>Metal Church</artistName> </artist> <artist> <artistId>241</artistId> <artistName>Metallica</artistName> </artist> <artist> <artistId>214</artistId> <artistName>The Metal Hearts</artistName> </artist> <artist> <artistId>2296</artistId> <artistName>Metric</artistName> </artist> <artist> <artistId>35706</artistId> <artistName>Metros</artistName> </artist> </artistSuggestions> </playlistAddArtistResponse> </soapenv:Body> </soapenv:Envelope>
You can call this operation again using one of the artist IDs supplied in this response to complete the process.
Faults
| Code | Description |
|---|---|
| 1 | Invalid partner ID |
| 2 | Invalid partner key |
| 4 | Invalid userID |
| 6 | Invalid playlist ID |
| 7 | Artist name not found |
| 8 | Invalid artist ID |
| 17 | Invalid input (either artistId or artistName must be specified in the request) |
For a full faults list and example of soapFault please visit the Faults page.
