Package com.fitbit.api.common.model.user

Examples of com.fitbit.api.common.model.user.UserInfo


    public ScaleUser(JSONObject jsonObject) throws JSONException {
        userId = jsonObject.getString("userId");
        scaleUserName = jsonObject.getString("scaleUserName");
        bodyType = BodyType.valueOf(jsonObject.getString("bodyType"));
        userInfo = new UserInfo(jsonObject.getJSONObject("userInfo"), false);
    }
View Full Code Here


                } catch (FitbitAPIException e) {
                    throw new ServletException("Unable to finish authorization with Fitbit.", e);
                }
            }
            try {
                UserInfo userInfo = apiClientService.getClient().getUserInfo(new LocalUserDetail(resourceCredentials.getLocalUserId()));
                request.setAttribute("userInfo", userInfo);
                request.getRequestDispatcher("/fitbitApiAuthExample.jsp").forward(request, response);
            } catch (FitbitAPIException e) {
                throw new ServletException("Exception during getting user info", e);
            }
View Full Code Here

        }

        request.setAttribute("unitSystem", UnitSystem.getUnitSystem(Locale.US));

        try {
            UserInfo userInfo = context.getApiClientService().getClient().getUserInfo(context.getOurUser());
            request.setAttribute("userInfo", userInfo);
        } catch (FitbitAPIException e) {
            request.setAttribute("errors", Collections.singletonList(e.getMessage()));
            log.error(e);
        }
View Full Code Here

            parameters.add(new PostParameter("birthday", dateOfBirth));
            parameters.add(new PostParameter("height", height));
            parameters.add(new PostParameter("weight", weight));
            parameters.add(new PostParameter("timezone", timezone));

            UserInfo userInfo = context.getApiClientService().getClient().updateUserInfo(context.getOurUser(), parameters);
            String message = "Profile is successfully updated";
            messages.add(message);
            log.info(message);
        } catch (FitbitAPIException e) {
            if (e.getApiErrors() != null) {
View Full Code Here

        String url = APIUtil.contextualizeUrl(getApiBaseUrl(), getApiVersion(), "/user/" + fitbitUser.getId() + "/profile", APIFormat.JSON);

        try {
            Response response = httpGet(url, true);
            throwExceptionIfError(response);
            return new UserInfo(response.asJSONObject());
        } catch (FitbitAPIException e) {
            throw new FitbitAPIException("Error getting user info: " + e, e);
        } catch (JSONException e) {
            throw new FitbitAPIException("Error getting user info: " + e, e);
        }
View Full Code Here

        String url = APIUtil.contextualizeUrl(getApiBaseUrl(), getApiVersion(), "/user/-/profile", APIFormat.JSON);

        try {
            Response response = httpPost(url, params.toArray(new PostParameter[params.size()]), true);
            throwExceptionIfError(response);
            return new UserInfo(response.asJSONObject());
        } catch (FitbitAPIException e) {
            throw new FitbitAPIException("Error updating profile: " + e, e);
        } catch (JSONException e) {
            throw new FitbitAPIException("Error updating profile: " + e, e);
        }
View Full Code Here

TOP

Related Classes of com.fitbit.api.common.model.user.UserInfo

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.