cloudyr / limer

A LimeSurvey R Client
MIT License
67 stars 37 forks source link

get_session_key() returns Error: Argument 'txt' must be a JSON string, URL or file. #52

Closed munozedg closed 5 years ago

munozedg commented 5 years ago

I am using this R code based on one of the examples here:

# first limer (check version: must be recent) must be installed
if(!require("devtools")) {
  install.packages("devtools")
  library("devtools")
}
install.packages("jsonlite")
install_github("cloudyr/limer")
#############################################################
library(jsonlite)
library(limer)

#change the next options (website, user, password)
options(lime_api = 'https://my.server.here/LimeSurvey/admin/remotecontrol')
options(lime_username = 'user')
options(lime_password = 'pass')
#############################################################

# first get a session access key
get_session_key()
munozedg commented 5 years ago

Solved. (Edited)

I deactivated the Publish API on /admin/remotecontrol: option and I just used the alternative URL provided there in Global settings i.e. this: https://my-server/LimeSurvey/index.php?r=admin/remotecontrol

r0bis commented 1 year ago

Just to mention - this kind of error can occur also when server returns unexpected response - for example you are hosting LS on one of the typical platforms like a2 or other, and the system decides to check if you are not a bot (captcha). You can check if this is the case opening your LS installation admin URL https://yourLSurl.org/admin and if you see a captcha, accompanied by something like "we need to verify because of ... odd traffic" - you solve the captcha and re-run script you were using limer in - it should work now.