API to get ALL Moddle courses...

API to get ALL Moddle courses...

by Miladin Joksic -
Number of replies: 0

Hi,


I've been assigned with task that require me to make some synchronization process between Moodle entities and entities from our .NET system.

I've read Moodle API, created some examples but there are some things that I could not find answers to on internet, your forums and API docs.

1. Based on current API docs, I can not find a way to get list of ALL Moddle entities for specified type, e.g. I want to get list of ALL Moodle courses, if possible, in one API call. If this is not possible, is there any way to get list of ALL Moodle course IDs in one API call? If nothing of this is possible, please advise on how to get ALL Moodle courses, even with multiple calls to Moodle API.

2. My sync process will use 'LastModifiedDate' value from our system entities in order to decide if we need to update Moodle entity and/or our system entity. I can see that when I make API call to 'moodle_course_get_courses' API function, returned object has 'timemodified' property. Can I use this value and compare it to our 'LastmodifiedDate' property in order to decide what entity I must update? Property like this is not returned when I query for Moodle users, so please advise, what property can I use to get this value for Moodle user? Is there any chance that I can use existing Moodle API to get this value of any type of Moodle entity? I am aware that I can write custom PHP web service method calls inside Moodle to get these, but i wpould like someone to confirm me that I can not achieve this through default Moodle API in order to get some additional time to do this from my employeer smile

My employer asked me not to mess up with Moodle database tables directly, rather to use Moodle API to achieve all stated above smile
Please let me know if things from above can not be achieved from Moodle API, and in that case, please provide me with details on which Moodle database tables I should query and on which columns in order to resolve my situation smile

Thanks in advance
Average of ratings: -