General developer forum

Webhook to Update User

 
Picture of Suketu Patel
Webhook to Update User
 
Hi guys, I am a developer for a company which builds Integrations between software/applications.

I am working on a [project where I need to create or trigger a webhook that updates users and course information from Moodle database to Third party database every time a user/course is created/updated.

I have never worked with moodle before and got short time to learn about this stuff. Does anyone here, know how can I implement or from where can I start or something.

Any help would be appreciated.

Thank you

 
Average of ratings: -
Davo
Re: Webhook to Update User
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Sounds like you need a local plugin ( https://docs.moodle.org/dev/Local_plugins ) that has observers for various events ( https://docs.moodle.org/dev/Event_2 ) and then uses the PHP curl functions to send information out.

The sort of events you are needing to handle are \core\event\user_created,  \core\event\user_updated, \core\event\user_deleted, and similar for 'course' and 'user_enrolment'.

 
Average of ratings: Useful (2)
Picture of Suketu Patel
Re: Webhook to Update User
 

Thank you for your response.

I was trying to follow your steps, but I am kinda lost. As I said I have no experience with Moodle, can you please elaborate on how can I install local plugin? I tried to browse for local plugin on moodle, and it shows some plugins but none seems to be useful in this case. Also I am not sure how can you observe events using those events you listed.

If you could at least help me figuring out plugins installation, it would be great help.

Thank you.

 
Average of ratings: -
Davo
Re: Webhook to Update User
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

You will probably need to write your own plugin, that's what I assumed, based on you posting the question in the developer forum.

 
Average of ratings: -