简体   繁体   中英

Error when updating APIGEE Entities

Im currently developing an application that implements apigee, however, i've come across an issue when trying to update entities. Below is the method i'm currently using.

            Map<String, Object> updatedEntity = new HashMap<String, Object>();
            ArrayList<Map<String,Object>> subPropertyArray = new ArrayList<Map<String,Object>>();
            Map<String, Object> subProperty = new HashMap<String, Object>();

            subProperty.put("age", "");
            subProperty.put("auto_checkin_times", auto_checkin_times);
            subProperty.put("auto_checkins_enabled", "on");
            subProperty.put("bio", "");
            subProperty.put("max_age", "999");
            subProperty.put("min_age","18");
            subProperty.put("dob", mDob);
            subProperty.put("locale","");
            subProperty.put("sex", mGender);
            subProperty.put("sexual_preference", mSexualPreference);
            subProperty.put("utc_offset","");
            subPropertyArray.add(subProperty);


            updatedEntity.put("type", "user");
            updatedEntity.put("info", subPropertyArray);

            dataClient.updateEntityAsync(entityID, updatedEntity, new ApiResponseCallback() {
                @Override
                public void onResponse(ApiResponse apiResponse) {
                    if (apiResponse != null) {
                            Intent intent = new Intent(SetupPage.this, HomePage.class);
                            startActivity(intent);
                    }
                }

                @Override
                public void onException(Exception e) {
                    Log.e("", e.toString());
                }
            });

However I'm getting the following error:

"Error PUT to ' https://api.usergrid.com/ ORGNAME / APPNAME /user/ USERID "

followed by:

"No authentication challenges found"

"doHttpRequest returned null"

Any assistance would be highly appreciated. Thanks

Are you sending a token with your request? The "No authentication challenges found" errors makes me think you could be either passing a token to an endpoint that doesn't require it (eg the default sandbox app), or passing an invalid token with the request.

我应该回复得到他早些时候,然而,问题似乎是由于一些问题,实体代码有点错误,我发布的数据格式不正确。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM