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

Adding users vial REST API

$
0
0
by Aaron Harker.  

I've got an old Moodle 3.8 site we are currently in the process of building a more up to date replacement for.  In the interim I'm trying to automate so of the functions for this old site to give the admins more time to work on the new one.  One of the things I want to do is automate the creation of new users in the Moodle system from our Laravel based SIS.

I've got the webservice setup and can connect to the REST endpoints fine but I seem to be having trouble getting the data in the correct format for Moodle.  I'm using the 'core_user_create_users' endpoint.  I'm formatting my data like this.

['users'=>[
    [
        'username'=> 'test.test',
        'passowrd' => '*****',
        'firstname' => 'test',
        'lastname' => 'test',
        'email'=>'test@test.com',
        'city' => 'Some City',
        'country' => 'Some Country',
        'timezone' => 'some/timezone'
    ]]
]

Can anyone see where I'm going wrong because it is driving me mad.  The error is an 'invalid_parameter_exception' = 'Invalid parameter value detected'


Viewing all articles
Browse latest Browse all 2361

Trending Articles



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