Package com.fitbit.api

Examples of com.fitbit.api.FitbitAPIException


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


        Response response = httpGet(url, true);
        throwExceptionIfError(response);
        try {
            return Scale.jsonArrayToScalesList(response.asJSONObject().getJSONArray("scales"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to list of Scale : ", e);
        }
    }
View Full Code Here

        Response res = httpGet(url, true);
        throwExceptionIfError(res);
        try {
            return new Scale(res.asJSONObject().getJSONObject("scale"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to scale : " + e, e);
        }
    }
View Full Code Here

        Response response = httpPost(url, params.toArray(new PostParameter[params.size()]), true);
        throwExceptionIfError(response);
        try {
            return new Scale(response.asJSONObject().getJSONObject("scale"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to Scale : ", e);
        }
    }
View Full Code Here

        Response response = httpGet(url, true);
        throwExceptionIfError(response);
        try {
            return ScaleUser.jsonArrayToScaleUsersList(response.asJSONObject().getJSONArray("scaleUsers"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to list of ScaleUser : ", e);
        }
    }
View Full Code Here

        throwExceptionIfError(response);

        try {
            return new ScaleUser(response.asJSONObject().getJSONObject("scaleUser"));
        } catch (Exception e) {
            throw new FitbitAPIException("Error parsing json response to ScaleUser : " + e, e);
        }
    }
View Full Code Here

        throwExceptionIfError(response, HttpServletResponse.SC_CREATED);

        try {
            return ScaleInviteSendingResult.jsonArrayToScaleInviteSendingResultsList(response.asJSONObject().getJSONArray("scaleInviteSendingResults"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to list of ScaleInviteSendingResult : ", e);
        }
    }
View Full Code Here

        Response response = httpGet(url, true);
        throwExceptionIfError(response);
        try {
            return ScaleInvite.jsonArrayToScaleInvitesList(response.asJSONObject().getJSONArray("scaleInvites"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to list of ScaleInvite : ", e);
        }
    }
View Full Code Here

        Response response = httpGet(url, true);
        throwExceptionIfError(response);
        try {
            return ScaleMeasurementLog.jsonArrayToMeasurementLogList(response.asJSONObject().getJSONArray("scaleMeasurements"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to list of ScaleMeasurementLog : ", e);
        }
    }
View Full Code Here

        Response response = httpGet(url, true);
        throwExceptionIfError(response);
        try {
            return ScaleMeasurementLog.jsonArrayToMeasurementLogList(response.asJSONObject().getJSONArray("scaleMeasurements"));
        } catch (JSONException e) {
            throw new FitbitAPIException("Error parsing json response to list of ScaleMeasurementLog : ", 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.