Push. Someone could at least confirm for me that there is just core_course_get_courses to get a list of available courses.
Re: "View courses without participation" Permission needed to get a course list?
Re: "View courses without participation" Permission needed to get a course list?
Users can view the list of courses they can enrol in usually even as guests by going to YOURMOODLE.com/course/index.php View courses without participation is for being able to actually get inside the course without being enrolled in it.
Re: "View courses without participation" Permission needed to get a course list?
Mh, didn't thought of that option, but for that I would have to parse HTML. If I wanted to do that, I wouldn't use the REST Webservice. :P
Re: enrol_manual_enrol_users limit
I believe that the following may be related.
https://moodle.org/mod/forum/discuss.php?d=260108
MDL-45573
For some reason when enrolling students it may be trying to update a quiz and since the quiz is locked the enrol api is failing
Re: Moodle API to get Course Completion Data
Yes, I believe my need goes along the same lines. I need an API that will allow me to retrieve student data, midterm, and final grades in order to send them to our SIS.
Any guidance regarding this need will be greatly welcome. Thank you very much!
Not Acceptable! An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.
How can i fix this error ? :
------------------------------------------------------------------------------------------------------
Not Acceptable!
An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.
-------------------------------------------------------------------------------------------------------
It just occurred, whenever i click the profile picture or even clicking the name of a user, editing my profile ... please help me fix this ...
Re: Not Acceptable! An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.
Re: Moodle API to get Course Completion Data
Wanted to update here: I have written two PHP functions to retrieve Course Completion data from Moodle. I'm surprised that Moodle's core API did not offer this functionality. I will submitting to Moodle soon in order to be included in the codebase for the next release.
Re: Moodle API to get Course Completion Data
Ryan, would you be willing to share those PHP functions for us to use them? It might take a while until they are integrated in Moodle core. In what version of Moodle did you test them or are using them?
Please let me know, thank you very much!
May need plugin for Web Services
I need a system that will tell an outside entity that a student passed the course. The information needs to include a lot of personal information of the student, including the student's name and the timestamp mmddyyyy of when they finished the test. Is there anything currently available? Is the system already set up for this?
add course element
how can I add courses elements (links and media files) to course automatically using web services from external application? In documentation I've only found course_delete_modules to delete elements. Is is possible to add module?
Inserção via WebService
Estou utilizando um servidor iis (Windows server 2012) e quando executo a função via webservice-xmlrpc passando todos os parâmetros pra criar a categoria com acentuação ele salva no banco da seguinte maneira
- tÃ(c)ste (Téste)
Codigo:
<?php
/// SETUP - NEED TO BE CHANGED
$token = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
$domainname = 'localhost';
$functionname = 'core_course_create_categories';
//////// moodle_user_create_users ////////
/// PARAMETERS - NEED TO BE CHANGED IF YOU CALL A DIFFERENT FUNCTION
$categories1 = new stdClass();
$categories1->name = 'Téste';
$categories1->description = 'Curso de Téste';
$categories1->descriptionformat = 1; //Sempre 1
$params = array($categories1);
/// XML-RPC CALL
header('Content-Type: text/plain');
$serverurl = $domainname . '/webservice/xmlrpc/server.php'. '?wstoken=' . $token;
require_once('./moodle/curl.php');
$curl = new curl;
$post = xmlrpc_encode_request($functionname, array($params));
$resp = xmlrpc_decode($curl->post($serverurl, $post));
print_r($resp);
?>
RosarioSIS has webservices-based integration to Moodle
This and other info at https://moodle.org/mod/forum/discuss.php?d=279913
It can be a good starting point if someone is looking for sample code and installation/configuration documentation. I haven't audited it, and it is not bullet-proof, but it may be the inspiration somebody needs...
Re: Get user token
I also had the problem that I could not use token.php to get a user token.. It appeared to be that I had a password for the user containing non-alphanumerical characters. This caused a UTF-8 problem.
In the settings I changed the requirement that a password must contain 1 non-alphanumeric character, so I could give the webservice user a alphabetic password. token.php worked OKE after that.
Creating users through core_user_create_user
Hello all,
I'm newbie to Moodle and it's web services usage. I need to call the core_user_create_user function from C# in order to replicate the creation of users in some other solution. This achievement will be done by calling the web service on the fly when the user is actually created in the fist solution.
I've done all the set up needed for this purpose (Gone throrgh the following tutorial: https://docs.moodle.org/28/en/Using_web_services) and used some example I found on the web to test if it work without success. I keep receiving the following message:
{"exception":"webservice_access_exception","errorcode":"accessexception","message":"Excepci\u00f3n al control de acceso"}
If I try to call some other function I end up receiving the same response.
Attached you will find the code which I'm using.
Any comments or suggestions will be really appreciated!
Thanks a lot in advance!
2.7.1 Cost to create an API
Folks, I need to hire someone to create an API on a system that has a lot of the code already created and a place to test it out. I have no idea what to suggest as a fair price for such a task. If you have knowledge of the running rate for that task, would you please tell me?
Re: REST Service Create User C# Example [Moodle 2.3.1]
Hello everyone,
I'm using the posted code in order to run some tests to get the Moodle Web Services work. I've gone through this tutorial (https://docs.moodle.org/28/en/Using_web_services ) in order to get everything working but when I call the web services from my test app I get the following exception message:
{
"exception":"webservice_access_exception",
"errorcode":"accessexception",
"message":"Excepci\u00f3n al control de acceso",
"debuginfo":"Access to the function core_user_create_users() is not allowed. There could be multiple reasons for this:
1. The service linked to the user token does not contain the function.
2. The service is user-restricted and the user is not listed.
3. The service is IP-restricted and the user IP is not listed.
4. The service is time-restricted and the time has expired.
5. The token is time-restricted and the time has expired.
6. The service requires a specific capability which the user does not have.
7. The function is called with username\/password (no user token is sent) and none of the services has the function to allow the user. These settings can be found in Administration > Site administration\n > Plugins > Web services > External services and Manage tokens."
}
I've checked every suggestion showed in the message but still not getting it to work.
Can anybody help me? It would be really appreciated!
Thanks a lot in advance!
Regards,
Re: How to get a list of courses for the teacher?
hello Jury, I reviewed your old post and not if you've already solved, I developed a new function for web services which returns the list of courses in which a user has the role of editingteacher, this list is returned as a string serialized (json) with the id and the shortname of the course. although it can be modified to return more values.
The service is based on the example and documentation Moodle: https://docs.moodle.org/dev/Adding_a_web_service_to_a_plugin and https://github.com/moodlehq/moodle-local_wstemplate
Deputy .zip service
Sorry for my English
Create assignment or Create Grade via Web Service
Hey All,
I'm attempting to send student grades from an external application into Moodle (2.8+) but I haven't figured out how to do this as of yet. It seems like the web services that exist to send grades require an assignment and there is no way to create an assignment in the web services. Is this correct?
I guess the work around would be to create a plugin to create the assignment?
Any thoughts on how to handle this with the native web services? I guess there is no direct access into the grade book that doesn't require an assignment?
Thanks,
Jared
So no one will go down a road that leads no where ...
Short version ...
Setup a CentOS 6 test server without DNS just for testing for a rather large corp using Moodle remotely hosted (outside the confines of corp network - apparently the person training cannot get internal technical support). Purpose to test webservices. Yes, without DNS ... access via host file 'trick'. Test server had self-signed certificate and running https:// ... Moodle configured to use https:// ... all that worked just fine. Person doing the webservices part was successful in testing.
The 'next phase' in the 'plan' (not mine) was to use a valid CA and test with that. So embarked on setting up a valid CA (company doesn't matter). Result ... regardless of what I did/tried, couldn't get this stealthy Apache to use certificate acquired. Finally, an expert says ... 'No. Can't be done. Server *must* have a valid DNS".
Lesson learned ... the hard way - have spent 10 hours learning that lesson. :|
On another note, couple of related question ... if anyone knows:
Certificates are not issued for life (as we all know) and from time to time, they require renewal. So let's say that happens to a Moodle server - expired and new certificates have not been acquired yet.
How does the remote server/whatever running some app/script to do some action on the Moodle server affect re-acquire the new certs? Or does that matter (networking comes before application).
If that doesn't matter ... what does? The token assigned to the user using webservices?
Yep, if I sound confused it's cause I am!!!
Ken