def call_api(path, params = {})
      raise ArgumentError, 'You must include an HTTP method' unless params[:method]
      raise InvalidConnection, 'You have not authenticated and have no token' unless @token
      headers = {
        'Content-Type' => 'application/json',
        'Authorization' => "Bearer #{@token}"
      }
      headers.merge!(params[:headers]) if params[:headers]

      arguments = {headers: headers}
      arguments.merge!({body: params[:body].to_json}) if params[:body]
      arguments.merge!({query: params[:query]}) if params[:query]

      HTTParty.send params[:method], url(path), arguments
    end
def call_api(path, params = {})
      raise ArgumentError, 'You must include an HTTP method' unless params[:method]
      raise InvalidConnection, 'You have not authenticated and have no token' unless @token
      headers = {
        'Content-Type' => 'application/json',
        'Authorization' => "Bearer #{@token}"
      }
      headers.merge!(params[:headers]) if params[:headers]

      arguments = {headers: headers}
      arguments.merge!({body: params[:body].to_json}) if params[:body]
      arguments.merge!({query: params[:query]}) if params[:query]

      HTTParty.send params[:method], url(path), arguments
    end
Required parameters: method
 Optional parameters: headers, body, query (all hashes)