Sha256: 65099d4bf2e126c64b42fc92b28e5d2322f01091fe271727216e969a914b8303
Contents?: true
Size: 651 Bytes
Versions: 10
Compression:
Stored size: 651 Bytes
Contents
require 'httmultiparty' module Canvas class Client include ::HTTMultiParty attr_accessor :token, :canvas_url def initialize(canvas_url, token) self.class.base_uri(canvas_url) @canvas_url = canvas_url @token = token end def post_sis_zip_to_canvas(account_id, *params) path = "/api/v1/accounts/#{account_id}/sis_imports" params_hash = params.first query = {attachment: File.open(params_hash.delete(:attachment))} query.merge!(params_hash) self.class.post(path, query: query, headers: {'Authorization' => "Bearer #{token}", 'Content-Type' => 'application/zip'}) end end end
Version data entries
10 entries across 10 versions & 1 rubygems