Authentication allows the server to generate a session for the user. Without a session you will not be able to stream, or collect data about a user account.
https://shop.mp3tunes.com/api/v0/login?username=<username>&password=<password>&partner_token=<partner token>&output=<output format>
parameters
A Partner Token is used to uniquely identify and authenticate all entities using API's to communicate with MP3tunes.com. If you do not already have a partner token you may request one from the partner page.
A valid MP3tunes account username. LINK TO SECTION COVERING ACCOUNT CREATION API CALLS HERE
A valid MP3tunes account password. LINK TO SECTION COVERING ACCOUNT CREATION API CALLS HERE
Your preferred output format. These include xml, and json.
The login method attempts to authenticate the received user credentials and setup a session to be used with all subsequent requests. On success the 'status' parameter is set to 1, and a valid session id is returned. If authentication fails the 'status' parameter is set to 0, and the 'errorMessage' parameter is populated with appropriate error messages detailing what caused the call to fail.
Example 2.1. Successful authentication response (JSON)
https://shop.mp3tunes.com/api/v0/login?username=apitest@example.com&password=apitestpassword&partner_token=XXXXXXXXXX&output=json
{"status":1,
"session_id":"ec08029c87e05b2c49b6ac0cd194b68b",
"username":"apitest@example.com",
"errorMessage":null}
Example 2.2. Successful authentication response (XML)
https://shop.mp3tunes.com/api/v0/login?username=apitest@example.com&password=apitestpassword&partner_token=XXXXXXXXXX&output=xml
<mp3tunes>
<status>1</status>
<session_id>ec08029c87e05b2c49b6ac0cd194b68b</session_id>
<username>apitest@example.com</username>
<errorMessage/>
</mp3tunes>
Example 2.3. Unsuccessful authentication response (JSON)
https://shop.mp3tunes.com/api/v0/login?username=apitest@example.com&password=apitestpassword&partner_token=invalidtoken&output=json
{"status":0,
"errorMessage":"The partner_token input parameter failed validation."}
Example 2.4. Unsuccessful authentication response (XML)
https://shop.mp3tunes.com/api/v0/login?username=apitest@example.com&password=apitestpassword&partner_token=invalidtoken&output=xml
<mp3tunes>
<status>0</status>
<errorMessage>
The partner_token input parameter failed validation.
</errorMessage>
</mp3tunes>
http://ws.mp3tunes.com/api/v0/accountData?sid=<session id>&partner_token=<partner token>&output=<output format>
parameters
A valid session id, received from the “login” method.
A valid partner token. A Partner Token is used to uniquely identify and authenticate all entities using API's to communicate with MP3tunes.com. If you do not already have a partner token you may request one from the partner page.
Your preferred output format. These include xml, and json.
The accountData method retrieves information about a user account. This method will tell you what subscription level a user account has as well as the users' email address, name, and nickname.
Example 2.5. Successful accountData response (JSON)
http://ws.mp3tunes.com/api/v0/accountData?sid=ec08029c87e05b2c49b6ac0cd194b68b&output=json
{"user": {"email":"apitest@example.com",
"nickName":null,
"firstName":"Robert",
"lastName":"Paulson",
"subscriptions": [{"name":"user_locker_annual",
"description":"Locker Account - Annual"}]}}
Example 2.6. Successful accountData response (XML)
http://ws.mp3tunes.com/api/v0/accountData?sid=ec08029c87e05b2c49b6ac0cd194b68b&output=xml
<mp3tunes>
<user>
<email>apitest@example.com</email>
<nickName/>
<firstName>Robert</firstName>
<lastName>Paulson</lastName>
<subscriptions>
<item>
<name>user_locker_annual</name>
<description>Locker Account - Annual</description>
</item>
</subscriptions>
</user>
</mp3tunes>
Example 2.7. Unsuccessful accountData response (JSON)
http://ws.mp3tunes.com/api/v0/accountData?sid=ec08029c87e05b2c49b6ac0cd194b68b&output=json
{"status":0,
"errorMessage":"Not logged in"}
Example 2.8. Unsuccessful accountData response (XML)
http://ws.mp3tunes.com/api/v0/accountData?sid=ec08029c87e05b2c49b6ac0cd194b68b&output=xml
<mp3tunes>
<status>0</status>
<errorMessage>Not logged in</errorMessage>
</mp3tunes>