General developer forum

How to get assignment details

 
Picture of Zadok Lindt
How to get assignment details
 

I can see it is possible to get details of an assignment for the authenticated user, i.e.:

https://test/moodle/webservice/rest/server.php?wstoken=test&wsfunction=mod_assign_get_assignments&moodlewsrestformat=json

How do I get details of a specific assignment (i.e. by module or instance id?) Is it possible? I can see we can get basic details, i.e:

https://test/moodle/webservice/rest/server.php?wstoken=test&wsfunction=core_course_get_course_module&moodlewsrestformat=json&cmid=928

But it doesn't include important/useful details such as "Due Date", etc... 

 
Average of ratings: -
Picture of Zadok Lindt
Re: How to get assignment details
 

It appears that you are able to specify a courseid to narrow which assignment you might want to get info on (i.e. due date), but it fails:

https://test/moodle/webservice/rest/server.php?wstoken=test&wsfunction=mod_assign_get_assignments&moodlewsrestformat=json&courseids[0]=1

Even when you use the admin account that has access to everything (not enrolled, just maximum permission), we find:

{"courses":[],
"warnings":[{"item":"course","itemid":1,"warningcode":"2","message":"User is not enrolled or does not have requested capability"}]}

 
Average of ratings: -
Picture of Zadok Lindt
Re: How to get assignment details
 
Is there any way to find this information out?
 
Average of ratings: -