Failure of getSurvey() in the R API
Hi
I have been using the R API successfully to pull my data in for statistical analysis and reporting. However, I have not used in about 3 months and when I came back to do this work I was unsuccessful. Here are my steps and error.
registerOptions(api_token=APIkey, root_url=baseURL)
surveys <- getSurveys()
surveys
This produces the list of surveys table shown in https://api.qualtrics.com/docs/response-exports
Survey Table in R
| | id | name | ownerId | lastModified | isActive |
| --- | ------------------- | -------------- | --------------------- | ------------------- | :---------: |
| | SV_0fHnuNimdt3R9pX | Newer Name | UR_123456789012345 2 | 017-05-25T22:15:22Z | TRUE |
| | SV_0zSlknmZXhJ4BAx | TestFromURL | UR_123456789012345 2 | 017-05-24T20:26:13Z | FALSE |
| | SV_0x1XmEv9pCD2asB | Test | UR_123456789012345 2 | 017-05-24T16:07:23Z | FALSE |
| | SV_3V7MgGcbG4YA3NH | Test Survey 2 | UR_123456789012345 2 | 017-05-24T21:10:21Z | FALSE |
| | SV_4SRzY5wAmUZSzkx | TestFromUrl2 | UR_123456789012345 2 | 017-05-24T21:07:15Z | FALSE |
| | SV_4VxakCgq7b1eU8B | TestFromUrl2 | UR_123456789012345 2 | 017-05-24T21:06:42Z | FALSE |
| | SV_5Ae4nEvcCXslEmR | Simple | UR_123456789012345 2 | 017-05-25T20:52:09Z | FALSE |
| | SV_5d16l4JrllvxLXf | Second Project | UR_123456789012345 2 | 017-05-18T19:49:31Z | FALSE |
| | SV_7TZNw44dHLLPRt3 | TestFromURL | UR_123456789012345 2 | 017-05-24T20:27:15Z | FALSE |
| | SV_9vTqLp3Yk8LofjL | Timezone Test | UR_123456789012345 2 | 017-06-09T19:29:58Z | TRUE |
| | SV_eVPWQKXxLplsOdP | QuestionTypes | UR_123456789012345 2 | 017-06-05T23:01:12Z | TRUE |
Then I use following syntax to pull the survey response data:
timezoneSurvey <- getSurvey(surveys$id[10])
or alternatively
timezoneSurvey <- getSurvey("SV_9vTqLp3Yk8LofjL")
or alternatively
timezoneSurvey <- getSurvey(surveys$id[10], force_request = TRUE)
or alternatively
timezoneSurvey <- getSurvey("SV_9vTqLp3Yk8LofjL", force_request = TRUE)
Please note that I have substituted the Survey Table and IDs from the aforementioned documentation instead of the Survey Table and IDs from our own account. I would rather not post these publicly, however, the syntax is is the same.
Please also note, that getSurveys() above is supposed to get a list of surveys, which is does as in the example above. getSurvey(), without the trailing 's' is supposed to get the survey data. Please scroll to the bottom of the documentation in:
https://api.qualtrics.com/docs/response-exports
Instead of getting the data, I receive the following error message:
Error in qualtRicsResponseCodes(res) :
Qualtrics API complains that the requested resource cannot be found (404 error). Please check if you are using the correct survey ID.
Finally note that this syntax was working a few months ago. So, it appears that a bug was introduced into the Qualtrics API for R.
Has anyone else encountered this problem and found a solution?
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.