I am trying add user by curl php, but don't add only sent me the admin info, here it's the code $data = array( "userName" => "ECASAS", "firstName" => "Eduardo", "lastName" => "Casas", "email" => "lgonzalez@emt.cl", "password"=>"asdasd" );
$str_data = json_encode($data);
$ch = curl_init(); $username='admin'; $password='*******'; // initiate curl $url = "http://************/alfresco/service/api/people"; // where you want to post data curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); curl_setopt($ch, CURLOPT_POST, true); // tell curl you want to post something curl_setopt($ch, CURLOPT_POSTFIELDS, $str_data); // define what you want to post curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format $output = curl_exec ($ch); // execute curl_close ($ch); // close curl handle var_dump($output); // show output if sameone can help me please.
Take a look at this forum post - https://forums.alfresco.com/comment/146735#comment-146735 where it is solved to invoke using the java code. You also need to ensure to pass the request data in valid json when you are invoking the webscript call.