ropensci / qualtRics

Download ⬇️ Qualtrics survey data directly into R!
https://docs.ropensci.org/qualtRics
Other
215 stars 70 forks source link

do.call error #9

Closed aniruhil closed 7 years ago

aniruhil commented 7 years ago

registerApiKey("mytoken") [1] TRUE

surveys <- getSurveys(root_url="https://ohio.qualtrics.com") Error in do.call(rbind.data.frame, content(res)$result$elements) : second argument must be a list

Any idea what could be going on here, Jasper?

JasperHG90 commented 7 years ago

Hi Ani,

Thanks for the report.

getSurveys() queries the API, which then returns a list of survey IDs and other information.

do.call() recursively applies rbind.data.frame() to this list such that the function returns a data frame with survey information.

This error means that the second argument passed to do.call() (in this case, the list of survey information) is not a list. Most likely, its value is NULL. This happens because the Qualtrics API does not return a list of surveys for some reason, for example because your authentication with the API fails.

Please check the following:

1) You have access to the Qualtrics API and you have a valid API key 2) You have passed a valid API key to registerApiKey() 3) Please re-run this function without a specific root url and check the results.

I will update the error message such that it is more informative.

Thanks!

aniruhil commented 7 years ago

Thanks Jasper; might be something to do with access rights at my institution since using qualtrics' API documentation page to test my API token throws a 401 error.