code: public List<P> getAllPages(String apfrom, int aplimit) throws Exception {
      String query = "&list=allpages";
      if (apfrom != null && !apfrom.trim().equals("")) {
        query += "&apfrom=" + apfrom;
      }
      query += "&aplimit=" + aplimit;
      Api api = getQueryResult(query);
      List<P> pageRefList = api.getQuery().getAllpages();
      return pageRefList;
    }
docs: getAllPages
  
  @param apfrom
  - may be null or empty
  @param aplimit
  @return
  @throws Exception