cancel
Showing results for 
Search instead for 
Did you mean: 

Add person web script

speedster
Champ in-the-making
Champ in-the-making
Hi,

I am trying to add a User using web script : POST /alfresco/service/api/people , filling all the man-
datory fields.But the user is not getting created.It just returns logged in user details.No exceptions
or error logs as well

Any idea whats wrong
6 REPLIES 6

speedster
Champ in-the-making
Champ in-the-making
I ended up creating my own webscipt with java controller class.

majicj
Champ in-the-making
Champ in-the-making
I used a web app called Firefox Poster which allows me to construct POST GET requests. 

You can find Poster here https://addons.mozilla.org/en-US/firefox/addon/2691/

Start up Poster and enter the following
URL -> http://localhost:8080/alfresco/service/api/people

In the Content to Send Section
Content Type ->  application/json

In the Content Box enter your user info in JSON format below. (everything below including the curly brackets)

{   
   "userName" : "myNewUser",
   "firstName" : "John",
   "lastName" : "Doe",
   "organisation" : "Example Company Inc",
   "email" : "Johndoe@example.com"
}

Good Luck!

michaelc
Champ on-the-rise
Champ on-the-rise
I used a web app called Firefox Poster which allows me to construct POST GET requests.

Ohhhh that's cool - that's a rocken plug-in I see all sorts of good use for that one.

avastation
Champ in-the-making
Champ in-the-making
Hi i have read your replay , i did install the poster but i didnt get the possibility to get the section to choice the applicatoin/json, can you please help me, to do it with the right way , thank you very much for your help, it is very urgent for me, Smiley Sad(((((, if you can send me step by step instructions to do it, ,i am using fedora core 13, alfresco comm 3.3.1, firefox 3.6.4, my email is hharhouri@dottn.com, i am waiting for your replay please, and about the api/people where to place it under alfresco if i did understand, thank you again

avastation
Champ in-the-making
Champ in-the-making
I have figured out the way to run the poster with fire fox, when i excute a get command it works, but when i excute a post command it crash with 500 internal errors, here you got the screen shoot of the probleme, you will find on the right the get execution result, on the left the put execution result, waiting for you response

this is the user that i want to add
{
   "url": "\/alfresco\/service\/api\/person\/fzied22",
   "userName": "fzied2222",
   "enabled": true,
   "firstName": "Zied-test-firefox",
   "lastName": "FAKHFAKH",
   "jobtitle": "",
   "organization": "",
   "location": "",
   "telephone": null,
   "mobile": null,
   "email": "test@test.com",
   "companyaddress1": null,
   "companyaddress2": null,
   "companyaddress3": null,
   "companypostcode": null,
   "companytelephone": null,
   "companyfax": null,
   "companyemail": null,
   "skype": null,
   "instantmsg": null,
   "googleusername": null,
   "quota": -1,
   "sizeCurrent": 0,
   "persondescription": null
}

Ps: i couldnt attach the screen shot if you can send me you eamil i send it to you, if you can and want to help me, i will be very gratfull

avastation
Champ in-the-making
Champ in-the-making
i know that i am disturbing you, Smiley Tongue sorry, but i have figured out haw to run it and add the user in alfresco, what i need is to add x users ( like 20 users using this script is it possible?)