Quantcast
Channel: Web services
Viewing all 2366 articles
Browse latest View live

Re: Webservice POST error: Invalid token - token not found


Proxy servers

$
0
0
by Nova jones.  

Hey guys,

I have been recently learning about ip addresses and i came across a term called as proxy server. Can someone please help me with what actually is proxy server and how to i use it?

Unable to Update Course by Api Function core_course_update_courses

$
0
0
by Gaurav K.  

Hello

I have LMS Moodle In that, I am using Moodle API by php curl
For that,
1) I have Created a User role and assign permission to that role.
2) Create user and assign that user to a created role
3) also create External Service by that user.
4) after that generate a token to access API
I am able to create a course by that generated token
but unable to update course and getting an error "core_course_update_courses: accessexception Access control exception"
I am using core_course_update_courses

I am Using curl class
https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/curl.php

Api endpoint url
$serverurl ="https://elearning.tsfx.com.au/webservice/rest/server.php?wstoken=api_token&wsfunction=core_course_update_courses";

require_once( 'curl.php' );
$course = new stdClass();
$course->id = $course_id;
$course->fullname = 'testcourseupdate' . $n;
$course->shortname = 'testcourseupdate' . $n;
$course->categoryid = 3;

$courses = array( $course );
$params = array( 'courses' => $courses );
$curl = new curl;

$response = $curl->post( $serverurl, $params );

Getting error Response from core_course_update_courses: accessexception Access control exception


please provide me with some suggestions.

Integration with Oracle based HRMIS

$
0
0
by Yasser Farid.  

Hello, In our organization we are using Moodle 3.6 based E-Training portal for our employees, as we are using Oracle based HRMIS system for all Employees HR processes , now we have a challenge as the management required to integrate both systems in the way that all employee training accomplished and activities auto reflected in his HRMS profile, as well as announcing concerned staff when new employee joined to start essential training courses.

So is there is any API or Webservices solution to fulfill this integration, thanks and best regards,


Re: Proxy servers

Re: Webservice and core function parameters

moodle webservice(mod_quiz_save_attempt) is no longer working

$
0
0
by retigence tech.  

I am working on a project where i am using moodle quiz feature. and I am using below mentioned webservice all are working but except (mod_quiz_save_attempt)

mod_quiz_start_attempt // working and getting response correctly

mod_quiz_save_attempt // not working from yesterday , but getting response without any error

. . . etc

Reponse of 'mod_quiz_save_attempt' webservice:

{
"status": true,
"warnings": []
}

But answers are not saving into the database

Any help please.


Re: moodle webservice(mod_quiz_save_attempt) is no longer working


How to Develop Custom Web Services in Moodle

$
0
0
by Amit Ringola.  

How to develop custom web services in moodle. 

Re: moodle webservice(mod_quiz_save_attempt) is no longer working

$
0
0
by kumar ret.  

Thanks  for the reply


I checked the same.  But getting same problem ...


my code is ///


require_once('./curl.php');
$token = 'mytoken';        
$functionname = 'mod_quiz_save_attempt';   
$domainname = 'http://localhost/moodle';
$restformat = 'json'; 
$params=array('attemptid'=>1 , 'data' => array (array('name' => 'slot','value' => 1 ),array('name' =>'q1:1_:sequencecheck','value' => 1),array('name' =>'q1:1_answer','value' => 2)), 'preflightdata' => array (array('name' => "",'value' => "")));
$functionname = 'mod_quiz_save_attempt'; 
$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;
$curl = new curl;  
$restformat = ($restformat == 'json')?'&moodlewsrestformat=' .$restformat:'';
$resp = $curl->post($serverurl . $restformat, $params);
print_r($resp);

Please check ... Thanks in advance

Curl.php in moodle custom web service plugin

$
0
0
by Amit Ringola.  

What is the use of curl.php . in custom moodle web service plugin


Custom web service issue

$
0
0
by Amit Ringola.  

I developed a custom web service, when i am adding function to the service created function is not in the drop down.

enrol_manual_enrol_users without enrolling the web service user

$
0
0
by Max Longus.  

Hello,

Is it possible to enrol users in a course by REST web service without previously manually enrolling the web service user in that course ?
I have to create a lot of courses in Moodle and i must enrol teachers and students in these courses.
I would like to do this by the web service API.
I can easily create courses with REST.
But i cannot enrol teachers in that course with enrol_manual_enrol_users, i have an exception :
<EXCEPTION class="require_login_exception">
<ERRORCODE>requireloginerror</ERRORCODE>
<MESSAGE>Cours ou activité pas accessible.</MESSAGE>           "Course or activity not accessible"
</EXCEPTION>

 The only way i found to enrol a teacher with enrol_manual_enrol_users is to manually enrol the web service user in the course. Is there a solution to get around that problem  in order to have a complete automatic process ?

Thanks.

Create a user via web service

$
0
0
by Amit Ringola.  

How can i create a user via web srvice. 

error message that came out of the blue

$
0
0
by David Olson.  

Plugin dependencies check

Moodle Mobile tools
/admin/tool/mobile
20171113002017111300
  • Moodle 2017110800
  • webservice_rest (2017110800) Fails Unavailable


I just opened our version of moodle and received this message error and am totally lost on how to fix it. This is totally new to me.

Re: error message that came out of the blue

$
0
0
by Ken Task.  

Appears you have/running version 3.4.x of Moodle.

Please go to http(s)://yourserver/admin/settings.php?section=mobilesettings and see how that's set.

cat ./moodle34/admin/tool/mobile/version.php

shows:

defined('MOODLE_INTERNAL') || die();
$plugin->version   = 2017111300; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires  = 2017110800; // Requires this Moodle version.
$plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array(
    'webservice_rest' => 2017110800

So it's related to mobile. smile

'spirit of sharing', Ken


Using the web services api to change a Quiz time

$
0
0
by Randall Reed.  

Hi All,

I'm using the web services api and I want to update a timeopen date programmatically. I don't see which api will allow me to do that? Any suggestions?

Thanks so much.

Randy

Re: error message that came out of the blue

$
0
0
by David Olson.  

cat ./moodle34/admin/tool/mobile/version.php

shows:

defined('MOODLE_INTERNAL') || die();
$plugin->version   = 2017111300; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires  = 2017110800; // Requires this Moodle version.
$plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array(
    'webservice_rest' => 2017110800

_____________________________________________________________________________

I can see as you have shown the error and the need for a change in the mobile/version.php but I have tried to figure out how this change came about and why. I am not a programmer but an administrator for several moodle sites and want to prevent this from happening in the future as well as get this code fixed. Any suggestions?

David



Re: error message that came out of the blue

$
0
0
by Ken Task.  

And when you went to

http(s)://yourserver/admin/settings.php?section=mobilesettings

as suggested earlier you saw what?

Think Moodle 3.4.x had a bug in it related.  Have a 3.4.highest for testing purposes and have no such issue.  But accessing the area above does produce some 'red' warnings about certificate not being valid ... uhhhh, not true.

If desiring to keep the 3.4.x you have, download locally the 3.4.x code, unzip locally, and compare what's in the unzipped archive with what's in one of your instances of Moodle on server.

On my server, error in a 3.5.x or 3.6.x. not present.

Fix?  Time to upgrade? smile

As far as why/how that happened ... sorry, no Vulcan Mind Meld possible on this end! :|

'spirit of sharing', Ken


Re: moodle webservice(mod_quiz_save_attempt) is no longer working

$
0
0
by kumar ret.  

Hi Matteo, Please check the code , where I am doing wrong and If I hit same web service with same code in locally(moodle project deployed locally) it is working ... but  it is not working in production(moodle project deployed)  and before some fews days back it was working fine, please reply asap


Viewing all 2366 articles
Browse latest View live


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