Hi. I would like to retrieve all users enrolled in a course that have been suspended using Moodle 3.8's web service funtions. Unfortunately, the suspended field seems to be absent from the API function `core_enrol_get_enrolled_users` I normally use.
I searched the web service API functions and found `core_enrol_search_users` that has a suspended field, however, it is marked as optional. And here comes the problem: When I call the function the optional fields are not returned.
The function asks for the permission `moodle/course:viewparticipants` but I cannot see how I can add these permissions to my user since the API user has already sys admin privileges..? Can anybody suggest a solution. Any help is highly appreciated.