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: API Update user name
Hello,
we need to update user in Liferay, based on changes is our system, including firstName and lastName. API has method for whole user update, but it needs all data including all organizations, all groups, etc. otherwise it removes them. We were not able to get all of these data from JSON API calls.
Is there an easy way to call this method and have all data that needs
to be passed in request? Get user method does not return all that is
needed.
We are thinking about writing our own endpoint for this
update, but from java its the same in terms of data that are needed.
But there it could be easier to get everything we need. Is there some
other method, to change just what we want, that we missed?
Thank you for any help
I might be misunderstanding, but you should be able to PUT the user account to update it:, and you don't need nearly as many parameters
curl -H "Content-Type: application/json" \
-X PUT "http://localhost:8080/o/headless-admin-user/v1.0/user-accounts/42761" \
-d "{\"alternateName\": \"baker\", \"emailAddress\": \"able@liferay.com\", \"familyName\": \"Bar\", \"givenName\": \"Baker\"}" \
-u "test@liferay.com:test"
See the User Account API docs.
Powered by Liferay™