Create

Use this API to create new datasets for client onboarding, specifying the dataset's structure, settings, and initial data. This API is particularly useful for automating the setup of datasets during the onboarding process, allowing for easy integration with client-specific data requirements.

For example, use this endpoint to define the columns, types, and other properties for a new dataset tailored to a client's needs.

Create a Dataset

To create a new dataset, follow these steps:

  1. To create a new dataset, make a POST request to /dataset-create with the required parameters in the request body.

  2. To specify the dataset structure, include an array of column definitions with each column's name, alias, type, subtype, and optional format.

  • Type can be:

    • measure

    • dimension

  • Subtype can be:

    • text

    • numeric

    • date

    • datetime

  1. To customize the dataset further, optional parameters such as CSV settings and a description can be included in the request.

The response will include key details about the created dataset, including the dataset code, table name, and the number of columns.

Example Usage

Creating a New Dataset

For example, making a POST request to the following URL with the provided JSON body would result in the response below: Request

POST /dataset-create
Authorization: Bearer YOUR-TENANT-TOKEN

{
  "user-code": "0f02b4d4f9ae",
  "columns": [
    {
      "name": "InvoiceNo",
      "alias": "InvoiceNo",
      "type": "dimension",
      "subtype": "text"
    },
    {
      "name": "StockCode",
      "alias": "StockCode",
      "type": "dimension",
      "subtype": "text"
    },
    {
      "name": "Description",
      "alias": "Description",
      "type": "dimension",
      "subtype": "text"
    },
    {
      "name": "Quantity",
      "alias": "Quantity",
      "type": "measure",
      "subtype": "numeric",
      "format": "#,###.##"
    },
    {
      "name": "InvoiceDate",
      "alias": "InvoiceDate",
      "type": "dimension",
      "subtype": "datetime",
      "format": "Y-d-m H:i:s"
    },
    {
      "name": "UnitPrice",
      "alias": "UnitPrice",
      "type": "measure",
      "subtype": "numeric",
      "format": "#,###.##"
    },
    {
      "name": "CustomerID",
      "alias": "CustomerID",
      "type": "measure",
      "subtype": "numeric",
      "format": "#,###.##"
    }
  ],
  "name": "Client onboarding dataset creation"
}

Response

{
  "data": {
    "dataset-code": "eca2ad3940e3",
    "table-name": "dataset_csv_eca2ad3940e3",
    "columns": 7
  }
}

This request creates a dataset with the specified columns, each having unique names, types, and formats tailored to client onboarding requirements.

Last updated