Message Boards

Unable to create new user using JSONWS API :add-user-with-workflow

thumbnail
Ramalingaiah. D, modified 5 Years ago.

Unable to create new user using JSONWS API :add-user-with-workflow

Expert Posts: 486 Join Date: 8/16/14 Recent Posts
Hi ,



We are invoking the API 'add-user-with-workflow'using the following request body:

Getting resnse :
"Conversion failed: ; <--- java.lang.NumberFormatException: For input string: \"\""

Liferay.Service(
  '/user/add-user',
  {
    companyId: 20099,
    autoPassword: false,
    password1: 'test',
    password2: 'test',
    autoScreenName: false,
    screenName: 'test1',
    emailAddress: 'test1@gmail.com',
    facebookId: 0,
    openId: '',
    locale: ,
    firstName: 'test1',
    middleName: 'test1',
    lastName: 'test1',
    prefixId: 11,
    suffixId: ,
    male: false,
    birthdayMonth: 1,
    birthdayDay: 1,
    birthdayYear: 1992,
    jobTitle: 'software',
    groupIds: [34938],
    organizationIds: null,
    roleIds: [20109],
    userGroupIds: null,
    sendEmail: true
  },
  function(obj) {
    console.log(obj);
  }
);


thumbnail
David H Nebinger, modified 5 Years ago.

RE: Unable to create new user using JSONWS API :add-user-with-workflow

Liferay Legend Posts: 14916 Join Date: 9/2/06 Recent Posts
So you have to check server side to see what field the conversion failed on, likely the open id since that's the only column you're sending an empty string.
thumbnail
Ramalingaiah. D, modified 5 Years ago.

RE: Unable to create new user using JSONWS API :add-user-with-workflow

Expert Posts: 486 Join Date: 8/16/14 Recent Posts
Dear David,


it is working fine now

thank you so much.


Thank you 
Ram
thumbnail
Gnaniyar Zubair, modified 5 Years ago.

RE: Unable to create new user using JSONWS API :add-user-with-workflow

Liferay Master Posts: 722 Join Date: 12/19/07 Recent Posts
HI,

It worked after David replied or really u had some issue while parsing ... ? emoticon

Please share the issue u identified which would be helpful for others.