General developer forum

I have to a write web services.I will get data in a JSON format and using POST method.I have to insert these data insert in Moodle DB.

 
Picture of Baiju Sharma
I have to a write web services.I will get data in a JSON format and using POST method.I have to insert these data insert in Moodle DB.
 

I don't have much knowledge of web services working.

Requirement: My web services is for Moodle quiz for the user. 

Web service will check a total number of attempts available to the user and based on attempts count:

If there is attempt available to the user then submit the quiz data.

Else ignore the app data (As on server there is no attempt available for user, This will happen only when user takes all the attempts online first)

Service will return the response based on above condition.

1) Want to know is there any existing web services or any example in Moodle which I can go through.

2) What can be the best approach to achieve this?

3) How I convert these JSON data to an array. Can I use JSON encode in Moodle or Moodle as has its own function?

Need help. Kindly guide me to achieve this requirement.

 

 
Average of ratings: -