How to retrieve Forum discussion attachments in a course?

Re: How to retrieve Forum discussion attachments in a course?

by lior gil -
Number of replies: 0
Picture of Core developers
If you want to get forums data through the API, why not use the forum's API?
You can get the forums using mod_forum_get_forums_by_courses()
Then get each forum's discussions with mod_forum_get_forum_discussions_paginated()
Then finally get the attachments with mod_forum_get_forum_discussion_posts()

Haven't used them myself, so there might be a better way for it, but this way should work.