code: private String fetchCsrfToken() {
  		try {
  			return connection.fetchToken("csrf");
  		} catch (IOException | MediaWikiApiErrorException e) {
  			logger.error("Error when trying to fetch csrf token: "
  					+ e.toString());
  		}
  		return null;
  	}
docs: Executes a API query action to get a new CSRF (Cross-Site Request
  Forgery) token. The method only executes the action, without doing any
  checks first. If errors occur, they are logged and null is returned.
  
  @return newly retrieved token or null if no token was retrieved