Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

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

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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...

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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...