String url = APIUtil.contextualizeUrl(getApiBaseUrl(), getApiVersion(), "/user/" + fitbitUser.getId() + "/heart/date/" + DateTimeFormat.forPattern("yyyy-MM-dd").print(date), APIFormat.JSON);
Response res = httpGet(url, true);
throwExceptionIfError(res);
try {
return new Heart(res.asJSONObject());
} catch (JSONException e) {
throw new FitbitAPIException("Error retrieving heart rate: " + e, e);
}
}