In the following sections, you will find more details about the Dataset API.
Use this API to populate an existing dataset with new data. This API allows you to insert or append rows of data into a pre-defined dataset, making it useful for updating client data during onboarding or other data integration tasks.
For example, use this endpoint to fill a dataset with transactional data, customer information, or any other structured data relevant to your client's needs.
Fill a Dataset
To populate a dataset, follow these steps:
Make a POST request to /dataset-fill
with the required parameters in the request body.
Include the user-code
and dataset-code
to identify the dataset and the user making the request.
Define the structure of the data by specifying the columns
parameter, which includes details like column names, aliases, types, subtypes, and optional formats.
Provide the data to be inserted via the insert-data
parameter.
If compressed
is false
, the data should be formatted as a JSON-escaped string.
If compressed
is true
, the data should be base64-encoded after being gzipped.
Example of insert-data
with JSON (when compressed: false
):
Optionally, use the append
parameter to indicate whether to append the data to the existing dataset (true
) or truncate the dataset before inserting the new data (false
).
Optionally, use the compressed
parameter to specify if the data is gzip compressed (true
) or not (false
).
Example Usage
Filling a Dataset with Base64-encoded Data
For example, making a POST request to the following URL with the provided JSON body would result in the response below:
Response
The response will confirm the status of the operation, including the dataset code and the number of rows inserted. Sample Python Code: Convert CSV Data to a Base64 Encoded String
This Python script reads data from a CSV file, converts it to JSON, compresses it using gzip, and encodes it as a Base64 string, ready to be sent via API requests.
Use the encoded string saved in the file for your JSON request.
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:
To create a new dataset, make a POST request to /dataset-create
with the required parameters in the request body.
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
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
Response
This request creates a dataset with the specified columns, each having unique names, types, and formats tailored to client onboarding requirements.
The /dataset-complete endpoint is designed to signal the end of the dataset insertion process. Once all batches have been inserted via the /dataset-fill endpoint, this method should be called to trigger the final dataset shape calculation and any other necessary post-processing steps.
user-code (string): Unique code identifying the user.
dataset-code (string): A unique code for the dataset, if pre-defined.
To populate a dataset, follow these steps:
Make a POST request to /dataset-complete
with the required parameters in the request body.
Include the user-code
and dataset-code
to identify the dataset and the user making the request.
For example, making a POST with following header included into request with the provided JSON body would result in the response below:
Header
Request
Response