Closed ktmorris closed 5 months ago
Hello @ktmorris! There are two common issues that cause folks to run into this error.
The base URL you pass to the qualtRics package should either look like
yourdatacenterid.qualtrics.com
or likeyourorganizationid.yourdatacenterid.qualtrics.com
curl --request GET \
--url https://XXX.qualtrics.com/API/v3/whoami \
--header 'x-api-token: YOURLONGAPITOKENHERE'
You would need to use your URL and your API token. Do you see anything in the results like:
Notice: Request proxied. For faster response times, use this host instead:
## put your survey ID here:
fetch_url <- qualtRics::generate_url(query = "fetchsurvey", surveyID = "SV_xxx")
raw_payload <- qualtRics:::create_raw_payload(
label = TRUE,
start_date = NULL,
end_date = NULL,
limit = NULL,
time_zone = NULL,
unanswer_recode = NULL,
unanswer_recode_multi = NULL,
include_display_order = TRUE,
include_questions = NULL,
breakout_sets = NULL
)
res <- qualtRics:::qualtrics_api_request("POST", url = fetch_url, body = raw_payload)
res$meta
#> $requestId
#> [1] "f52b2929-b24a-4c9d-88a6-e7c9d3ff660d"
#>
#> $httpStatus
#> [1] "200 - OK"
Created on 2022-04-04 by the reprex package (v2.0.1)
Similar issue - request was proxied. Once I used the other URL, all went well.
Let us know if you have further questions! 🙌
While the all_surveys() function is working fine, fetch_survey() throws the following error:
` l <- fetch_survey(surveys$id[2])
Error in
qualtrics_response_codes()
:! Qualtrics API reported a bad request error (400):
• Please report this on https://github.com/ropensci/qualtRics/issues
Run
rlang::last_trace()
to see where the error occurred.`