Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: lexical error: invalid char in json text. <!DOCTYPE html> <html> <hea (right here) ------^ #525

Open
TarJae opened this issue Feb 25, 2024 · 2 comments

Comments

@TarJae
Copy link

TarJae commented Feb 25, 2024

After successfully getting connected to my formr account using this approach #524

and trying to fetch the responses with:

survey_data <- formr::formr_raw_results("my_study")

I get this error:

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

I found this: https://stackoverflow.com/questions/41000112/reading-a-json-file-in-r-lexical-error-invalid-char-in-json-text
"That can happen if you're trying to access an API and it's redirecting you to a login page, or a 'access forbidden' page, or similar, or if the server is down and instead of giving you JSON data, it gives you a message like "Server down for maintenance", fromJSON() doesn't know how to handle that."

Another guess of mine is, it is because of the underline in the name of the study?
Any help appreciated!

@rubenarslan
Copy link
Owner

Please read the documentation, you need to repeat the host argument in every function call.

@TarJae
Copy link
Author

TarJae commented Feb 25, 2024

Thank you immensely for your patience. I noticed a note in the documentation within the example section that reads as follows:

## Not run: 
formr_raw_results(survey_name = 'training_diary' )

## End(Not run)

This explains why I was confused about the host. However, the clarification was actually provided in the preceding lines. My apologies for the oversight.

Now, when I attempt the following:

formr::formr_raw_results(survey_name = 'my_study', host = "https://workshops.formr.org")

I encounter this error:

Error: parse error: premature EOF
                                       
                     (right here) ------^

I greatly appreciate your patience and assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants