What is wrong with this ruby code? -
i "400 bad request" , "did forget body variable?" code:
require "rest-client" require "json" # id copied down in last exercise your_folder_id = "816582409" # add "body" variable here body = { "description" => "i made on codecademy!" } response = restclient.put( "https://api.box.com/2.0/folders/#{816582409}", json.generate(body), :authorization => "bearer" << "akgep7modflaknmyxtt3nsntohxw3bt1" ) json.parse(response.body)["description"]
the url of api call shouldn't https://api.box.com/2.0/folders/816582409
or "https://api.box.com/2.0/folders/#{@your_folder_id}"
?
Comments
Post a Comment