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
RE: Not able to add user using url
hi,I am able to enquire a user using the URL of API by appending p_auth value say
http://localhost:8080/api/jsonws/user/get-user-by-id/user-id/146468?p_auth=xm5BTj9v
But when i try to add a user using the URL and appending p_auth
http://test:test@localhost:8080/api/jsonws/user/add-user/company-id/20097/auto-password/false/password1/%3B/password2/%3B/auto-screen-name/true/screen-name/email-address/dfsc%40gmail.com/facebook-id/0/open-id/locale/en_US/first-name/baa/middle-name/last-name/cbb/prefix-id/0/suffix-id/0/male/true/birthday-month/1/birthday-day/1/birthday-year/1970/job-title/group-ids/organization-ids/role-ids/user-group-ids/send-email/true?p_auth=xm5BTj9v
i get error as
Can any one please help?
http://localhost:8080/api/jsonws/user/get-user-by-id/user-id/146468?p_auth=xm5BTj9v
But when i try to add a user using the URL and appending p_auth
http://test:test@localhost:8080/api/jsonws/user/add-user/company-id/20097/auto-password/false/password1/%3B/password2/%3B/auto-screen-name/true/screen-name/email-address/dfsc%40gmail.com/facebook-id/0/open-id/locale/en_US/first-name/baa/middle-name/last-name/cbb/prefix-id/0/suffix-id/0/male/true/birthday-month/1/birthday-day/1/birthday-year/1970/job-title/group-ids/organization-ids/role-ids/user-group-ids/send-email/true?p_auth=xm5BTj9v
i get error as
{"exception":"No JSON web service action with path /user/add-user and method GET for null","throwable":"com.liferay.portal.kernel.jsonwebservice.NoSuchJSONWebServiceException: No JSON web service action with path /user/add-user and method GET for null","error":{"message":"No JSON web service action with path /user/add-user and method GET for null","type":"com.liferay.portal.kernel.jsonwebservice.NoSuchJSONWebServiceException"}}Can any one please help?
Hi,
We need to add blank values also in url with null or [] , Please try the below url :
http://test:test@localhost:8080/api/jsonws/user/add-user/company-id/20097/auto-password/false/password1/%3B/password2/%3B/auto-screen-name/true/screen-name/null/email-address/dfsc%40gmail.com/facebook-id/0/open-id/null/locale/en_US/first-name/baa/middle-name/null/last-name/cbb/prefix-id/0/suffix-id/0/male/true/birthday-month/1/birthday-day/1/birthday-year/1970/job-title/null/group-ids/%5B%5D/organization-ids/%5B%5D/role-ids/%5B%5D/user-group-ids/%5B%5D/send-email/true?p_auth=Pguw3Cun
We need to add blank values also in url with null or [] , Please try the below url :
http://test:test@localhost:8080/api/jsonws/user/add-user/company-id/20097/auto-password/false/password1/%3B/password2/%3B/auto-screen-name/true/screen-name/null/email-address/dfsc%40gmail.com/facebook-id/0/open-id/null/locale/en_US/first-name/baa/middle-name/null/last-name/cbb/prefix-id/0/suffix-id/0/male/true/birthday-month/1/birthday-day/1/birthday-year/1970/job-title/null/group-ids/%5B%5D/organization-ids/%5B%5D/role-ids/%5B%5D/user-group-ids/%5B%5D/send-email/true?p_auth=Pguw3Cun
Thanks, it is working. But even when i pass admin parameters in the url like
http://test:test@localhost:8080/api/jsonws/user/add-user/
it gives error as
can any one please help
http://test:test@localhost:8080/api/jsonws/user/add-user/
it gives error as
{"exception":"Access denied to com.liferay.portal.kernel.service.UserService#addUser","throwable":"java.lang.SecurityException: Access denied to com.liferay.portal.kernel.service.UserService#addUser","error":{"message":"Access denied to com.liferay.portal.kernel.service.UserService#addUser","type":"java.lang.SecurityException"}}can any one please help
You either need to be logged in (have active session ) or send user credential through basic auth.