cancel
Showing results for 
Search instead for 
Did you mean: 

Create new user in Alfresco from Surf

nitis
Champ in-the-making
Champ in-the-making
Hello,

I would like to know how can I create a new user in Alfresco from a Surf developed application… Because I tried to use a javascript webscript with People API but it doesn't exist in Surf or I don't know how to do it…

So If someone could tell me how register new users in Alfresco from a Surf portal I would be so grateful.

Thanks in advance.
Alberto
6 REPLIES 6

mrogers
Star Contributor
Star Contributor
What you will have to do is call the repository via one of the remote interfaces.  

Probably your best bet is to use a web script and the latest version of Alfresco already has a script to create a person.

nitis
Champ in-the-making
Champ in-the-making
I tried that, to use the people Javascript API, but when I try to use the object people to call the method people.getPerson(userName), for example… I get an error telling me that people doesn't exist and I supose it is not available form Surf, only from Alfresco…

This is my question because I cannot be so difficult…

Thanks

mrogers
Star Contributor
Star Contributor
Web Script.   Not Java Script.   You need to post JSON to the appropriate URL.

nitis
Champ in-the-making
Champ in-the-making
Ok, I think I didn't understand your message before, sorry…

You are saying to call remotely an Alfresco's webscript which will do the job… mmmm… I am gonna try and I tell ther result later

Thanks a lot.

nitis
Champ in-the-making
Champ in-the-making
Hi again!!

Could you tell me what is the appropiate URL to post data???

I have found /api/people, but I cannot post data and if you send a GET it returns a list of people…

Has anyone did it??? Help please

Thanks

nitis
Champ in-the-making
Champ in-the-making
Hi mrogers!

Finally I got to post a new JSON object with the data of a new person and Alfresco creted it, but I couldn't assign it a password and after create it I cannot remove it, because of an error…. I send a POST to /api/people…

I was reading about this problem, but I don't know if it has been fixed or what to do to make it properly.

Please help me.
Thank you very much.