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

Web and mobile app development


Re: error/forcepasswordchangenotice on New User Creation via web service

$
0
0
by Neel Bhave.  

Hi,
I have solved this issue. 
The issue was that the user that I was using for the web services had force password reset checked while creation. I had not logged in once the user was created and was only using it for the Webservice. Hence I was this error was showing up. I unchecked force password reset from my admin account and it was solved.

Re: how many methods to improve the perfermance of Moodle?

Re: login and registration form

Re: Unable to manual enrol: enrol_manual_enrol_users

$
0
0
by Elias Cisneros.  

Hi,

Some idea for this situations?, I have same problem


Thanks

Re: enrol_manual_enrol_users without enrolling the web service user

$
0
0
by Elias Cisneros.  

I have same situation, I need enrol a user without previously  enrolling the web service user in the course .


Some idea?


Thanks

Re: Unable to manual enrol: enrol_manual_enrol_users

$
0
0
by Tim Titchmarsh.  

Hi Elias


Its been a while - I think this is what you mean.

It seems an omission in the web services, in the end I  ended up doing the following and passing in the $status to put a user on hold


    private function add_user_courses($moodle_user_id,$courses,$default_role,$status)

    {

        write_log(sprintf("%s moodle_user_id=%s courses=%s",__FUNCTION__,$moodle_user_id,implode(",",$courses)));

        // now enrol the user in the course

        $moodlecourses = array();

        foreach( $courses as $course)

        {

            write_log("add user to course " .  $moodle_user_id . "" .  $course);

            $moodlcourse = new stdClass();

            $moodlcourse->roleid = $default_role;

            $moodlcourse->userid = $moodle_user_id;

            $moodlcourse->courseid = $course;

            $moodlcourse->suspend = $status;

            array_push($moodlecourses,$moodlcourse);

            $params = array("enrolments" => $moodlecourses);

            //write_log(var_dump_ret($params));

            $this->MoodleIt("enrol_manual_enrol_users", $params);

        }


    }


Regards

Tim

Re: Fetch assignment details for a course, including due dates.

$
0
0
by Dorian Malguid.  

I guess it's too late now but I hope it'll still be useful. According to the documentation, if you try to fetch assignment details with a user who isn't enrolled into the course, you should add the following argument : includenotenrolledcourses=1


Re: enrol_manual_enrol_users without enrolling the web service user

$
0
0
by Mayank Tyagi.  

Hey Max,

I think this web service is restricted to logged in users. If you want you can create your own webservice function. You can easily enrol users in to course by creating your own webservice function. I have done this many times.

Myddleware Error Importing to Salesforce

$
0
0
by waqar Ahmed.  

Hi,

     I have created a rule to import all the courses from moodle to salesforce. But when I set the date parameters to 1900-01-01 in order to get all the course and click on "Simulate Transfer", I get the following error.

Reading Issue: Error : Error errorcoursecontextnotvalid : You cannot execute functions in the course context (course id:5). The context error message was: User not fully set-up /home/www/myddleware/src/Myddleware/RegleBundle/Solutions/moodle.php Line : ( 230 )


I am sure, I am missing something but can you suggest what it can be so I can rectify. Since I am in myddleware so I cannot see whether its because of salesforce or moodle?


Any indicators would be helpful, thanks in advance!

Re: Myddleware Error Importing to Salesforce

$
0
0
by Stéphane Faure.  

Hi,

This problem comes from Moodle not Salesforce. 

You problem could come from the private policy authorization for your user. To test it, could you log into Moodle with the Moodle user you use in Myddleware (the one linked to your token in Moodle).

You will maybe have to check the authorization for private policy. If yes, could you check it and try again ? Thanks.

Best regards,

Stéphane

Re: Myddleware Error Importing to Salesforce

$
0
0
by waqar Ahmed.  

Hi,

     I have thoroughly checked all policies on moodle but I don't seam to find anything odd in here.


For reference I am using Moodle version 3.5+

I have checked policy in these places:
/admin/settings.php?section=privacysettings
/admin/settings.php?section=policysettings

What exactly do you recommend to look for, can you directly point?

Re: Myddleware Error Importing to Salesforce

Re: Myddleware Error Importing to Salesforce

$
0
0
by waqar Ahmed.  

Already done that, my user also has the Myddleware role as advised in the tutorial.

But definitely according to the wording of error it seams to be something user related.

Re: Myddleware Error Importing to Salesforce

$
0
0
by Stéphane Faure.  

Hi,

Just for the test, could you give the admin role to your user  ? Thanks.



Re: Addning Course enrolment method through webservices.

$
0
0
by Thomas Schröder.  

Hello,

We experienced the same issue and will just quickly note our guess (and a possible solution):

in externallib.php of moodle-local_ws_enrolcohort in line 329

cohort_get_available_cohorts($context)

is called. This has a hardcoded limit of 25 items as seen in line 239 of

https://github.com/moodle/moodle/blob/master/cohort/lib.php

This limit makes some sense for paged views, but of course is not helpful here, as whenever there are more than 25 cohorts, only the first 25 will be returned.

Changing the call to

cohort_get_available_cohorts($context, 0, 0, 0)

resolves the problem for us.

Best regards,

thoschi


Re: How to retrieve the User Enrolment ID

$
0
0
by Carlos Chiarella.  

Thanks Mayank. Sorry for my late response.

Issue when creating users via web service call

$
0
0
by Carlos Chiarella.  

Hi,

We are having issues when creating users using the function: core_user_create_users

Sometimes the users are not being created. The Apache Error log table has this message:

[Thu May 09 06:25:06.379645 2019] [php7:notice] [pid 29417] [client 162.158.78.234:49134] Potential coding error - active database transaction detected during request shutdown:\n*
line 155 of /user/externallib.php: call to moodle_database->start_delegated_transaction()\n*
line 269 of /webservice/lib.php(1487) : eval()'d code: call to core_user_external::create_users()\n*
line ? of unknownfile: call to webservices_virtual_class_000000->core_user_create_users()\n*
line 201 of /webservice/soap/locallib.php: call to SoapServer->handle()\n* line 148 of /webservice/soap/locallib.php: call to webservice_soap_server->handle()\n*
line 43 of /webservice/soap/server.php: call to webservice_soap_server->run()\n

We are running Moodle version 3.5.3 and PHP version 7.1


Does anybody have any suggestions on how to fix this issue?


Thanks for your help,


Carlos



No result when I call to a WebService with the core_user_get_users_by_field function

$
0
0
by Dámaso Velázquez Álvarez.  

Hello,

I have developed an WebService that use the function core_user_get_users_by_field but this is the result (when must returns results)


This XML file does not appear to have any style information associated with it. The document tree is shown below.
<RESPONSE>
<MULTIPLE> </MULTIPLE>
</RESPONSE>

I searched in the forum and checked that the WebService user has the capacity moodle/user:viewalldetails

Any idea? Could you please help me? 

Best Regards.

(I'm using Moodle 3.5.1+).


Re: Rest API for authentication

$
0
0
by Fehmi M'Barek.  

Hi,

here is a way how to authenticate against you moodle instance:

curl -X POST \
  'https://my.moodleapp.tld/login/token.php?service=moodle_mobile_app' \
  -d 'username=mymoodleuser&password=MySecretPassword'


Response will be:


{
    "token": "f31119c023c2c81ba0244b57982379823",
    "privatetoken": null
}

With this token you can do all your CRUD operation

Hope this helps you.

Best regards

Fehmi

Viewing all 2366 articles
Browse latest View live


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