2

I am using Moodle 2.7.4.

I am writing a web application that uses moodle REST APIs. But I couldn't find an API to change User profile picture.

Can anybody tell me what the API is and its docs.

PS: I know we can upload file with /webservice/upload.php
This API is returning the itemid after uploading the file.
Even after updating this itemid to mdl_user tables picture column, it is not displaying the image.
It is not displaying image even after I update the id of mdl_files column for this itemid, to mdl_user table.
For this call, My filearea is draft (When I set as icon, it is throwing 500 error)

Harikrishnan
  • 3,664
  • 7
  • 48
  • 77
  • Apparently, there isn't. The only way of updating user info via webservice is through the "core_user_update_users" service, which does not include the possibility of updating the profile picture. Is the option of creating a new webservice viable for you? – Aldo Paradiso Jun 01 '17 at 13:24
  • Thanks for your reply. I will write a custom web service then. – Harikrishnan Jun 02 '17 at 03:56

1 Answers1

3

There i not single API for this function but you may use "core_files_upload" to upload files and then use "core_user_update_picture" function for change the user profile picture image. plz find this function in API documentation then you ill get an idea.

Akshay Kumbhar
  • 279
  • 3
  • 6