Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
add user using curl api
Hello, i need to create 500 new users in my portal. I am trying api json and i can not create user. Liferay says an error:
I use this curl:curl http://localhost:8080/api/jsonws/user/add-user -u test@liferay.com:12345 -d companyId=20101 -d autoPassword=false -d password1='12345' -d password2='12345' -d autoScreenName=true -d screenName= -d emailAddress='acvalle@gmail.com' -d facebookId=0 -d openId='' -d locale= -d firstName='Antonio' -d middleName='Manuel' -d lastName='Caballero' -d prefixId=0 -d suffixId=0 -d male=true -d birthdayMonth=1 -d birthdayDay=1 -d birthdayYear=1970 -d jobTitle='currante' -d groupIds= -d organizationIds= -d roleIds= -d userGroupIds= -d addresses= -d emailAddresses= -d phones= -d websites= -d announcementsDelivers= -d sendEmail=false
And liferay says:ERROR [http-nio-8080-exec-6][JSONWebServiceServiceAction:114] Email name address must validate with com.liferay.portal.kernel.security.auth.DefaultEmailAddressValidator
Help me please. Thakns
I use this curl:curl http://localhost:8080/api/jsonws/user/add-user -u test@liferay.com:12345 -d companyId=20101 -d autoPassword=false -d password1='12345' -d password2='12345' -d autoScreenName=true -d screenName= -d emailAddress='acvalle@gmail.com' -d facebookId=0 -d openId='' -d locale= -d firstName='Antonio' -d middleName='Manuel' -d lastName='Caballero' -d prefixId=0 -d suffixId=0 -d male=true -d birthdayMonth=1 -d birthdayDay=1 -d birthdayYear=1970 -d jobTitle='currante' -d groupIds= -d organizationIds= -d roleIds= -d userGroupIds= -d addresses= -d emailAddresses= -d phones= -d websites= -d announcementsDelivers= -d sendEmail=false
And liferay says:ERROR [http-nio-8080-exec-6][JSONWebServiceServiceAction:114] Email name address must validate with com.liferay.portal.kernel.security.auth.DefaultEmailAddressValidator
Help me please. Thakns
Dear Antonio,
Just now I ran into this problem, and I managed to solve it by removing the single quotes from the emailAddress variable, like this:
emailAddress=acvalle@gmail.com
(instead of: emailAddress='acvalle@gmail.com')
After that, I tested your full curl command on a vanilla Liferay DXP 7.2 FP4 (on 17 Apr 2020), and the user was created successfully.
Best Regards,
Peter
Just now I ran into this problem, and I managed to solve it by removing the single quotes from the emailAddress variable, like this:
emailAddress=acvalle@gmail.com
(instead of: emailAddress='acvalle@gmail.com')
After that, I tested your full curl command on a vanilla Liferay DXP 7.2 FP4 (on 17 Apr 2020), and the user was created successfully.
Best Regards,
Peter