Hi
I used to use API v2 for some tasks with our contacts. Now I'm not sure how I should construct my calls in R after they upgraded to v3, the 'Try' button on their API page isn't even working.
Any help would be greatly appreciated.
-Helgi
Page 1 / 1
I found the answer. If anyone is also in trouble, here is the answer:
https://cran.r-project.org/web/packages/curl/vignettes/intro.html#customizing_requests
library(curl)
library(jsonlite)
h <- new_handle()
handle_setheaders(h,
"X-API-TOKEN" = "my_token"
)
req <- curl_fetch_memory("https://yourdatacenterid.qualtrics.com/API/v3/users", handle = h)
jsonlite::prettify(rawToChar(req$content))
https://cran.r-project.org/web/packages/curl/vignettes/intro.html#customizing_requests
library(curl)
library(jsonlite)
h <- new_handle()
handle_setheaders(h,
"X-API-TOKEN" = "my_token"
)
req <- curl_fetch_memory("https://yourdatacenterid.qualtrics.com/API/v3/users", handle = h)
jsonlite::prettify(rawToChar(req$content))
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.