Not restful api - help needed

Hi all,

I am trying to use the moodle api to create new users via my bubble app.

The following is a http call which (if I add my domain and token) creates a new user when I open the url in my browser (the link does not work now as it is test data)…

https://test.moodlesite.com/webservice/rest/server.php?wstoken=E9Aggd74hbomcqbWswrHxtwrEU2A4iLC&wsfunction=local_user_external_extended_create_users&users[0][username]=testemail1@gmail.com&users[0][firstname]=Testname&users[0][lastname]=Testsurname&users[0][email]=testemail1@gmail.com&users[0][password]=Testing123!&moodlewsrestformat=json

This format is taken from the moodle webservice instructions (Creating a web service client - MoodleDocs) and it works fine, from the browser. I receive the json response on the page to say it is successful.

The problem is I want to do this via an API but the server it is pointing to is ‘not Restful’ and I keep getting an error saying “debuginfo”: "users => Invalid parameter value detected: Only arrays accepted. This error appears for whatever the last field in the url is.

I am not sure what I need to do to get the same result using an API call as I do from using the browser.

If it isnt possible, does anyone know how I can call it from an iframe and then ‘grab’ the json result from the iframe and save it to the database?

Any help is greatly appreciated.

This topic was automatically closed after 70 days. New replies are no longer allowed.