Problems with parameters via REST/POST Protocol

Problems with parameters via REST/POST Protocol

by Jaime Peña -
Number of replies: 0

Hello, I need help with a specific issue, please.

My company has created a academy-management software which has certain interactions with Moodle: specifically, it uses a webservice to carry out certain tasks in our customers' Moodle databases (creating new courses and groups, creating new users, enrolling said users in the corresponding courses, etc.). The instructions are sent to the webservice via REST protocol calls (using JSON and POST), in which the needed information is sent.

The problem is as follows: usually, we send the webservice token (wstoken), function to be used (wsfunction) and method used (moodlewsrestformat=json) in the call/URL itself, but any additional parameters are sent in the BODY component of the POST call. It has always worked properly until now. Recently, one of our customers filed a complaint in which the functions were not working.

After testing, we've come to the conclusion that our customer's Moodle website ignores the parameters sent via the BODY component, and so, it always returns a "Invalid parameter value" exception. Using the Postman addon for Chrome we've tested that, truly enough, if we send the specific parameter as another parameter in the call/URL itself, it works correctly. 

We're in the dark as to why this might be happening. Can somebody please help us find out how to enable the reception of parameters via the BODY component of the POST call?

Thanks in advance

Average of ratings: -