by Turakar Turakar.
Hello,
I'm trying to implement a client which allows browsing the private files of a user to display them on a connected beamer.
I therefore obtained a token successfully (as service moodle_mobile_app, as I did not yet register an own service) and saved it. I then did a request like this:
curl 'https://thehost/webservice/rest/server.php?wstoken=mytoken&moodlewsrestformat=json&wsfunction=core_files_get_files&component=user&filearea=private&itemid=0&filepath=%2F&filename=test.txt&contextid=0'
I obtained values for all the parameters using various searches, but I did not yet understand the meaning of component, itemid and contextid. What would be appropiate values for them?
I also tried the following request to browse the files in generale, i.e. list them:
curl 'https://thehost/webservice/rest/server.php?wstoken=mytoken&moodlewsrestformat=json&wsfunction=core_files_get_files&component=user&filearea=private&itemid=0&filepath=%2F&filename=&contextid=0'
But this delivered, like the first command:
{"parents":[],"files":[]}
So what am I doing wrong?
Best regards,
Turakar