Soundcloud - Ruby creating a Playlist getting 422 (#soundcloud-ruby) -
i suspect @ soundcloud has changed because code has not been altered , worked fine last year.
i see:
error: http status: 422 unprocessable entity, status code: 422, playlist_struct:{:title=>"y11 - revo - sop", :description=>"y11 - revo - sop newchoir", :tag_list=>"sop", :tracks=>"219269586", :format=>"json", :oauth_token=>"..."}
my oauth_token works fine.
i call:
new_playlist = @client.post('/playlists', playlist_struct)
where @client defined using https://github.com/soundcloud/soundcloud-ruby as:
@client = soundcloud.new({ :client_id => clientid, :client_secret => clientsecret, :username => email, :password => password })
and playlist_struct per error message.
thoughts appreciated!
regards, m.
full code:
require 'rubygems' require 'soundcloud' require 'pp' require 'logger' def login # http://soundcloud.com/you/apps clientid = '...' clientsecret = '...' email = '...' password = '...' # register new client, exchange username, password access_token # note: soundcloud api docs advise not use user credentials flow in web app. # in case, never store password of user. @client = soundcloud.new({ :client_id => clientid, :client_secret => clientsecret, :username => email, :password => password }) # print logged in username puts"h1. logged in " + @client.get('/me').username # updating users profile description end login() playlist_struct = { :title => "hello" } new_playlist = @client.post('/playlists', playlist_struct) @log.info ' ok: '+new_playlist.permalink_url
looks playlist_struct needs include
playlist: { ... }
around content.
as code worked couple of years before hand i'd venture silent change api.
Comments
Post a Comment