The first you must use the function "core_course_get_content".
This function will return a lot of fileutl from a course.
Ex: 1 file URL
http://<your moodle>/webservice/pluginfile.php/37/mod_resource/content/1/BTXDPMHDT.pdf?forcedownload=1
and then, You just add a token into URL
http://<your moodle>/webservice/pluginfile.php/37/mod_resource/content/1/BTXDPMHDT.pdf?forcedownload=1&token=6a18222af87608fe4d2ab2ca7ab1f49a