lib/opentok/client.rb in opentok-2.2.3 vs lib/opentok/client.rb in opentok-2.2.4

- old
+ new

@@ -29,11 +29,11 @@ raise OpenTokError, "Failed to create session. Response code: #{response.code}" end end def start_archive(session_id, opts) - body = { "sessionId" => session_id, "action" => "start" } + body = { "sessionId" => session_id } body["name"] = opts[:name] unless opts[:name].nil? response = self.class.post("/v2/partner/#{@api_key}/archive", { :body => body.to_json, :headers => { "Content-Type" => "application/json" } }) @@ -83,12 +83,11 @@ raise OpenTokArchiveError, "The archives could not be retrieved." end end def stop_archive(archive_id) - response = self.class.post("/v2/partner/#{@api_key}/archive/#{archive_id}", { - :body => { "action" => "stop" }.to_json, + response = self.class.post("/v2/partner/#{@api_key}/archive/#{archive_id}/stop", { :headers => { "Content-Type" => "application/json" } }) case response.code when 200 response @@ -99,10 +98,10 @@ when 404 raise OpenTokArchiveError, "The archive could not be stopped. The Archive ID does not exist: #{archive_id}" when 409 raise OpenTokArchiveError, "The archive could not be stopped. The archive is not currently recording." else - raise OpenTokArchiveError, "The archive could not be started." + raise OpenTokArchiveError, "The archive could not be stopped." end end def delete_archive(archive_id) response = self.class.delete("/v2/partner/#{@api_key}/archive/#{archive_id}", {