Reputation: 81
Does anyone know how to favorite a track that is private using the SoundCloud API?
This is what I have so far.
SC.put('/me/favorites/1234567', function(track,error){alert(error.message)})
This works for the track when it's public, but when its private I'm getting a 404/401 error.
Upvotes: 1
Views: 243
Reputation: 4117
As long as you have access to the private track, you should be able to favorite it. Note that this means that either:
As long as either of those two conditions is met, you will be able to favorite a track. Note that of course you also must allow the user to authenticate first:
SC.initialize({
client_id: 'foo',
redirect_uri: 'http://example.com/callback.html'
});
SC.connect(function(me) {
SC.put('/me/favorites/53919056', function(response, error) {
// response.status will equal "201 - Created"
});
});
Upvotes: 1