User provisioning API removing user from group

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

Solved (for me).
I couldnā€™t pass the groupid in the payload, so I change route definition in apps/provisioning_api/appinfo/routes.php to
[ā€˜rootā€™ => ā€˜/cloudā€™, ā€˜nameā€™ => ā€˜Users#removeFromGroupā€™, ā€˜urlā€™ => ā€˜/users/{userId}/groups/{groupid}ā€™, ā€˜verbā€™ => ā€˜DELETEā€™],

Now I can remove users from groups.

Anyway, is someone knows the solution without changing nextCloud source code, it will be very helpfull.