Package com.fitbit.api

Examples of com.fitbit.api.FitbitAPIException


        Response response = httpPost(url, params.toArray(new PostParameter[params.size()]), true);

        try {
            return new ScaleMeasurementLog(response.asJSONObject().getJSONObject("scaleMeasurementLog"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to scale measurement log: " + e, e);
        }
    }
View Full Code Here


        Response response = httpPost(url, params.toArray(new PostParameter[params.size()]), true);

        try {
            return new ScaleMeasurementLog(response.asJSONObject().getJSONObject("scaleMeasurementLog"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to scale measurement log: " + e, e);
        }
    }
View Full Code Here

        Response res = httpGet(url, true);
        throwExceptionIfError(res);
        try {
            return BodyWithGoals.constructBodyWithGoals(res);
        } catch (JSONException e) {
            throw new FitbitAPIException("Error retrieving body with goals: " + e, e);
        }
    }
View Full Code Here

        Response res = httpGet(url, true);
        throwExceptionIfError(res);
        try {
            return BodyWithGoals.constructBodyWithGoals(res);
        } catch (JSONException e) {
            throw new FitbitAPIException("Error retrieving body with goals with goals: " + e, e);
        }
    }
View Full Code Here

        try {
            Response res = httpPost(url, params.toArray(new PostParameter[params.size()]), true);
            return new Body(res.asJSONObject().getJSONObject("body"));
        } catch (FitbitAPIException e) {
            throw new FitbitAPIException("Error logging weight: " + e, e);
        } catch (JSONException e) {
            throw new FitbitAPIException("Error logging weight: " + e, e);
        }
    }
View Full Code Here

        try {
            Response res = httpPost(url, params.toArray(new PostParameter[params.size()]), true);
            return new WaterLog(res.asJSONObject().getJSONObject("waterLog"));
        } catch (FitbitAPIException e) {
            throw new FitbitAPIException("Error logging water: " + e, e);
        } catch (JSONException e) {
            throw new FitbitAPIException("Error logging water: " + e, e);
        }
    }
View Full Code Here

        Response res = httpGet(url, true);
        throwExceptionIfError(res);
        try {
            return new Water(res.asJSONObject());
        } catch (JSONException e) {
            throw new FitbitAPIException("Error retrieving water: " + e, e);
        }
    }
View Full Code Here

        // Example: DELETE /1/user/-/foods/log/water/123.json
        String url = APIUtil.contextualizeUrl(getApiBaseUrl(), getApiVersion(), "/user/-/foods/log/water/" + logWaterId, APIFormat.JSON);
        try {
            httpDelete(url, true);
        } catch (Exception e) {
            throw new FitbitAPIException("Error deleting water: " + e, e);
        }

    }
View Full Code Here

        try {
            Response res = httpPost(url, params.toArray(new PostParameter[params.size()]), true);
            return new BpLog(res.asJSONObject().getJSONObject("bpLog"));
        } catch (FitbitAPIException e) {
            throw new FitbitAPIException("Error logging blood pressure: " + e, e);
        } catch (JSONException e) {
            throw new FitbitAPIException("Error logging blood pressure: " + e, e);
        }
    }
View Full Code Here

        Response res = httpGet(url, true);
        throwExceptionIfError(res);
        try {
            return new Bp(res.asJSONObject());
        } catch (JSONException e) {
            throw new FitbitAPIException("Error retrieving blood pressure: " + e, e);
        }
    }
View Full Code Here

TOP

Related Classes of com.fitbit.api.FitbitAPIException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.