Prerequisites
Enable webservices, and set the protocol to rest /admin/category.php?category=webservicesettings
Create a new service 'gradetest' which accesses only gradereport_user_get_grade_items with no permission restrictions
Create a token for the admin account, for the 'gradetest' service
Create a test course for testing
Visit /admin/settings.php?section=debugging and set debugging level to DEVELOPER
Visit /admin/tool/generator/maketestcourse.php and create an XS course for use in testing.
Note the courseid
Set a course idnumber and note this
View the participants page
Select a test user
Note the user id
Test the webservice from CLI
Open a terminal (with curl installed) and execute:
curl "{ADDRESS_HERE}/webservice/rest/server.php?wstoken={TOKEN_HERE}&wsfunction=gradereport_user_get_grade_items&moodlewsrestformat=json&courseid={COURSEID}&userid={USERID}" | json_pp -
Verify that the 'courseidnumber' entry contains the course idnumber
Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)