node-moodle-client
node-moodle-client copied to clipboard
Invalid token when POSTING Json data
I'm getting this error when I'm uploading users:
<?xml version="1.0" encoding="UTF-8" ?>
<EXCEPTION class="moodle_exception">
<ERRORCODE>invalidtoken</ERRORCODE>
<MESSAGE>Invalid token - token not found</MESSAGE>
</EXCEPTION>
And this is my code:
function send_users_to_moodle(client, Json, count, x) {
client.call({
wsfunction: "core_user_create_users",
method: "POST",
args: {
Json
}
}).then(function (info) {
console.log(info);
});
};
This happens when I'm trying to add more then 200+- users and when there are errors in the data, like null. But it doesn't give me an error about that, but about the invalid token. Please help. thanks in advance
Are you able to monitor the server side too? To see if/what error was thrown in Moodle?