Quick Start

There are three IDs that Qualtrics users need to locate in order to access to their Qualtrics account via the Qualtrics API. These IDs can all be found by logging into your Qualtrics account, and navigating to your account settings page. Once on the account setting’s page click on the Qualtrics IDs tab.

Finding Qualtrics API Credentials

On this page you will be able to generate an API token specific to your user account. This token is the first ID that will be needed in order to use the Qualtrics API. The second ID that you will need is your Directory ID. This can be found on the same page and should begin with a ‘POOL’ at the beginning. The final ID can be found in the url, it will follow either the (yourorganizationid.yourdatacenter.qualtrics.com) or (yourdatacenter.qualtrics.com). In either case you want to use the yourdatacenter portion as your Data Center ID.

If you are struggling to find one of these IDs check out Qualtrics - Finding Your Qualtrics IDs Guide

class QualtricsAPI.Setup.credentials.Credentials

This class handles the setup of credentials needed to setup the Qualtrics API Authorization. Use the qualtrics_api_credentials method to create enviornment variables that will automatically populate the correct HTTP headers for the request that you are making.

qualtrics_api_credentials(token, data_center, directory_id=None)

This method creates enviornment variables for the users Qualtrics API token, data center, and their directory id.

Parameters
  • token (str) – Your Qualtrics API Token

  • data_center (str) – Your Qualtrics data center

  • directory_id (str) – Your Qualtrics directory id

Returns

Nothing explicitly, However you just create enviornment variables that will populate you HTTP Headers.

Example Implementation

Here is an example of how to implement the qualtrics_api_credentials() method. You will use the credentials that you located in the previous steps as the arguments to the necessary parameters.

from QualtricsAPI.Setup import Credentials

#Create an instance of Credentials
c = Credentials()

#Call the qualtrics_api_credentials() method
c.qualtrics_api_credentials(token='Your API Token',data_center='Your Data Center',directory_id='Your Directory ID')