Sift | Docs

Step 3: Import dataset and view it in Sift

Overview

As in Step 3 of the first tutorial, where we imported the dataset using the UI, in this step we will import the dataset programmatically, in particular using the REST API. We'll use the CreateDataImportFromUrl endpoint instead of the CreateDataImportFromUpload endpoint. This approach allows us to provide a URL to the dataset rather than uploading a local file, simplifying the process for this tutorial.

Import data

Run the cURL command below to import the dataset. The url parameter in the request specifies the location of the dataset, which has been provided at that URL for the purposes of this tutorial.

curl -X POST "YOUR_REST_API_URL_HERE/api/v2/data-imports:url" \
  -H "Authorization: Bearer YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://drive.google.com/uc?export=download&id=1Ec6GHgY24LcNftY_M39w6xT47oRHYCj_",
    "csvConfig": {
      "assetName": "fl_demo_asset",
      "runName": "fl_demo_run",
      "firstDataRow": 2,
      "timeColumn": {
        "columnNumber": 1,
        "format": "TIME_FORMAT_ABSOLUTE_RFC3339"
      },
      "dataColumns": {
        "2": { "name": "mars_date_time", "dataType": "CHANNEL_DATA_TYPE_STRING" },
        "3": { "name": "sol_number", "dataType": "CHANNEL_DATA_TYPE_STRING" },
        "4": { "name": "max_ground_temp(C)", "dataType": "CHANNEL_DATA_TYPE_DOUBLE", "units": "Celsius" },
        "5": { "name": "min_ground_temp(C)", "dataType": "CHANNEL_DATA_TYPE_DOUBLE", "units": "Celsius" },
        "6": { "name": "max_air_temp(C)", "dataType": "CHANNEL_DATA_TYPE_DOUBLE", "units": "Celsius" },
        "7": { "name": "min_air_temp(C)", "dataType": "CHANNEL_DATA_TYPE_DOUBLE", "units": "Celsius" },
        "8": { "name": "mean_pressure(Pa)", "dataType": "CHANNEL_DATA_TYPE_DOUBLE", "units": "Pa" },
        "9": { "name": "sunrise", "dataType": "CHANNEL_DATA_TYPE_STRING" },
        "10": { "name": "sunset", "dataType": "CHANNEL_DATA_TYPE_STRING" },
        "11": { "name": "UV_Radiation", "dataType": "CHANNEL_DATA_TYPE_STRING" },
        "12": { "name": "weather", "dataType": "CHANNEL_DATA_TYPE_STRING" }
      }
    }
  }'

Placeholders

  • Replace YOUR_REST_API_URL_HERE with your REST API URL obtained in the previous step.
  • Replace YOUR_API_KEY_HERE with your API key obtained in the previous step.
  • Replace fl (in fl_demo_asset and fl_demo_run) with your initials.
A successful response
{
"dataImportId": "string" 
}

View imported data in Sift

Now that we have imported the dataset using the REST API, let's view the imported data in Sift.

  1. In Sift, click .
  2. In the Run name or description box, enter the name of the Run.
  3. Click the name of the Run.

    Asset ID: Before viewing the imported data in Sift, copy and save the Asset ID, as it will be needed in Step 4 to create a Calculated Channel. Hover over the Asset ID field and, in the popup box, click Copy to copy the Asset ID.

    Run ID: Before viewing the imported data in Sift, copy and save the Run ID, as it will be needed in Step 5 to generate a Report. In the Run ID field, click Copy.

  4. Click Explore 2 (Beta).
  5. In the Channels tab, click the following Channels:
    1. min_ground_temp(C)
    2. max_air_temp(C)
    3. max_ground_temp(C)
    4. min_air_temp(C)
    5. weather
Imported data

On this page