通过 fileurl 访问 Moodle 课程概述图像文件

Access Moodle Course Overview Image File via fileurl

从获取课程 api,我得到一个 link 到上传的概述文件。

文件网址:http://{域名}/moodle/webservice/pluginfile.php/50/course/overviewfiles/image1001.png

当我尝试从浏览器访问它时,出现以下错误:

{"error":"A required parameter (token) was missing","errorcode":"missingparam","stacktrace":null,"debuginfo":null,"reproductionlink":空}

Moodle 版本:3.8.2

我需要做什么?我需要在哪里传递令牌?该令牌是否与 Web 服务用户令牌相同?

糟糕,我找到了解决方案。您需要将 "token" 附加到 url 而不是 "wstoken"。 例如:http://{domain}/moodle/webservice/pluginfile.php/50/course/overviewfiles/image1001.png?token=USER_TOKEN