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

all_surveys() and fetch_survey() error in R version 4.0.0 #173

Closed
dallinwebb opened this issue Jun 2, 2020 · 11 comments
Closed

all_surveys() and fetch_survey() error in R version 4.0.0 #173

dallinwebb opened this issue Jun 2, 2020 · 11 comments

Comments

@dallinwebb
Copy link

I get this error when using this and the fetch_survey() function in the latest version of R.

> qualtRics::all_surveys()
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Could not resolve host: https

I've get the same error with the development version of the package.
After rolling back to R version 3.6.3, the functions work fine.

@juliasilge
Copy link
Collaborator

That sounds like an issue with curl, which did have some differences arise with R 4.0. See here and here. I thought that these issues were now resolved and you should be good to go after updating? You can see that I am fine on MacOS with R 4.0 and curl 4.3:

library(qualtRics)
all_surveys()
#> # A tibble: 4 x 6
#>   id         name           ownerId     lastModified    creationDate    isActive
#>   <chr>      <chr>          <chr>       <chr>           <chr>           <lgl>   
#> 1 SV_3gbwq8… Beskar Armor   UR_8wfG5qs… 2020-02-20T01:… 2020-02-20T00:… TRUE    
#> 2 SV_56icaa… Cats Can Have… UR_8wfG5qs… 2020-02-11T04:… 2020-02-11T03:… TRUE    
#> 3 SV_5BJRo2… Sourdough Bre… UR_8wfG5qs… 2020-03-29T20:… 2020-03-29T20:… TRUE    
#> 4 SV_ezYI0F… Priorities fo… UR_8wfG5qs… 2020-05-06T19:… 2020-04-23T18:… TRUE

Created on 2020-06-02 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.0 (2020-04-24)
#>  os       macOS Mojave 10.14.6        
#>  system   x86_64, darwin17.0          
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       America/Denver              
#>  date     2020-06-02                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date       lib source                          
#>  assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.0.0)                  
#>  backports     1.1.7   2020-05-13 [1] CRAN (R 4.0.0)                  
#>  callr         3.4.3   2020-03-28 [1] CRAN (R 4.0.0)                  
#>  cli           2.0.2   2020-02-28 [1] CRAN (R 4.0.0)                  
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 4.0.0)                  
#>  curl          4.3     2019-12-02 [1] CRAN (R 4.0.0)                  
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 4.0.0)                  
#>  devtools      2.3.0   2020-04-10 [1] CRAN (R 4.0.0)                  
#>  digest        0.6.25  2020-02-23 [1] CRAN (R 4.0.0)                  
#>  dplyr         1.0.0   2020-06-01 [1] Github (tidyverse/dplyr@766a761)
#>  ellipsis      0.3.1   2020-05-15 [1] CRAN (R 4.0.0)                  
#>  evaluate      0.14    2019-05-28 [1] CRAN (R 4.0.0)                  
#>  fansi         0.4.1   2020-01-08 [1] CRAN (R 4.0.0)                  
#>  fs            1.4.1   2020-04-04 [1] CRAN (R 4.0.0)                  
#>  generics      0.0.2   2018-11-29 [1] CRAN (R 4.0.0)                  
#>  glue          1.4.1   2020-05-13 [1] CRAN (R 4.0.0)                  
#>  highr         0.8     2019-03-20 [1] CRAN (R 4.0.0)                  
#>  hms           0.5.3   2020-01-08 [1] CRAN (R 4.0.0)                  
#>  htmltools     0.4.0   2019-10-04 [1] CRAN (R 4.0.0)                  
#>  httr          1.4.1   2019-08-05 [1] CRAN (R 4.0.0)                  
#>  insight       0.8.4   2020-05-13 [1] CRAN (R 4.0.0)                  
#>  jsonlite      1.6.1   2020-02-02 [1] CRAN (R 4.0.0)                  
#>  knitr         1.28    2020-02-06 [1] CRAN (R 4.0.0)                  
#>  lifecycle     0.2.0   2020-03-06 [1] CRAN (R 4.0.0)                  
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 4.0.0)                  
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 4.0.0)                  
#>  pillar        1.4.4   2020-05-05 [1] CRAN (R 4.0.0)                  
#>  pkgbuild      1.0.8   2020-05-07 [1] CRAN (R 4.0.0)                  
#>  pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.0.0)                  
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 4.0.0)                  
#>  prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.0.0)                  
#>  processx      3.4.2   2020-02-09 [1] CRAN (R 4.0.0)                  
#>  ps            1.3.3   2020-05-08 [1] CRAN (R 4.0.0)                  
#>  purrr         0.3.4   2020-04-17 [1] CRAN (R 4.0.0)                  
#>  qualtRics   * 3.1.3   2020-05-22 [1] CRAN (R 4.0.0)                  
#>  R6            2.4.1   2019-11-12 [1] CRAN (R 4.0.0)                  
#>  Rcpp          1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0)                  
#>  readr         1.3.1   2018-12-21 [1] CRAN (R 4.0.0)                  
#>  remotes       2.1.1   2020-02-15 [1] CRAN (R 4.0.0)                  
#>  rlang         0.4.6   2020-05-02 [1] CRAN (R 4.0.0)                  
#>  rmarkdown     2.1     2020-01-20 [1] CRAN (R 4.0.0)                  
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 4.0.0)                  
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.0)                  
#>  sjlabelled    1.1.5   2020-05-25 [1] CRAN (R 4.0.0)                  
#>  stringi       1.4.6   2020-02-17 [1] CRAN (R 4.0.0)                  
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 4.0.0)                  
#>  testthat      2.3.2   2020-03-02 [1] CRAN (R 4.0.0)                  
#>  tibble        3.0.1   2020-04-20 [1] CRAN (R 4.0.0)                  
#>  tidyselect    1.1.0   2020-05-11 [1] CRAN (R 4.0.0)                  
#>  usethis       1.6.1   2020-04-29 [1] CRAN (R 4.0.0)                  
#>  utf8          1.1.4   2018-05-24 [1] CRAN (R 4.0.0)                  
#>  vctrs         0.3.1   2020-06-01 [1] Github (r-lib/vctrs@504ec96)    
#>  withr         2.2.0   2020-04-20 [1] CRAN (R 4.0.0)                  
#>  xfun          0.14    2020-05-20 [1] CRAN (R 4.0.0)                  
#>  yaml          2.2.1   2020-02-01 [1] CRAN (R 4.0.0)                  
#> 
#> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

Can you double check your curl version and if you still have problems, use reprex and perhaps call curl functions directly to isolate the problem?

@dallinwebb
Copy link
Author

I'm experiencing the same behavior with the current version of the curl package.
Should I make a new issue on curl's github?

> R.version.string
[1] "R version 4.0.0 (2020-04-24)"
> packageVersion("qualtRics")
[1] ‘3.1.3’
> packageVersion("curl")
[1] ‘4.3’
> qualtRics::all_surveys()
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Could not resolve host: https

Also, how did you create that Session info toggle in markdown?

@juliasilge
Copy link
Collaborator

Try using reprex(si = TRUE) when you create reproducible examples; it is super helpful when tracking down version info! If you haven't used reprex before, check out this article.

Can you try calling some of the curl functions directly and make sure that is the problem? You'll need that to post an issue for curl anyway.

@dallinwebb
Copy link
Author

I've never used curl directly, but I ran this from one of their articles and it worked.

req <- curl_fetch_memory("https://eu.httpbin.org/get?foo=123")
str(req)
List of 7
 $ url        : chr "https://eu.httpbin.org/get?foo=123"
 $ status_code: int 200
 $ type       : chr "application/json"
 $ headers    : raw [1:230] 48 54 54 50 ...
 $ modified   : POSIXct[1:1], format: NA
 $ times      : Named num [1:6] 0 0.083 0.162 0.306 0.377 ...
  ..- attr(*, "names")= chr [1:6] "redirect" "namelookup" "connect" "pretransfer" ...
 $ content    : raw [1:390] 7b 0a 20 20 ...

@juliasilge
Copy link
Collaborator

Yes, but the known problem was for URLs with no scheme.

Can you run the following using reprex() with si = TRUE so I can compare?

library(curl)
url <- "eu.httpbin.org/get?foo=123"
curl_fetch_memory(url)
#> $url
#> [1] "http://eu.httpbin.org/get?foo=123"
#> 
#> $status_code
#> [1] 200
#> 
#> $type
#> [1] "application/json"
#> 
#> $headers
#>   [1] 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d 0a 44 61 74 65 3a 20 54 75
#>  [26] 65 2c 20 30 32 20 4a 75 6e 20 32 30 32 30 20 32 33 3a 30 36 3a 31 38 20 47
#>  [51] 4d 54 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61 70 70 6c 69 63 61
#>  [76] 74 69 6f 6e 2f 6a 73 6f 6e 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68
#> [101] 3a 20 33 37 30 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61
#> [126] 6c 69 76 65 0d 0a 53 65 72 76 65 72 3a 20 67 75 6e 69 63 6f 72 6e 2f 31 39
#> [151] 2e 39 2e 30 0d 0a 41 63 63 65 73 73 2d 43 6f 6e 74 72 6f 6c 2d 41 6c 6c 6f
#> [176] 77 2d 4f 72 69 67 69 6e 3a 20 2a 0d 0a 41 63 63 65 73 73 2d 43 6f 6e 74 72
#> [201] 6f 6c 2d 41 6c 6c 6f 77 2d 43 72 65 64 65 6e 74 69 61 6c 73 3a 20 74 72 75
#> [226] 65 0d 0a 0d 0a
#> 
#> $modified
#> [1] NA
#> 
#> $times
#>      redirect    namelookup       connect   pretransfer starttransfer 
#>      0.000000      0.000989      0.065819      0.065861      0.138621 
#>         total 
#>      0.138635 
#> 
#> $content
#>   [1] 7b 0a 20 20 22 61 72 67 73 22 3a 20 7b 0a 20 20 20 20 22 66 6f 6f 22 3a 20
#>  [26] 22 31 32 33 22 0a 20 20 7d 2c 20 0a 20 20 22 68 65 61 64 65 72 73 22 3a 20
#>  [51] 7b 0a 20 20 20 20 22 41 63 63 65 70 74 22 3a 20 22 2a 2f 2a 22 2c 20 0a 20
#>  [76] 20 20 20 22 41 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e 67 22 3a 20 22 64 65
#> [101] 66 6c 61 74 65 2c 20 67 7a 69 70 22 2c 20 0a 20 20 20 20 22 48 6f 73 74 22
#> [126] 3a 20 22 65 75 2e 68 74 74 70 62 69 6e 2e 6f 72 67 22 2c 20 0a 20 20 20 20
#> [151] 22 55 73 65 72 2d 41 67 65 6e 74 22 3a 20 22 52 20 28 34 2e 30 2e 30 20 78
#> [176] 38 36 5f 36 34 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 37 2e 30 20 78 38
#> [201] 36 5f 36 34 20 64 61 72 77 69 6e 31 37 2e 30 29 22 2c 20 0a 20 20 20 20 22
#> [226] 58 2d 41 6d 7a 6e 2d 54 72 61 63 65 2d 49 64 22 3a 20 22 52 6f 6f 74 3d 31
#> [251] 2d 35 65 64 36 64 62 36 61 2d 63 38 31 37 33 35 34 64 35 33 35 39 30 31 32
#> [276] 62 37 63 35 33 39 62 37 61 22 0a 20 20 7d 2c 20 0a 20 20 22 6f 72 69 67 69
#> [301] 6e 22 3a 20 22 31 37 33 2e 32 33 31 2e 36 33 2e 31 30 34 22 2c 20 0a 20 20
#> [326] 22 75 72 6c 22 3a 20 22 68 74 74 70 3a 2f 2f 65 75 2e 68 74 74 70 62 69 6e
#> [351] 2e 6f 72 67 2f 67 65 74 3f 66 6f 6f 3d 31 32 33 22 0a 7d 0a

Created on 2020-06-02 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.0 (2020-04-24)
#>  os       macOS Mojave 10.14.6        
#>  system   x86_64, darwin17.0          
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       America/Denver              
#>  date     2020-06-02                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date       lib source        
#>  assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.0.0)
#>  backports     1.1.7   2020-05-13 [1] CRAN (R 4.0.0)
#>  callr         3.4.3   2020-03-28 [1] CRAN (R 4.0.0)
#>  cli           2.0.2   2020-02-28 [1] CRAN (R 4.0.0)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 4.0.0)
#>  curl        * 4.3     2019-12-02 [1] CRAN (R 4.0.0)
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 4.0.0)
#>  devtools      2.3.0   2020-04-10 [1] CRAN (R 4.0.0)
#>  digest        0.6.25  2020-02-23 [1] CRAN (R 4.0.0)
#>  ellipsis      0.3.1   2020-05-15 [1] CRAN (R 4.0.0)
#>  evaluate      0.14    2019-05-28 [1] CRAN (R 4.0.0)
#>  fansi         0.4.1   2020-01-08 [1] CRAN (R 4.0.0)
#>  fs            1.4.1   2020-04-04 [1] CRAN (R 4.0.0)
#>  glue          1.4.1   2020-05-13 [1] CRAN (R 4.0.0)
#>  highr         0.8     2019-03-20 [1] CRAN (R 4.0.0)
#>  htmltools     0.4.0   2019-10-04 [1] CRAN (R 4.0.0)
#>  knitr         1.28    2020-02-06 [1] CRAN (R 4.0.0)
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 4.0.0)
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 4.0.0)
#>  pkgbuild      1.0.8   2020-05-07 [1] CRAN (R 4.0.0)
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 4.0.0)
#>  prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.0.0)
#>  processx      3.4.2   2020-02-09 [1] CRAN (R 4.0.0)
#>  ps            1.3.3   2020-05-08 [1] CRAN (R 4.0.0)
#>  R6            2.4.1   2019-11-12 [1] CRAN (R 4.0.0)
#>  Rcpp          1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0)
#>  remotes       2.1.1   2020-02-15 [1] CRAN (R 4.0.0)
#>  rlang         0.4.6   2020-05-02 [1] CRAN (R 4.0.0)
#>  rmarkdown     2.1     2020-01-20 [1] CRAN (R 4.0.0)
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 4.0.0)
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.0)
#>  stringi       1.4.6   2020-02-17 [1] CRAN (R 4.0.0)
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 4.0.0)
#>  testthat      2.3.2   2020-03-02 [1] CRAN (R 4.0.0)
#>  usethis       1.6.1   2020-04-29 [1] CRAN (R 4.0.0)
#>  withr         2.2.0   2020-04-20 [1] CRAN (R 4.0.0)
#>  xfun          0.14    2020-05-20 [1] CRAN (R 4.0.0)
#>  yaml          2.2.1   2020-02-01 [1] CRAN (R 4.0.0)
#> 
#> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

@dallinwebb
Copy link
Author

Finally got my first reprex to work.

curl::curl_fetch_memory("eu.httpbin.org/get?foo=123")
#> $url
#> [1] "eu.httpbin.org/get?foo=123"
#> 
#> $status_code
#> [1] 200
#> 
#> $type
#> [1] "application/json"
#> 
#> $headers
#>   [1] 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d 0a 44 61 74 65 3a 20 54 75
#>  [26] 65 2c 20 30 32 20 4a 75 6e 20 32 30 32 30 20 32 33 3a 32 38 3a 35 30 20 47
#>  [51] 4d 54 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61 70 70 6c 69 63 61
#>  [76] 74 69 6f 6e 2f 6a 73 6f 6e 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68
#> [101] 3a 20 33 36 32 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61
#> [126] 6c 69 76 65 0d 0a 53 65 72 76 65 72 3a 20 67 75 6e 69 63 6f 72 6e 2f 31 39
#> [151] 2e 39 2e 30 0d 0a 41 63 63 65 73 73 2d 43 6f 6e 74 72 6f 6c 2d 41 6c 6c 6f
#> [176] 77 2d 4f 72 69 67 69 6e 3a 20 2a 0d 0a 41 63 63 65 73 73 2d 43 6f 6e 74 72
#> [201] 6f 6c 2d 41 6c 6c 6f 77 2d 43 72 65 64 65 6e 74 69 61 6c 73 3a 20 74 72 75
#> [226] 65 0d 0a 0d 0a
#> 
#> $modified
#> [1] NA
#> 
#> $times
#>      redirect    namelookup       connect   pretransfer starttransfer 
#>      0.000000      0.057053      0.136352      0.136466      0.207489 
#>         total 
#>      0.207518 
#> 
#> $content
#>   [1] 7b 0a 20 20 22 61 72 67 73 22 3a 20 7b 0a 20 20 20 20 22 66 6f 6f 22 3a 20
#>  [26] 22 31 32 33 22 0a 20 20 7d 2c 20 0a 20 20 22 68 65 61 64 65 72 73 22 3a 20
#>  [51] 7b 0a 20 20 20 20 22 41 63 63 65 70 74 22 3a 20 22 2a 2f 2a 22 2c 20 0a 20
#>  [76] 20 20 20 22 41 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e 67 22 3a 20 22 64 65
#> [101] 66 6c 61 74 65 2c 20 67 7a 69 70 22 2c 20 0a 20 20 20 20 22 48 6f 73 74 22
#> [126] 3a 20 22 65 75 2e 68 74 74 70 62 69 6e 2e 6f 72 67 22 2c 20 0a 20 20 20 20
#> [151] 22 55 73 65 72 2d 41 67 65 6e 74 22 3a 20 22 52 20 28 34 2e 30 2e 30 20 78
#> [176] 38 36 5f 36 34 2d 77 36 34 2d 6d 69 6e 67 77 33 32 20 78 38 36 5f 36 34 20
#> [201] 6d 69 6e 67 77 33 32 29 22 2c 20 0a 20 20 20 20 22 58 2d 41 6d 7a 6e 2d 54
#> [226] 72 61 63 65 2d 49 64 22 3a 20 22 52 6f 6f 74 3d 31 2d 35 65 64 36 65 30 62
#> [251] 32 2d 63 34 30 63 63 38 64 34 63 31 34 39 34 31 31 61 36 64 38 61 63 62 62
#> [276] 65 22 0a 20 20 7d 2c 20 0a 20 20 22 6f 72 69 67 69 6e 22 3a 20 22 32 31 36
#> [301] 2e 34 39 2e 31 38 31 2e 32 35 33 22 2c 20 0a 20 20 22 75 72 6c 22 3a 20 22
#> [326] 68 74 74 70 3a 2f 2f 65 75 2e 68 74 74 70 62 69 6e 2e 6f 72 67 2f 67 65 74
#> [351] 3f 66 6f 6f 3d 31 32 33 22 0a 7d 0a

Created on 2020-06-02 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> - Session info ---------------------------------------------------------------
#>  setting  value                       
#>  version  R version 4.0.0 (2020-04-24)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  English_United States.1252  
#>  ctype    English_United States.1252  
#>  tz       America/Denver              
#>  date     2020-06-02                  
#> 
#> - Packages -------------------------------------------------------------------
#>  package     * version date       lib source        
#>  assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.0.0)
#>  backports     1.1.7   2020-05-13 [1] CRAN (R 4.0.0)
#>  callr         3.4.3   2020-03-28 [1] CRAN (R 4.0.0)
#>  cli           2.0.2   2020-02-28 [1] CRAN (R 4.0.0)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 4.0.0)
#>  curl          4.3     2019-12-02 [1] CRAN (R 4.0.0)
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 4.0.0)
#>  devtools      2.3.0   2020-04-10 [1] CRAN (R 4.0.0)
#>  digest        0.6.25  2020-02-23 [1] CRAN (R 4.0.0)
#>  ellipsis      0.3.1   2020-05-15 [1] CRAN (R 4.0.0)
#>  evaluate      0.14    2019-05-28 [1] CRAN (R 4.0.0)
#>  fansi         0.4.1   2020-01-08 [1] CRAN (R 4.0.0)
#>  fs            1.4.1   2020-04-04 [1] CRAN (R 4.0.0)
#>  glue          1.4.1   2020-05-13 [1] CRAN (R 4.0.0)
#>  highr         0.8     2019-03-20 [1] CRAN (R 4.0.0)
#>  htmltools     0.4.0   2019-10-04 [1] CRAN (R 4.0.0)
#>  knitr         1.28    2020-02-06 [1] CRAN (R 4.0.0)
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 4.0.0)
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 4.0.0)
#>  pkgbuild      1.0.8   2020-05-07 [1] CRAN (R 4.0.0)
#>  pkgload       1.1.0   2020-05-29 [1] CRAN (R 4.0.0)
#>  prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.0.0)
#>  processx      3.4.2   2020-02-09 [1] CRAN (R 4.0.0)
#>  ps            1.3.3   2020-05-08 [1] CRAN (R 4.0.0)
#>  R6            2.4.1   2019-11-12 [1] CRAN (R 4.0.0)
#>  Rcpp          1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0)
#>  remotes       2.1.1   2020-02-15 [1] CRAN (R 4.0.0)
#>  rlang         0.4.6   2020-05-02 [1] CRAN (R 4.0.0)
#>  rmarkdown     2.2     2020-05-31 [1] CRAN (R 4.0.0)
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 4.0.0)
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.0)
#>  stringi       1.4.6   2020-02-17 [1] CRAN (R 4.0.0)
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 4.0.0)
#>  testthat      2.3.2   2020-03-02 [1] CRAN (R 4.0.0)
#>  usethis       1.6.1   2020-04-29 [1] CRAN (R 4.0.0)
#>  withr         2.2.0   2020-04-20 [1] CRAN (R 4.0.0)
#>  xfun          0.14    2020-05-20 [1] CRAN (R 4.0.0)
#>  yaml          2.2.1   2020-02-01 [1] CRAN (R 4.0.0)
#> 
#> [1] C:/Users/dallin/Documents/R/win-library/4.0
#> [2] C:/Program Files/R/R-4.0.0/library

@juliasilge
Copy link
Collaborator

OK, so it looks like curl is fine.

Try running this, and check out your URL and headers (don't paste your headers here because they involve your API key):

library(qualtRics)


url <- qualtRics:::create_surveys_url(Sys.getenv("QUALTRICS_BASE_URL"))
url
#> [1] "https://conjoint.co1.qualtrics.com/API/v3/surveys/"
headers <- qualtRics:::construct_header(Sys.getenv("QUALTRICS_API_KEY"))

httr::GET(url = url, httr::add_headers(headers))
#> Response [https://conjoint.co1.qualtrics.com/API/v3/surveys/]
#>   Date: 2020-06-03 14:38
#>   Status: 200
#>   Content-Type: application/json
#>   Size: 850 B

Created on 2020-06-03 by the reprex package (v0.3.0)

@dallinwebb
Copy link
Author

url <- qualtRics:::create_surveys_url(Sys.getenv("QUALTRICS_BASE_URL"))
url
#> [1] "https://https://byui.az1.qualtrics.com/API/v3/surveys/"
headers <- qualtRics:::construct_header(Sys.getenv("QUALTRICS_API_KEY"))

httr::GET(url = url, httr::add_headers(headers))
#> Error in curl::curl_fetch_memory(url, handle = handle): Could not resolve host: https

Created on 2020-06-03 by the reprex package (v0.3.0)

@juliasilge
Copy link
Collaborator

Ah, look at the URL! Something is very messed up there. What is in your BASE_URL? It should be something like this:

Sys.getenv("QUALTRICS_BASE_URL")
#> [1] "conjoint.co1.qualtrics.com"

Created on 2020-06-03 by the reprex package (v0.3.0)

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

@dallinwebb
Copy link
Author

That was it! User error.
Sorry for the distraction but thanks for all the help!

@juliasilge
Copy link
Collaborator

Sounds good!

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