How to fetch content of Book created in Moodle using APIs?

154 Views Asked by At

How to fetch content of Book created in Moodle using APIs?

I have tested mod_book_view_book function, but I am only getting book name, not the content of book.

1

There are 1 best solutions below

0
On

Use core_course_get_contents function, then take from response elements, where modname="book"

Example:

https://host/webservice/rest/server.php?wstoken=user_token&wsfunction=core_course_get_contents&moodlewsrestformat=json&courseid=31