Trouble Setting up Survey Import API into Qualtrics using HTTR package in R | XM Community

Trouble Setting up Survey Import API into Qualtrics using HTTR package in R

  • 31 January 2020
  • 0 replies
  • 19 views

Badge
Hello,

I'm trying to POST a csv file into Qualtrics using the POST function in the httr package in R. I keep getting a 500 error and can't seem to troubleshoot it.

I notice that in my header 'content-type' is equal to application/json but it should actually be text/csv. In talking to Qualtrics support they said that 'X-API-TOKEN' and 'Content-Type' are the only two required headers, and as I mentioned I have a content-type header but it's lowercase, so I don't know if that is causing the problem.

This is the post I was using to create the POST call and I've posted my code below (I masked the Survey ID just in case). I'm just really stuck and would appreciate any advice or general direction.

vQualtrics_Upload <- POST(url = "https://az1.qualtrics.com/API/v3/surveys/[SURVEY ID]/import-responses",
add_headers('X-API-TOKEN' = vQualtrics_Token),
body = list(surveyId = [SURVEY ID], file = upload_file("C:/Users/jackman/desktop/API/responses.csv", type = "text/csv")))


Thanks,
Jake

0 replies

Be the first to reply!

Leave a Reply