curl command to include first name, last name, email when adding user | Community
Skip to main content
New Participant
February 20, 2024
Solved

curl command to include first name, last name, email when adding user

  • February 20, 2024
  • 1 reply
  • 761 views

I'm fairly new to Adobe Experience Manager.

 

I can use the following command to add a new user it and assign it multiple groups, but I have to manually add the First Name, Last Name, and Mail information after I have added the user ID.

 

curl --user admin:admin -F createUser=userid -F authorizableId=userid -F membership=contributor -F membership=everyone http://localhost:####/directory/subdirectory -k

 

Is there a way for me to add the additional information within the above curl command?

 

I would appreciate any help.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

Hi @patmcg61,

This is possible you can simply add additional parameters for fields like First Name, Last Name and Email. In general above information are stored under profile node of given user.

profile/familyName profile/givenName profile/email

You can use above in your cURL command, like this:

curl -u admin:admin -FcreateUser=testuser -FauthorizableId=hashimkhan -Frep:password=hashimkhan -Fprofile/familyName=Smith -Fprofile/givenName=John http://localhost:4502/libs/granite/security/post/authorizables

Please have a look into official AEM documentation, for more information/examples regarding cURL usage: https://experienceleague.adobe.com/docs/experience-manager-65/content/sites/administering/operations/curl.html?lang=en#user-management

1 reply

lukasz-m
lukasz-mAccepted solution
New Participant
February 20, 2024

Hi @patmcg61,

This is possible you can simply add additional parameters for fields like First Name, Last Name and Email. In general above information are stored under profile node of given user.

profile/familyName profile/givenName profile/email

You can use above in your cURL command, like this:

curl -u admin:admin -FcreateUser=testuser -FauthorizableId=hashimkhan -Frep:password=hashimkhan -Fprofile/familyName=Smith -Fprofile/givenName=John http://localhost:4502/libs/granite/security/post/authorizables

Please have a look into official AEM documentation, for more information/examples regarding cURL usage: https://experienceleague.adobe.com/docs/experience-manager-65/content/sites/administering/operations/curl.html?lang=en#user-management

PatMcG61Author
New Participant
February 21, 2024

Thank you.

 

I will try this.