def scopes(room: nil)
      path = "#{@api.scopes_config[:url]}/#{URI::escape(@token)}"
      response = self.class.get(path,
        :query => { :auth_token => @token },
        :headers => @api.headers
      )
      ErrorHandler.response_code_to_exception_for :room, 'scopes', response
      return response['scopes'] unless response['client']['room']
      if room && response['client']['room']['id'] == room.room_id
        return response['scopes']
      end
    end
def scopes(room: nil)
      path = "#{@api.scopes_config[:url]}/#{URI::escape(@token)}"
      response = self.class.get(path,
        :query => { :auth_token => @token },
        :headers => @api.headers
      )
      ErrorHandler.response_code_to_exception_for :room, 'scopes', response
      return response['scopes'] unless response['client']['room']
      if room && response['client']['room']['id'] == room.room_id
        return response['scopes']
      end
    end
Returns the scopes for the Auth token

 Calls the endpoint:

   https://api.hipchat.com/v2/oauth/token/#{token}

   The response is a JSON object containing a client key. The client
   object contains a list of allowed scopes.

   There are two possible response types, for a global API token, the
   room object will be nil. For a room API token, the room object will
   be populated:

 Optional room parameter can be passed in. The method will return the
 following:

   - if it's a global API token and room param is nil: scopes
   - if it's a global API token and room param is not nil: scopes
   - if it's a room API token and room param is nil: nil
   - if it's a room API token and room param is not nil
       - if room param's room_id matches token room_id: scopes
       - if room param's room_id doesn't match token room_id: nil

 Raises errors if response is unrecognizable