cloudyr / limer

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

Example code throws "Error: lexical error: invalid char in json text." #69

Open ulyngs opened 4 weeks ago

ulyngs commented 4 weeks ago

Hi there,

I'm trying to simply run the 'get_summary' example from the readme, and it throws this error:

call_limer(method = "get_summary", 
           params = list(iSurveyID = 919631, #one of my surveys
                         sStatname = "completed_responses"))

Error: lexical error: invalid char in json text. <!DOCTYPE html> <html lang="en" (right here) ------^

Here's the traceback

Error: lexical error: invalid char in json text.
                                       <!DOCTYPE html> <html lang="en"
                     (right here) ------^
5. parse_string(txt, bigint_as_char)
4. parseJSON(txt, bigint_as_char)
3. parse_and_simplify(txt = txt, simplifyVector = simplifyVector,
simplifyDataFrame = simplifyDataFrame, simplifyMatrix = simplifyMatrix,
flatten = flatten, ...)
2. jsonlite::fromJSON(httr::content(r, as = "text", encoding = "utf-8"))
1. call_limer(method = "export_responses", params = list(iSurveyID = 919631))

call_limer(method = "list_surveys") works, but I guess this error consistently when trying to export data with an arbitrary API call.