Hi.
Iām trying to remove a user from a group and having this Instruction set for users ā Nextcloud latest Administration Manual latest documentation as a reference.
But I get a statusCode of ā996ā with the message āInternal Server Errorā. I dig deeper and found the problem is the second parameter (groupid) for the method UsersController::removeFromGroups is expected to be a string, but null is received. Actually there is no parameter groupid in the parameter bag of the request object.
This is the code I running:
$url = $cloudUrl.$url_OCS_Users.ā/users/my_user/groupsā;
$groupName = āGROUP_TESTā;
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_HTTPHEADER, array(
'Authorization: Basic '. $auth,
āOCS-APIRequest: trueā,
));
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_CUSTOMREQUEST, āDELETEā);
$data = [
āgroupidā => $groupName,
];
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($handle);
Instead of calling with DELETE method I call with POST method and everything is ok (the user is added to a group in this case).
How can I send the groupid parameter in case of DELETE?
Thanks in advance