Upload image with soundcloud track API Upload image with soundcloud track API curl curl

Upload image with soundcloud track API


For anyone coming along, the answer was figured out in the comments section. That might not be obvious though, so here goes.

The problem here is that you're using the track[artwork_url] parameter, which is read-only. If you would like to upload artwork, use the track[artwork_data] parameter. Example:

curl -X POST "https://api.soundcloud.com/tracks.json" \           -F 'oauth_token=valid_token' \           -F 'track[asset_data]=@audio.wav' \           -F 'track[title]=A nice track title' \           -F 'track[sharing]=public' \           -F 'track[artwork_data]=@image.jpg'

This should work just fine.


If you are using https://github.com/thomasmodeneis/soundcloudnodejs This is how you can upload a track with most used fields, including the image.

var track = { title: "My music", description: "My description", genre: "my genre", tag_list: "my tags with spaces", artwork_data: '/tmp/images/myimage.jpg', sharing: 'public', oauth_token: "MY_SOUNDCLOUD_TOKEN", asset_data: "/tmp/sound/mytrack.mp3",};

Followed by the add method:

soundcloudnodejs.addTrack(track, function (err, track) {... console.log("addTrack, track: ", track); console.log("permalink_url --> " + track.permalink_url);});

Cheers.