Im trying to use the API on nextcloud 16 ( lastest as of today)
On trying to create a user on my install via command line, using
curl -X POST http://admin:email@example.com/ocs/v1.php/cloud/users -H "OCS-APIRequest: true" -d userid="newuser" -d password="newpassword
This works fine and a new user is created.
The problem is when i use curl -
$url = 'http://admin:firstname.lastname@example.org/ocs/v1.php/cloud/users -H "OCS-APIRequest: true"; $data = [ 'userid' => $username, 'password' => $userpassword, ]; $ch = curl_init($url); //print_r($ch);die(); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo "Response from curl :" . $response;
i get Response from curl : failure 998 Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services.
Any one how any ideas or advise that might help. be much appreciated.