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

N: in 'other' column of mdl_logstore_standard_log

$
0
0
by Ken Task.  

Version 2.7.20 (yes, I know sad very old not supported etc. etc.)

mysql 5.5.42, PHP 5.5.38  with Zend OpCache.

While investigating how to reduce the size of mdl_logstore_standard_log thus making the interface in Moodle Admin UI a little more user friendly for non-technical Moodle Admins .... (and dumping the more technical ws records to a table outside of the DB for Moodle so nothing is really lost), ran across this:

The query:

SELECT ip,other,origin FROM mdl_logstore_standard_log WHERE timecreated > UNIX_TIMESTAMP(NOW() - INTERVAL 1 DAY) and origin like 'ws';

Clip of results IP address of remote server obscured of course ... but it's the same IP address.


| IPaddressofRemoteServer | a:1:{s:14:"forgottenreset";b:0;}                                | ws     |
| IPaddressofRemoteServer | N;                                                              | ws     |
| IPaddressofRemoteServer | a:1:{s:8:"function";s:28:"core_user_get_users_by_field";}       | ws     |
| IPaddressofRemoteServer | a:1:{s:8:"function";s:28:"core_user_get_users_by_field";}       | ws     |
| IPaddressofRemoteServer | a:1:{s:8:"function";s:22:"core_user_update_users";}             | ws     |
| IPaddressofRemoteServer | N;                                                              | ws     |
| IPaddressofRemoteServer | a:1:{s:8:"function";s:28:"core_user_get_users_by_field";}       | ws     |
| IPaddressofRemoteServer | a:1:{s:8:"function";s:22:"core_user_update_users";}             | ws     |
| IPaddressofRemoteServer | N;                                                              | ws     |
| IPaddressofRemoteServer | a:1:{s:8:"function";s:28:"core_user_get_users_by_field";}       | ws     |
| IPaddressofRemoteServer | a:1:{s:8:"function";s:28:"core_user_get_users_by_field";}       | ws     |
| IPaddressofRemoteServer | a:1:{s:8:"function";s:22:"core_user_update_users";}             | ws     |
| IPaddressofRemoteServer | N;                                                              | ws     |

Now the $64,000 question ... what the heck does N; mean?   Searched the net ... no luck.

Thanks, in advance, for any hints/clues/links to resource, etc.

Ken


Web Services Roadmap

$
0
0
by Mohamad El Bohsaly.  

Dear concerned,

What is the best way to excel in Moodle Web Services creation/development? We have a basic knowledge in PHP and MySQL. In addition, we have been trying to retrieve grades from a course but the excel sheet is giving the courseID (attached below). 

In other words, we aren't knowing how to process the data fields in a PHP file before calling the web server along with the token, function name,...

Thanks in advance.

Re: Rest API for authentication

$
0
0
by Josef Grunig.  

Hi,

did you find a way to perform what you were asking? I have a similar requirement.

Bests,

Josef Grunig

Re: N: in 'other' column of mdl_logstore_standard_log

$
0
0
by Paul Holden.  

It means NULL -

$ php -r "echo serialize(NULL);"
N;

Re: N: in 'other' column of mdl_logstore_standard_log

$
0
0
by Ken Task.  

Thanks, Paul!  Well, DUH! should have been able to figure that out! (red-in-face).

Now all I need to do is to get the programmer of the webservices script they run to explain why a NULL is sent!!!  Sigh!

'spirit of sharing', Ken



Site In Maintenance Mode - Webservice function to check?

$
0
0
by Ken Task.  

Have looked through API functions
https://docs.moodle.org/dev/Web_service_API_functions
and I don't see a function that checks if the moodle is in the Maintenance mode or not.

"Client" has automation setup for user checks and it appears they have whatever they are using to trigger a run 24 hrs a day 7 days a week and at all times of the day. 

IF the server has acquired a kernel update and needs to be rebooted or Moodle Admin is upgrading Moodle or updating plugins ...  it would seem to me that a check like ... server up and is moodle in maintenance mode would be  a desirable function.

Anyone have an idea as to how to implement those checks?

Thanks, in advance, Ken



New web service - delete user data

$
0
0
by Dorel Manolescu.  

Hi

I created a new web-service local plugin which mimic the to some extend the delete user data behaviour for GDPR purposes.

The plugin is under:

https://moodle.org/plugins/local_gdpr_deleteuserdata

Any advice in terms of:

* extra permissions that needs to be added there (I only added user:delete);

* possible features (maybe bulk support, notifications)

* anything else

are welcome.

As it is in alpha stage please don t use it in live environments as it really deletes all user data. No notifications are send to involved users.

The plugin is build in order to facilitate external systems to trigger a GDPR user data deletion for a user in moodle.

Postman sample web-service call attached here.

Let me know what you think.

Regards

Web services token expiration

$
0
0
by Petar Nikolovski.  

I've looked into documentation for web services, but it seems that I may have missed information about how long tokens live? Does anyone know how long tokens need time to expire? Also, do I need to generate a new token when I request different function?


Re: New web service - delete user data

Pages view and other events

$
0
0
by Petar Nikolovski.  

Is there an web services API endpoint which can be queried to retrieve list of page view events by some user? For example click events, page views, time how much user spent on a page/video, timestamps of events and similar metadata? If there is no such API endpoint, is that data possibly stored in database?

Webservice for adding cohort to course?

$
0
0
by Richard van Iwaarden.  

Is there no webservice for adding a cohort to a course?

Or am I overlooking this?


If not... does everyone use manual enrolment for students/teachers in a course when using webservices?


We are filling our Moodle from our SIS (student information system). Based upon the SIS we make user cohorts and course in Moodle. However, it looks like there's no way to link the two using webservices.

Re: core_user_create_users and core_user_update_users are missing some core fields

$
0
0
by Nicholas Stefanski.  

Wonderful! I never got around to taking a stab at this myself, but this works retroactively at least back to Moodle 3.4.3 as well. It also happens to fix some weird errors I was getting even with the previously supported "city" and custom fields. Thanks Richard!

Re: core_user_create_users and core_user_update_users are missing some core fields

$
0
0
by Richard van Iwaarden.  

Hi Nicholas,

You are welcome... but can you help me? Which files do I have to replace in Moodle 3.5 to get this working?

I'm not profiting of these changes myself yet...

Re: core_user_create_users and core_user_update_users are missing some core fields

$
0
0
by Nicholas Stefanski.  

In 3.4.3, the only file I replaced was user/externallib.php

I guess I should note that I didn't test all the new fields, just `phone1` and I think `institution`. But like I said, before this change some fields like `city`, which were supposedly already supported, were not working at all for me. Putting in your modified user/externallib.php made `city` work too. It also eliminated some unspecified errors using space characters in custom field values.

Re: Webservice for adding cohort to course?

$
0
0
by Richard van Iwaarden.  

This is seriously not possible?

I'm amazed by this. How do big universities or other big Moodle installations add users to courses with webservices... all MANUAL enrollments?


I can't believe that.


Re: Webservice for adding cohort to course?

$
0
0
by Richard van Iwaarden.  

Created a tracker for this: MDL-62976

Please vote if you think this is a good idea to have.

Web Services for Content Creation

$
0
0
by Shaun T.  

Hi, 

I'm looking for web services that would allow the creation of Moodle activities and resources such as assignments, books, pages, quizzes, forums, etc. I've been looking at MDL-40779 and see this was started, but hasn't been updated recently. Does anyone have any other web services they are using to add activities and resources to a course? 

Thanks,

Shaun

Best way to delete user from the system

$
0
0
by Mantas Šedys.  

Hello,

what is the best way to sort active/inactive users in the system? 

I would like to use webservice, because I will checking with SAP system.

Get assignment intro attached file?

$
0
0
by Paul Sensus.  

Hi,


I am developing a web application that can list and download all files related to a course. I am using the RESTful Web Service API and I am able to retrieve all course files, but I am unable to find the url or navigate inside the assignments of a course to retrieve any files that might be attached there. 

Can anyone help me with a guide or explain what I need to do to retrieve assignment attached files? (The files uploaded by teachers only, that serve as assignment descriptions) Thank you!


Moodle version: 3.4

API user role permissions/capabilities allowed:


CapabilityPermission Risks
Course
View courses without participation
moodle/course:view
Allow
Default: Not set
Web service: REST protocol
Use REST protocol
webservice/rest:use
Allow
Default: Not set
Activity: Assignment
View assignment
mod/assign:view
Allow
Default: Not set
Activity: Assignment 2.2 (Disabled)
View assignment
mod/assignment:view
Allow
Default: Not set

Fetch assignment details for a course, including due dates.

$
0
0
by Zadok Lindt.  

Is there an api that allows you to fetch all assignments in a course, that includes the due date information?

I can see one api that allows you to fetch assignments, but it returns just assignments for the current user. (The results appear filtered). I just want to fi d all of the assignments and when they are due.


Thanks!

Viewing all 2361 articles
Browse latest View live