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

fetch_survey produces "Error: Qualtrics API raised a bad request (400) error" #234

Closed
avi-kluger opened this issue Oct 7, 2021 · 5 comments

Comments

@avi-kluger
Copy link

Both of the following attempts to use the function (reading with API and reading from local file fail:

x <- fetch_survey("SV_3ecZ9vrQsiow5QG",
force_request = TRUE,
include_display_order = FALSE)

Error: Qualtrics API complains that the requested resource cannot be found (404 error).
Please check if you are using the correct survey ID.
Run rlang::last_error() to see where the error occurred.

x <- fetch_survey(
"Incivility in health organizations_October 7, 2021_04.32.csv")

Error: Qualtrics API raised a bad request (400) error - Please report this on
https://github.com/ropensci/qualtRics/issues
Run rlang::last_error() to see where the error occurred.

<error/rlang_error>
Qualtrics API raised a bad request (400) error - Please report this on
https://github.com/ropensci/qualtRics/issues
Backtrace:

  1. qualtRics::fetch_survey("Incivility in health organizations_October 7, 2021_04.32.csv")
  2. qualtRics:::qualtrics_api_request("POST", url = fetch_url, body = raw_payload)
  3. qualtRics:::qualtrics_response_codes(res)
@juliasilge
Copy link
Collaborator

The function fetch_survey() does not work on CSV files that you have downloaded. For those kinds of files, try out using read_survey()

For your problems fetching a survey by ID, is this possibly the same issue as #173, #177, #179, #184, and #193? Be sure your base URL is saved correctly as specified in the docs.

Notice that when you register your credentials:

The base URL you pass to the qualtRics package should either look like yourdatacenterid.qualtrics.com or like yourorganizationid.yourdatacenterid.qualtrics.com, without a scheme such as https://

@avi-kluger
Copy link
Author

avi-kluger commented Oct 8, 2021 via email

@juliasilge
Copy link
Collaborator

Yes, that would do it! Let us know if you have further problems. 🙌

@axdey
Copy link

axdey commented Dec 7, 2021

Hi Julia and Avi,

I am getting a 403 error similar to the one that avi described when I try to fetch all surveys surveys<-all_surveys(). Here is the error message that I am getting:

Error in qualtrics_response_codes(res) : Qualtrics API raised an forbidden (403) error - you may have a valid API
key that lacks permissions to query the API. Please check your settings and/or talk to your administrators.

Does this mean that the issue is with my API key? It was working fine for me till last weekend and suddenly stopped working.

Thank you,

Arnab

@juliasilge
Copy link
Collaborator

Hello there @arnabkdey! It is possible, yes. I'd suggest you see if you can generate a new API key for your account. If that doesn't work, I'd suggest that you open a new issue outlining your problem instead of posting under an old, closed issue. 👍

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

3 participants