public static void deleteGroupsById(long[] groupids) throws MoodleRestGroupException, UnsupportedEncodingException, MoodleRestException {
        StringBuilder data=new StringBuilder();
        String functionCall=MoodleCallRestWebService.isLegacy()?MoodleServices.MOODLE_GROUP_DELETE_GROUPS:MoodleServices.CORE_GROUP_DELETE_GROUPS;
        if (MoodleCallRestWebService.getAuth()==null)
            throw new MoodleRestGroupException();
        else
            data.append(MoodleCallRestWebService.getAuth());
        data.append("&").append(URLEncoder.encode("wsfunction", MoodleServices.ENCODING)).append("=").append(URLEncoder.encode(functionCall, MoodleServices.ENCODING));
        for (int i=0;i<groupids.length;i++) {
            if (groupids[i]<1) throw new MoodleRestGroupException(); data.append("&").append(URLEncoder.encode("groupids["+i+"]", MoodleServices.ENCODING)).append("=").append(groupids[i]);
        }
        data.trimToSize();
        MoodleCallRestWebService.call(data.toString());
    }