Datasets
This document provides information on the API endpoints for the dataset
resource.
The dataset model
The dataset model contains all the information about your datasets, such as their rows, columns and a preview. Datasets are used to train an agent later.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the dataset.
- Name
n_cols
- Type
- string
- Description
The number of columns in a dataset
- Name
n_rows
- Type
- string
- Description
The number of rows in a dataset.
- Name
preview
- Type
- json
- Description
A preview of the dataset.
Retrieve a dataset
This endpoint allows you to retrieve information about a dataset by their dataset id
. Refer to the list at the top of this page to see which datasets exits.
Request
curl https://prophet.devhub.place/v1/datasets/98221581-0519-40cf-a912-48064608f73e \
-H "token: {token}"
Response
{
"id": "98221581-0519-40cf-a912-48064608f73e",
"n_cols": 66,
"n_rows": 8118,
"preview": [
{
"col1": value1,
"col2": value2,
...
},
...
{
"col1": value11,
"col2": value12,
...
}
]
}
Upload a dataset
This endpoint allows you to upload a new dataset to your account. Only csv
files are currently allowed.
Required attributes
- Name
token
- Type
- string
- Description
The access token to your account.
- Name
path
- Type
- string
- Description
The path to the file you want to upload.
Request
curl https://prophet.devhub.place/v1/datasets \
-H "token: {token}" \
-F 'file=@{path}'
Response
{
"preview_file_id": "dc2080b0-186c-4934-a0cb-9121051113f3_preview",
"file_id": "dc2080b0-186c-4934-a0cb-9121051113f3",
"message": "File uploaded successfully"
}
Delete a dataset
This endpoint allows you to delete datasets from your account. Note: This will finally delete you dataset.
Request
curl -X DELETE https://prophet.devhub.place/v1/datasets/98221581-0519-40cf-a912-48064608f73e \
-H "token: {token}"
List all datasets
This endpoint allows you to retrieve a list of all your datasets.
Required attributes
- Name
token
- Type
- string
- Description
The access token to your account.
Request
curl -G https://prophet.devhub.place/v1/datasets \
-H "token: {token}"
Response
{
"datasets": [
{
"id": "98221581-0519-40cf-a912-48064608f73e",
},
...
{
"id": "367ed2e0-0c2f-477d-b8ba-afcde99e57c2"
}
]
}