module Roqua module CoreApi module Sessions class OrganizationSession < AppSession attr_reader :organization_id def initialize(organization_id, app_id, server_url = ENV["CORE_URL"]) @organization_id = organization_id super(app_id, server_url) end def create_dossier(attributes) response = post "/dossiers", dossier: attributes fail response.inspect unless response.code == 201 Models::Dossier.new(response) end def dossier_session(dossier_id) DossierSession.new dossier_id, organization_id, app_id, server_url end private def base_url super + "/organizations/#{organization_id}" end end end end end