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

Strange behavior mod_scorm_insert_scorm_tracks

$
0
0

by Mark Achten.  

He.

I'm using mod_scorm_insert_scorm_tracks to write data to the database as a web service. Adding 27 items in the tracks array works fine, adding the 28th returns a 404. No idea why...

Investigating the source code of the function in git doesn't give a clue to why this fails.

I've added the requests (taken from Fiddler) and attached them here. Any help is greatly appreciated as this drives my crazy.


Re: Strange behavior mod_scorm_insert_scorm_tracks

$
0
0

by Mark Achten.  

Mmm, I think I might be running into url max length limitations....

Re: Strange behavior mod_scorm_insert_scorm_tracks

$
0
0

by Mark Achten.  

Got it. Don't know why but all of a sudden I got the POST working.

enrol_manual_enrol_users returns null on fails

$
0
0

by davide wisdom.  

Hello everybody,

I'm writing a php client for my moodle web services using SOAP.

Right now i am able to succesfully call 'core_user_get_users' and get a correct response,

but i'm stuck trying to make 'enrol_manual_enrol_users' work.

this is the call:

$client = new \SoapClient($serverUrl);
$response = $client->__soapCall('enrol_manual_enrol_users', $params);

where $param is something like:

Array ( [enrolments] => Array ( [0] => Array ( [roleid] => 5 [userid] => 9 [courseid] => 7 ) ) )

also tried this:

Array (Array ( [0] => Array ( [roleid] => 5 [userid] => 9 [courseid] => 7 ) ) )

and few more.

$serverUrl (correct because the other method does succeed):

http://domain/webservice/soap/server.php?wsdl=1&wstoken=token


After the call, $response is just empty and nothing happens on the moodle (the user doesn't get enrolled into the course).

The weird fact is that if i pass in wrong parameters (like: wrap it into another array, mispell something etc.. etc..), moodle doesn't complain. It does complain (as it has to) only when i mispell the name of the function.

I was kinda frustrated so i gave my moodle web services user like almost full permissions: nothing changed.

Any idea?




Dynamic Tokens for API

Re: Web service API for fetching course price , start date, end date.

$
0
0

by syed shaffeque.  

Use this API instead core_course_get_courses, where you can fetch all course information. the logic is like

core_course_get_courses.  (API function name defines its path)

1. Core :
moodle or your root folder

2. Course : course folder

3. get_courses : search for function get_courses() within the "course/externallib.php"

4. if desired fields are not fetched, the alter query (include course price , start date, end date )

5. pass the parameters in  get_courses_returns()

Re: Dynamic Tokens for API

$
0
0

by syed shaffeque.  


Got Solution

To make dynamic API,  delete the existing record in 'external_token'.  Then on your each request there will be dynamic tokens inserted.

Delete the record in 'external_token' matching userid and externalserviceid.

How to read completion criteria API to get course data.

$
0
0

by Aniket Sankpal.  

I am using core_course_get_contents I want to know the activity restriction criteria.

I am getting something like this in availability

{\"op\":\"&\",\"showc\":[true],\"c\":[{\"type\":\"completion\",\"cm\":10889,\"e\":1}]}

{\"op\":\"&\",\"showc\":[true],\"c\":[{\"type\":\"completion\",\"cm\":9989,\"e\":1}]}


{\"op\":\"&\",\"c\":[{\"type\":\"grade\",\"id\":3410,\"min\":100}


How to read this? What does this mean?

Is this always different parameters in others?

What is the common structure of availability parameter?


User activity access

$
0
0

by Aniket Sankpal.  

How to know whether the user has access to the specific course activity or not using API function.


I am using moodle version 3.2.


I am searching API function whereby passing user id and cmid it should return user can access the activity, Or not if no then, user has to complete the previous activity to access current activity, with all its completion criteria.

Myddleware plugin

$
0
0

by Greg Rudl.  

Anyone have any experience with the Myddleware plugin? Not sure how to use the plugin as there's no documentation. I assume Myddleware makes integration easier to setup and maintain.

Re: Myddleware plugin

$
0
0

by Stéphane Faure.  

Hi Greg,

You can find our tutorials and documentation on this website : http://community.myddleware.com/

Here is a direct link to a tutorial, the example is a connection between Prestashop and SuiteCRM but you can follow the same type of step to learn how to use Myddleware with Moodle : http://community.myddleware.com/index.php/tutorial/

Here is the link for helping you to create the Moodle's connector : http://community.myddleware.com/index.php/connector-guide/#moodle

The Moodle plugin has been created just to add custom webservice but you can use Myddleware without this plugin if you don't need to read user's completion and last access to a course.

You can download Myddleware here : http://www.myddleware.com/solution/download

Contact us if you have any other question.

Best regards,

Myddleware team

Re: Myddleware plugin

$
0
0

by Greg Rudl.  

Great--just what I needed. What is the advantage/purpose of the Moodle

Mylldeware plugin?



On Wed, Apr 19, 2017 at 8:26 AM, Stéphane Faure (via Moodle.org) <

Re: Myddleware plugin

$
0
0

by Stéphane Faure.  

Hi Greg,

Myddleware allows you to transfer your data between applications like Moodle.

Could you tell us what you need and we will be abble to help you ? Thanks.

Stéphane

Re: Myddleware plugin

$
0
0

by Greg Rudl.  

So what do I use to do that--the MW Moodle plugin, MW.com or the

combination?



On Wed, Apr 19, 2017 at 3:30 PM, Stéphane Faure (via Moodle.org) <

Re: Myddleware plugin

$
0
0

by Stéphane Faure.  

Hi Greg,

If you want just to create data in Moodle like create users, courses... (more details here : http://www.myddleware.com/solution/connected-applications?view=project&id=14:moodle), you can only use Myddleware. No need to install the plugin.

But if you want also to read the user's completion or their last access to a course because you want to send these informationin another application, in this case, you have to install the plugin in your Moodle to install these 2 custom webservice. 

I hope it is clear otherwise don't hesitate to come back to me.

Stéphane




API not available to check user activity access

$
0
0

by Aniket Sankpal.  


In Moodle 3.2 there is no Web service API function available which can check whether the user has access to the course activity or not.


I am looking for an API function which can return the user can have access to the activity or not By passing user id and cmid.


For eg, if user has not completed with previous activity then he should not get access to the current activity based on the activity restriction criteria.

Create web Service Token with SAML

Re: core_course_get_courses just course id and shortname

$
0
0

by Edwin Torn Broers.  

Hi Jack,

you use the options parameter to make selections on id(s).

 .....&wsfunction=core_course_get_courses&options[ids][0]=<course id>

Kind regards, Edwin

Re: core_course_get_courses just course id and shortname

$
0
0

by Charan Sri.  

Hello Edwin,

Thanks for your post.

When I tried to pass parameters like this "options[ids][0]=<course id>", I am getting an error from API.

Error:  [debuginfo] => Unexpected keys (ids) detected in parameter array.

I want to retrieve all courses based on categoryid. Can you give me some syntax??


Regards

Charan



Re: core_course_get_courses just course id and shortname

$
0
0

by Edwin Torn Broers.  

Hi Charan,

Just tried this one on our 3.1 system (with postman) to get information on courseid 12.

https://<your-server>/webservice/rest/server.php?wstoken=<your-token>&wsfunction=core_course_get_courses&moodlewsrestformat=json&options[ids][0]=12

However this does not answer your question. This API call is probably not what you are looking for because it does not support categoryid as a selection parameter. I took a short peek at other calls and I'm not sure if what you are looking for is available.  

Regards,

Edwin

Viewing all 2361 articles
Browse latest View live


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