Issued with using the REST api

Issued with using the REST api

by Aaran Grimley -
Number of replies: 0

Hi, I have been using the following string to access the REST api of our moodle install


/webservice/rest/server.php/?wsfunction=core_enrol_get_enrolled_users&moodlewsrestformat=json&courseid=5078&wstoken=MYTOKEN&options[0][name]=userfields&options[0][value]=id&options[1][name]=userfields&options[1][value]=fullname&options[2][name]=userfields&options[2][value]=email&options[3][name]=userfields&options[3][value]=username&options[4][name]=userfields&options[4][value]=idnumber


This successfully pumps out some json formatted data like so

[{"id":1600,"username":"name1","fullname":"A Stark","email":"a.stark@email.uk","idnumber":"123456"},{"id":2019,"username":"name2","fullname":"B Stark","email":"b.stark@email.uk","idnumber":"123457"}


 I would also like to get some roles to allow me to better filter the results, I have tried adding 

&options[5][name]=userfield&options[5][value]=roles

To the end of the string but this does not give any additional information. Any advice on how I messed up?

Average of ratings: -