如何在Moodle LMS中检索课程的论坛/讨论附件?

如何在Moodle LMS中检索课程的论坛/讨论附件?,moodle,moodle-api,Moodle,Moodle Api,我必须列出课程中讨论的所有附件。我不知道如何在Moodle LMS中检索论坛/讨论中的所有附件URL 我的代码是c语言的,通常我将Moodle REST API称为http://localhost:8077/webservice/rest/server.php?wstoken=11e2d8b7f8e21ca1804e41e9cac5a812&wsfunction=core_course_get_contents&courseid=4&moodlewsrestformat=json我可以获取课程文

我必须列出课程中讨论的所有附件。我不知道如何在Moodle LMS中检索论坛/讨论中的所有附件URL

我的代码是c语言的,通常我将Moodle REST API称为
http://localhost:8077/webservice/rest/server.php?wstoken=11e2d8b7f8e21ca1804e41e9cac5a812&wsfunction=core_course_get_contents&courseid=4&moodlewsrestformat=json
我可以获取课程文件的文件URL

同样,我想检索论坛/讨论文件,但我没有看到任何文件URL或类似的内容。 我只看到以下回应:

[

    {

        "id": 22,

        "name": "General",

        "visible": 1,

        "summary": "",

        "summaryformat": 1,

        "section": 0,

        "hiddenbynumsections": 0,

        "uservisible": true,

        "modules": []

    },

    {

        "id": 23,

        "name": "Introduction",

        "visible": 1,

        "summary": "",

        "summaryformat": 1,

        "section": 1,

        "hiddenbynumsections": 0,

        "uservisible": true,

        "modules": [           

            {

                "id": 46,

                "url": "http://localhost:8077/mod/resource/view.php?id=46",

                "name": "Everest (.txt)",

                "instance": 24,

                "contextid": 102,

                "visible": 1,

                "uservisible": true,

                "visibleoncoursepage": 1,

                "modicon": "http://localhost:8077/theme/image.php/boost/core/1613571924/f/text-24",

                "modname": "resource",

                "modplural": "Files",

                "indent": 0,

                "onclick": "",

                "afterlink": null,

                "customdata": "\"a:1:{s:10:\\\"printintro\\\";i:1;}\"",

                "noviewlink": false,

                "completion": 1,

                "completiondata": {

                    "state": 0,

                    "timecompleted": 0,

                    "overrideby": null,

                    "valueused": false

                },

                "contents": [

                    {

                        "type": "file",

                        "filename": "Everest.txt",

                        "filepath": "/",

                        "filesize": 935,

                        "fileurl": "http://localhost:8077/webservice/pluginfile.php/102/mod_resource/content/1/Everest.txt?forcedownload=1",

                        "timecreated": 1621949734,

                        "timemodified": 1621949744,

                        "sortorder": 1,

                        "mimetype": "text/plain",

                        "isexternalfile": false,

                        "userid": 2,

                        "author": "DP Bhatt",

                        "license": "unknown"

                    }

                ],

                "contentsinfo": {

                    "filescount": 1,

                    "filessize": 935,

                    "lastmodified": 1621949744,

                    "mimetypes": [

                        "text/plain"

                    ],

                    "repositorytype": ""

                }

            },

            {

                "id": 47,

                "url": "http://localhost:8077/mod/forum/view.php?id=47",

                "name": "Forum",

                "instance": 5,

                "contextid": 112,

                "visible": 1,

                "uservisible": true,

                "visibleoncoursepage": 1,

                "modicon": "http://localhost:8077/theme/image.php/boost/forum/1613571924/icon",

                "modname": "forum",

                "modplural": "Forums",

                "indent": 0,

                "onclick": "",

                "afterlink": null,

                "customdata": "\"\"",

                "noviewlink": false,

                "completion": 1,

                "completiondata": {

                    "state": 0,

                    "timecompleted": 0,

                    "overrideby": null,

                    "valueused": false

                }

            }

        ]

    }

]
如果有人引导我走上正确的道路,那就太好了。事先非常感谢