Skip to content
Advertisement

Is the sending of data to moodle REST API limited?

I’m using moodle 3.5, I’m trying to send an array of 2308 (user/corresponding cohort) to the external function ‘core_cohort_add_cohort_members’ by POST, the answer of the API is :

array(3) {
  ["exception"]=>
  string(27) "invalid_parameter_exception"
  ["errorcode"]=>
  string(16) "invalidparameter"
  ["message"]=>
  string(42) "Valeur incorrecte de paramètre détectée"
}

But when I’m sending this array by chunk (250 lines by 250 lines) it’s working. So I was wondering, is there any limit from Moodle? Can we change this limit ? Is this limit coming from a limitation of max_file_upload on PHP settings (mine is 256MB) ?

Documentation of Moodle is not specific about that…

Thanks for your answer !

Advertisement

Answer

Might be max-input-vars ? The default is 1000 variables.

https://www.php.net/manual/en/info.configuration.php#ini.max-input-vars

You will need to increase the value in php.ini

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement