AnsweredAssumed Answered

Rest : update person problem

Question asked by dfr on May 10, 2013
Latest reply on May 16, 2013 by dfr
hello,

I try to use PUT : /api/people/{userName} for update a user.
I'm use this API in a webscript in a spring surf application with remote call.

I use this code :

tmpUser = {};
tmpUser.firstName = objFrm.firstName;
tmpUser.lastName = objFrm.lastName;
tmpUser.email = objFrm.email;
tmpUser.telephone = objFrm.telephone;
tmpUser.mobile = objFrm.mobilPhone;
tmpUser.skype = objFrm.skype;
tmpUser.instantmsg = objFrm.instantMsg;
tmpUser.googleusername = objFrm.googleUsername;
tmpUser.location = objFrm.location;
tmpUser.persondescription = objFrm.biography;
tmpUser.organisation = objFrm.organization;
tmpUser.organizationId = objFrm.organization;
tmpUser.jobtitle = objFrm.jobTitle;
tmpUser.companyemail = objFrm.companyEmail;
tmpUser.companytelephone = objFrm.companyTelephone;
tmpUsercompanyfax = objFrm.companyFax;
tmpUser.companyaddress1 = objFrm.companyAddress1;
tmpUser.companyaddress2 = objFrm.companyAddress2;
tmpUser.companypostcode = objFrm.companyPostcode;
tmpUser.companyaddress3 = objFrm.companyAddress3;
      
var resultUser = connector.put("/api/people/" + user.name, jsonUtils.toJSONString(tmpUser), "application/json");

Where objFrm is a json object create from html Form and send to my webscript by json object.
All properties are updated except persondescription and googleusername and i don't know why !
Of course i have checked values of tmpUser before call for all properties and it is ok !
I have read all names of properties for tmpUser in resultUser object.

I'm sure call with PUT method return is ok (objResult is ok and other properties are updated) but persondescription is allaws reset with empty string and googleusername is never update.
I know this because i have changed this two properties by share and try to update it with my surf project.
If i delete code line for update persondescription old value persit (value set with share) but if i put line code persondescription is reset to empty string !
For googleusername value set with share allaws persit (with and without line code for update)


Sorry for my poor english and thank you for help or idea …

Outcomes