Closed JamesPHoughton closed 1 year ago
Connect to API using third party wrapper: https://www.npmjs.com/package/qualtrics-api
Set Environment Variables
QUALTRICS_API_TOKEN
- Get a API token using instructions: https://www.qualtrics.com/support/integrations/api-integration/overview/#GeneratingAnAPITokenQUALTRICS_BASE_URL
- Get base URL using instructions: https://api.qualtrics.com/ZG9jOjg3NjYzMw-base-url-and-datacenter-i-ds
Base URL = https://iad1.qualtrics.com/APIQUALTRICS_DEFAULT_DIR
Get default directory from the same page as the datacenter ID and API tokenChallenge of knowing
As we really only want to make one API call: https://api.qualtrics.com/1179a68b7183c-retrieve-a-survey-response
The API endpoint takes a responseId
parameter:
https://yul1.qualtrics.com/API/v3/surveys/{surveyId}/responses/{responseId}
But what we get from the end of survey message on the browser is the sessionId
.
There may be an informal relationship between sessionId and responseId. Test survey 1
Different survey
Looks like we can just replace the FS_
with R_
.
In https://github.com/Watts-Lab/deliberation-empirica/issues/426, we made qualtrics work in an iframe, but the data doesn't make its way back to empirica anywhere. We should have a callback on the server that uses the qualtrics API to fetch this data and attach it to the player object.