Datasets

Number of APIs: 6

This API is deprecated

This API should not be used for new production code. If you are already using it, support will continue, but in the future, this API will no longer work.

Datasets allow customers to import their custom data into the XM Platform. This is particularly useful for importing operational data.

Datasets Created On Web Not Visible to Datasets API

If you created datasets on the Qualtrics website, you will not be able to use or modify those datasets with the datasets API.

Walkthrough

To pull data from an external data source into a project, you make an API call to create the project and additional API calls to add records. First create a Dataset using the POST Dataset endpoint. The Dataset defines the schema for your data. Once you've defined your Dataset, you can use the Data Records POST to add data to it. Once you add your data, you can view it in your dashboards or even combine the data with your survey response data.

To demonstrate, we'll use this simple data format:

Page TitlePage Views
Page 188
Page 28
Page 315

Create a Dataset

To add an external data source, you use the POST /datasets

curl --request POST \
  --url https://ca1.qualtrics.com/API/v3/datasets \
  --header 'content-type: application/json' \
  --header 'x-api-token: ' \
  --data '{
  "name": "Google Analytics Data Set",
  "primaryKey": "pageTitle",
  "createProject": true,
  "fields": [
    {
      "name": "pageTitle",
      "type": "string"
    },
    {
      "name": "pageviews",
      "type": "integer"
    }
  ]
}'

The above request should give you a response like:

{
  "result": {
    "name": "Google Analytics Data Set",
    "primaryKey": "pageTitle",
    "datasetId": "dcf04acc768f4ea5",
    "fields": [
      {
        "name": "pageTitle",
        "type": "string"
      },
      {
        "name": "pageviews",
        "type": "integer"
      }
    ]
  },
  "meta": {
    "requestId": "b2fa3cdd-5c43-4d2b-a5d7-e85faf45f3e1",
    "httpStatus": "200 - OK"
  }
}

In the above response, you will find the datasetId. You will need this identifier to make all other calls related to this dataset.

Adding Data to Dataset

To add an external data source, you use the POST /datasets/{datasetId}/data

curl --request POST \
  --url https://ca1.qualtrics.com/API/v3/datasets/datasetId/data \
  --header 'content-type: application/json' \
  --header 'x-api-token: ' \
  --data '{
    "pageTitle": "Page 1",
    "pageviews": 64
}'

From this request you should receive a standard 200-OKresponse: ```json { result: {}, meta: { requestId: c2875d47-e9a8-40b5-ac68-cefa69451474, httpStatus: 200 - OK } }


### Retrieving Data from a Dataset

To get data from an external data source, you use the [`GET /datasets/{datasetId}/data/{id}`](../../../reference/datasets.json/paths/~1datasets~1{datasetId}~1data~1{id}/get), where the ID is the value of the primary key for that row.

```shell
curl --request GET \
  --url https://ca1.qualtrics.com/API/v3/datasets/datasetId/data/id \
  --header 'x-api-token: '

From this request you should receive a standard 200-OKresponse: ```json { result: { pageTitle: Page 1, pageviews: 64 }, meta: { requestId: c2875d47-e9a8-40b5-ac68-cefa69451474, httpStatus: 200 - OK } }





Contact Support:
 Name: Support
  1. datasets-{datasetId}-data-{id} - Get Data from Imported Data Project GET {{baseUrl}}/datasets/:datasetId/data/:id

  2. datasets - Create Imported Data Project POST {{baseUrl}}/datasets

  3. datasets-{datasetId}-data-{id} - Delete Data from Imported Data Project DELETE {{baseUrl}}/datasets/:datasetId/data/:id

  4. datasets-{datasetId}-data-{id} - Update Data in Imported Data Project PUT {{baseUrl}}/datasets/:datasetId/data/:id

  5. datasets-{datasetId}-data - Add Data to Imported Data Project POST {{baseUrl}}/datasets/:datasetId/data

  6. datasets-{datasetId} - Get Imported Data Project GET {{baseUrl}}/datasets/:datasetId