Pss
Pss

Reputation: 643

Qualtrics API not fetching data using R (qualtRics)

This isn't an issue of authentication failure. I'm using qualtRics library.


library("qualtRics")


qualtrics_api_credentials(api_key = "abcxyz", #A valid token key
                          base_url = "dc1.qualtrics.com", 
                          install = TRUE)



surveys <- all_surveys()

glimpse(surveys) #this gives me a list of surveys from my qualtrics account. 

The surveys is a tibble with surveyID. I then use fetch to get data for a specific survey.

ema_survey <- fetch_survey(surveyID = surveys$id[6])
glimpse(ema_survey)

The data gets downloaded but I see only column data and no row data. I'm wondering why this is the case (the data is present ~1200 rows). I'm just confused why this isn't working.

Edit: The output that I get from:

> ema_survey <- fetch_survey(surveyID = surveys$id[6], verbose = TRUE)
  |=======================================================================================================| 100%
                                                                                                               
── Column specification ─────────────────────────────────────────────────────────────────────────────────────────
cols(
  StartDate = col_character(),
  EndDate = col_character(),
  Status = col_character(),
  IPAddress = col_character(),
  Progress = col_character(),
  `Duration (in seconds)` = col_character(),
  Finished = col_character(),
  RecordedDate = col_character(),
  ResponseId = col_character(),
  RecipientLastName = col_character(),
  RecipientFirstName = col_character(),
  RecipientEmail = col_character(),
  ExternalReference = col_character(),
  LocationLatitude = col_character(),
  LocationLongitude = col_character(),
  DistributionChannel = col_character(),
  UserLanguage = col_character(),
  Q1_1 = col_character()
)

> ema_survey
# A tibble: 0 × 18
# ℹ 18 variables: StartDate <chr>, EndDate <chr>, Status <chr>, IPAddress <chr>, Progress <chr>,
#   Duration (in seconds) <chr>, Finished <chr>, RecordedDate <chr>, ResponseId <chr>, RecipientLastName <chr>,
#   RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>, LocationLatitude <chr>,
#   LocationLongitude <chr>, DistributionChannel <chr>, UserLanguage <chr>, Q1_1 <chr>

Upvotes: 0

Views: 61

Answers (1)

Pss
Pss

Reputation: 643

I found out that the data won't get sent for surveys where you are a collaborator (instead of owner). I was able to get data for surveys where I was the owner.

Upvotes: 1

Related Questions