AnsweredAssumed Answered

can't add person RESTful API

Question asked by khanh on Aug 13, 2012
Latest reply on Aug 14, 2012 by jpotts
Hi,
i'm trying to create a new user using the REST javascript api.
but whenever I post to it, it always comes back with the logged in user info, and does not create the new user?

http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Freferences%2FRESTful-PersonPeoplePost.html

I've tried to append the alf_ticket to the url also and still doesn't create the user.
Can someone help?


ticket was generated from:

/alfresco/service/api/login?u=adminyser&pwd=adminpass


   function addperson(ticket){

      var url = "/alfresco/service/api/people?alf_ticket="+ticket;
      var userInfo = {userName : "testuser" , password: "testpassword" , firstName : "testfirst", lastName : "testlast", email : "testemail@test.com",  disableAccount: false, quote: -1, groups: []};
      $.ajax({
            type: 'POST',
            url: url,
            data: JSON.stringify(userInfo) ,
            dataType: 'json',
            success: function (response) {
   
            },
            error: function (response) {
            }
        });
   
   }

if seems like the post is not going in and it just returning the admin user.

Outcomes