code: public String getRestUrl(String urlKey, Boolean addClientId, Pagination pagination, Map<String, String> additionalUrlParams) throws UnsupportedEncodingException {
  
          String url;
  
          if (!addClientId) {
              url = "/v2.01" + urlKey;
          } else {
              url = "/v2.01/" + root.getConfig().getClientId() + urlKey;
          }
  
          Boolean paramsAdded = false;
          if (pagination != null) {
              url += "?page=" + pagination.getPage() + "&per_page=" + pagination.getItemsPerPage();
              paramsAdded = true;
          }
  
          if (additionalUrlParams != null) {
              for (Entry<String, String> entry : additionalUrlParams.entrySet()) {
                  url += paramsAdded ? "&" : "?";
                  url += entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), "ISO-8859-1");
                  paramsAdded = true;
              }
          }
  
          return url;
      }
docs: Gets REST url.
  
  @param urlKey              Url key.
  @param addClientId         Denotes whether client identifier should be composed into final url.
  @param pagination          Pagination object.
  @param additionalUrlParams Additional parameters.
  @return Final REST url.
  @throws UnsupportedEncodingException