API for Course Contents (Quiz, Assignment, Book, File, etc.)

API for Course Contents (Quiz, Assignment, Book, File, etc.)

by Alfin Rahardja -
Number of replies: 2

Hi all,

I am trying to integrate moodle with a third-party software using API. Is there any provided REST API from moodle to CRUD the course contents such as quiz, assignment, book, file, h5p, etc.?

If the API is not available, is it possible to develop by my own? And what are the potential risks? I am using moodle 3.11 and I heard it's very risky to develop API since there is an upcoming major moodle upgrade (moodle 4.0).

Thanks all!

Average of ratings: -
In reply to Alfin Rahardja

Re: API for Course Contents (Quiz, Assignment, Book, File, etc.)

by Benjamin Ellis -
Picture of Particularly helpful Moodlers
Hi,

Many of the core Moodle plugins provide external services which can be accessed via the REST protocol. You will have to look at the individual plugins usually in its externallib.php or classes/external.php files. I thought there was a page listing the core services in the documentation somewhere but I cannot find it. 

There is little risk in developing plugins in M3.11 as usually the next version rarely completely breaks previous versions  - there is a period of deprecation before major functionality is changed and for added measure, M4.0 is heavily concentrated on the User Interface.

Again, at the risk of sounding like a dodgy salesman, my book has an example of developing external services for plugins - see https://mukudu.net/publishing/m39plugindevelopment/index.php - which is heavily discounted on Amazon India too.
Average of ratings: Useful (1)
In reply to Alfin Rahardja

Re: API for Course Contents (Quiz, Assignment, Book, File, etc.)

by Alfin Rahardja -

Hi Benjamin,

Thanks for the explanation. Really appreciate it!