new MoodleRestClient(host, token [, port] [, protocol] [, subdirectory])
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
host |
String | Your moodle site host, without protocol, port or slashes. Ex: "your-moodle-site.com" | ||
token |
String | Moodle webservice token, see moodle webservice docs for more information | ||
port |
Number |
<optional> |
80 | Site port number |
protocol |
String |
<optional> |
'http' | Request protocol, "http" or "https" |
subdirectory |
String |
<optional> |
null | Moodle site subdirectory. Ex: "/moodle" or "moodle" |
Methods
-
send(wsFunction, key, value)
-
Send request
Parameters:
Name Type Description wsFunction
String Moodle webservice function name key
String Moodle webservice function parameter key value
Array | Object Moodle webservice function parameter value Returns:
- Type
- Promise