setAccessToken(localUser);
String url = APIUtil.contextualizeUrl(getApiBaseUrl(), getApiVersion(), "/user/-/heart", APIFormat.JSON);
try {
Response res = httpPost(url, params.toArray(new PostParameter[params.size()]), true);
return new HeartLog(res.asJSONObject().getJSONObject("heartLog"));
} catch (FitbitAPIException e) {
throw new FitbitAPIException("Error logging heart rate: " + e, e);
} catch (JSONException e) {
throw new FitbitAPIException("Error logging heart rate: " + e, e);
}