protected ResponseType get(String endPoint) {
return get(endPoint, null, null);
}
protected ResponseType get(String endPoint, Date modifiedAfter, Map<String,String> params) {
OAuthRequest request = new OAuthRequest(Verb.GET, BASE_URL + endPoint);
if (modifiedAfter != null) {
request.addHeader("If-Modified-Since", utcFormatter.format(modifiedAfter));
}
if (params != null) {
for (Map.Entry<String,String> param : params.entrySet()) {
request.addQuerystringParameter(param.getKey(), param.getValue());
}
}
service.signRequest(token, request);
Response response = request.send();
if (response.getCode() != 200) {
ApiException exception = unmarshallResponse(response, ApiException.class);
throw new XeroApiException(response.getCode() + " response: Error number "
+ exception.getErrorNumber() + ". " + exception.getMessage());
}