Creates a new JSON-RPC session key. This is mandatory for all following LimeSurvey RemoteControl 2 function calls.

lsGetSessionKey(
  lsAPIurl = getOption("lsAPIurl"),
  username = getOption("lsUser"),
  password = getOption("lsPass"),
  setEnvir = TRUE
)

Arguments

lsAPIurl

(optional) The URL of the LimeSurvey RemoteControl 2 JSON-RPC API

username

(optional) The LimeSurvey user name

password

(optional) The LimeSurvey password

setEnvir

Sets a session key environment variable so that it doesn't have to be passed as an argument to other functions

Value

  • On success: the session key.

  • On error:

    • For protocol-level errors (invalid format etc), an error message.

    • For invalid user name and password, returns a null error and the result body contains a 'status' name-value pair with the error message.

References

https://api.limesurvey.org/classes/remotecontrol_handle.html#method_get_session_key

See also

Examples

if (FALSE) { lsGetSessionKey() }