Hello Kevin,
I have the same problem, have you resolved it?
Regards
Hello Kevin,
I have the same problem, have you resolved it?
Regards
Hi Dee:
I was able to revert back to an earlier test system I was using and launch a new server from the old instance (on Amazon Web Services). That one worked for some reason. I don't understand what was happening with the original issue...
Best,
Kevin
Hi Tim,
Did you find a solution to your problem?
I am facing the exact same issue.
Thanks, Sumit
Hi Surmit
there are several solutions that I found:
1. Give the webservices login account admin rights, you then get all the fields
2. You can get some fields by turning them on in the profile, email for example
It seems hit and miss to find out what fields you can get, not sure why you would restrict them but I guess its part of the bigger permissions picture.
The searching needs to have these fields enabled as well, so if you want to search by username then you must have this field returned as well. the only way I found of getting/searching by username for example was to give the web service account admin rights which seems a bit overkill!
Good luck
Thanks, Tim for pointing out the direction.
Managed to get it working by providing the following permission to Webservice User
moodle/user:viewalldetails
Hi all,
Is there a webservice call I can use to return a list of roles which can be granted within courses?
many thanks
For Registration You can use core_user_create_users API. and login i am also looking.
did you mean to access direct to the database?
I search for a way to pull all files from Course, maybe also html texts.
The first approach i tried was the Sword Plugin, but it only offers to upload files to a repository. I also need to upload existing files/courses.
The second approach was to use a self written portfolio Plugin, but i recognized it is only possible to export User Data and not whole courses.
The third aüproach is to pull the courses from the rest api. I use the API from https://github.com/bantonia/MoodleRest/.
I only managed to get the Course "metadata" and i need help to also pull all related files and texts. I got the courses with the Code:
final MoodleCourse[] courses = MoodleRestCourse.getAllCourses();
I am also aware of the the Method MoodleRestFile.getFiles() and the Class MoodleFileParent, but i do not really get how to use it. I hope i can get some Help here.
A fallback approach would be export a course to .mbz and reupload it to the repository and parse it, but i think the file format can change and it requires additional steps for the user.
Is it possible to add an assignment to a course using a web service?
Hello everyone, I hope I have put this in the right place...
I have put together a patch for adding this webservice, and posted it on the related Tracker issue here:
No group update webservice (core_groups_update_group)
But as I am so shiny and new I am unable to edit the issue to fill out the Pull From Repository, Pull Master Branch or Pull Master Diff URL fields, or even see the Open for Peer Review button that the docs insist I should be clicking.
Would someone please be able to do some of the above so at least the automated testing can start?
Thanks,
Robyn
There are no function for that on the current list https://docs.moodle.org/dev/Web_service_API_functions but there are some discussions on tracker. I could not find the MDL issue, but I remember playing with that on the past.
Never mind, someone has done so!
Thank you Daniel Neis Araujo.
This thread can be closed/deleted, once again I can't see how to do it myself >.<
I created a tracker for this, so please vote if you wish to have this or just want to help me
Hi, Richard
you may take a look at MDL-40779. I linked this to your issue.
I would recommend not mention that you "desperately" need this. A business or institution must understand https://docs.moodle.org/dev/Process and it's calendar. Your issue has more chances to be accepted if you can provide a code solution or initial work on code that will be reviewed by HQ. A business or person can always contact a Moodle Partner on his/her territory to get support/consulting/development services to help with any Moodle issues. There is also the Moodle User Association that serves as a channel to get things done on Moodle.
Best regards,
Daniel
Thanks Daniel!
I removed the word 'desperately' from the tracker. We do understand how things work, yet sometimes there's a very long wait for even code fixes. We will probably get this build by a third party.
The tracker is posted to keep track on wanted functionality within Moodle. If the MUA picks it up, then we are happy, but we not always have the luxury of waiting for the fix.
I voted for MDL-40779 and will be watching it from now on.
I recently wrote an app to update grades using Moodle's REST protocol. Here are the steps I took to get the token:
a) Go to: Site administration > Users > Permissions > Define roles
b) Click the "Add a new role" button
c) Click the "Continue" button to define a new role
d) Name the custom role "App"
e) In the context part, choose System to assign this role from everywhere in the system
f) Search in the "Filter" search box for the following and check "Allow"
- Edit grades
- Use REST protocol
g) Go to: Site administration > Plugins > Web services > External services
h) Click "Add"
i) On the "External service" page, fill in the details as follows
- Name: GradeQR Web Service
- Short Name: GradeQR
- Click "Add service"
j) Click "Add functions"
k) Search for and add "core_grades_update_grades"
l) Click "Add functions"
m) Create a user named "GradeQR App"
n) Go to Site administrator > Users > Permissions > Assign system roles
o) Click on "App"
p) Add the "GradeQR App" user to the "Existing users" list
q) Go to Site administrator > Web services > Manage protocals and enable the REST protocol
r) Go to Site administrator > Web services > Manage tokens and click "Add"
- User: GradeQR App
- Service: GradeQR Web Service
- Click "Save changes
The token allows me to enter/edit a grade as long as I have the guest enrollment method enabled. However, if I disable the guest enrollment method, then I get the following error:
{"exception":"moodle_exception","errorcode":"errorcoursecontextnotvalid","message":"You cannot execute functions in the course context (course id:5). The context error message was: Course or activity not accessible."}
Seems like I must not have enabled something that is automatically enabled when the guest enrollment method is turned on, but I am having a hard time figuring out what it is. Any ideas?
I am trying to pull user details using core_user_get_users, using email and id it's working OK, but how to use it if I have a additional field "Person No | personno"?
Getting user details by email address: OK
https://imoodle.sm.com/webservice/rest/server.php?wstoken=WSTOKEN&wsfunction=core_user_get_users&moodlewsrestformat=xml&criteria[0][key]=email&criteria[0][value]=paulmcarney@yahoo.com=paulmcarney@yahoo.com
Getting user details by id: OK
QUESTION:
But how to get user details using below optional field/User profile fields| Additional Information? => Person Number/personno with value of 210792
<SINGLE>
<KEY name="type">
<VALUE>text</VALUE>
</KEY>
<KEY name="value">
<VALUE>210792</VALUE>
</KEY>
<KEY name="name">
<VALUE>Person Number</VALUE>
</KEY>
<KEY name="shortname">
<VALUE>personno</VALUE>
</KEY>
</SINGLE>
Thanks!
I am trying to pull user details using core_user_get_users, using email and id it's working OK, but how to use it if I have a additional field "Person No | personno"?
Getting user details by email address: OK
https://imoodle.sm.com/webservice/rest/server.php?wstoken=WSTOKEN&wsfunction=core_user_get_users&moodlewsrestformat=xml&criteria[0][key]=email&criteria[0][value]=paulmcarney@yahoo.com=paulmcarney@yahoo.com
Getting user details by id: OK
QUESTION:
But how to get user details using below optional field/User profile fields| Additional Information? => Person Number/personno with value of 210792
<SINGLE>
<KEY name="type">
<VALUE>text</VALUE>
</KEY>
<KEY name="value">
<VALUE>210792</VALUE>
</KEY>
<KEY name="name">
<VALUE>Person Number</VALUE>
</KEY>
<KEY name="shortname">
<VALUE>personno</VALUE>
</KEY>
</SINGLE>
Thanks!
Hi Chuck Yocum,
Now I am also facing this problem. If you could have solved this problem, please shared me.
With many thanks,
Aung Pyae Sone