You should ask in the Web services forum https://moodle.org/mod/forum/view.php?id=6971, in any case here is some sample code:
You should ask in the Web services forum https://moodle.org/mod/forum/view.php?id=6971, in any case here is some sample code: