by Julian Corrêa.
I'm using REST getting course data and after the files references, like this:
http://localhost:8080/webservice/rest/server.php?wstoken=3e6e578810548df1019806cf48938e1f&wsfunction=core_course_get_contents&courseid=1206&moodlewsrestformat=json.
The returns is a JSON like this:
Look than the contents property is an array of itens. Each object in the array have a type property that indentifies if is a file or not.
The fileurl property is the url for download, but is necessary append the token parameter at the end of URL, like this:
http://localhost:8080/webservice/pluginfile.php/32243/mod_resource/content/1/PLANO%20ENSINO%202014.1%20GEST%20MANUT%20N.pdf?forcedownload=1&token=3e5e578d10544df1019d06cf48938e1f
Hope this helps.