Search code examples
moodlemoodle-api

Access Moodle Course Overview Image File via fileurl


From the get course api, i get a link to the overview file uploaded.

fileurl: http://{domain}/moodle/webservice/pluginfile.php/50/course/overviewfiles/image1001.png

When i try to access it from browser, i get below error:

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

Moodle version: 3.8.2

What do i need to do? Where do i need to pass token? Is that token same as the Webservice User Token?


Solution

  • Oops i found the solution. Instead of "wstoken", you need to append "token" to the url. eg: http://{domain}/moodle/webservice/pluginfile.php/50/course/overviewfiles/image1001.png?token=USER_TOKEN