Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2363

Re: Getting user image (picture) from web services

$
0
0
by Luca Viggiani.  

Ok I found the solution to my problem...

First of all, core_files_get_files is not the way... it will only show files information, it won't give you the actual file contents (binary).

Fortunately, there's an equivalent URL to be used when calling from external client app:

http://my_moodle_server/webservice/pluginfile.php

It accepts the same parameters/format as http://my_moodle_server/pluginfile.php and in addition you can also pass your token for web service authentication.

So profileimageurl field returned by core_user_get_users_by_field which looks like this:

http://my_moodle_server/pluginfile.php/89/user/icon/f1

can be turned into

http://my_moodle_server/webservice/pluginfile.php/89/user/icon/f1?token=my_web_service_token

Also note that appending ?token= parameter is required



Viewing all articles
Browse latest Browse all 2363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>