Data Submission Flows
Submitting Datasets to the Dataset Exchange API
There are two options for submitting datasets through the Dataset Exchange API:
-
One for those with dataset files at existing pre-signed URLS
-
One for users who want to request a pre-signed URL where they can upload a dataset file
These flows are available after Authentication to the Dataset Exchange API is completed.
Option 1A dataset in JSON or CSV format is already available at a pre-signed URL to load into the Dataset Exchange API.
If datasets (formatted as either JSON or CSV) are already available via a pre-signed URL available via AWS S3 or GCP Cloud Storage, it can be loaded directly to the Dataset Exchange API:
-
Hit
POST /datasetsto create the new dataset in DDx API's database and define the schema. -
Once an
idis returned for the newly created dataset in the response body of Step 1, hitPOST /datasets/:id/records:loadwith the pre-signed URL in the body of the request. -
Done!
Option 2:If not already available, request a pre-signed URL to load a dataset into the Dataset Exchange API.
To load a dataset to a pre-signed UR, request an upload URL from the Dataset Exchange API.
In order to generate a pre-signed URL and load a dataset:
-
Hit
POST /datasetsto create the new dataset in our database and define the schema. -
Once an
idis returned for the newly created dataset in the response body of Step 1, hitPOST /datasets/:id/uploadUrlwith a string specifying the content type of the dataset. Content type options are CSV or JSON. The/uploadUrlendpoint will return a pre-signed URL to a GCS bucket where the dataset can be loaded. Please note pre-signed URLs are only valid for 1 hour. -
Load the dataset to the pre-signed URL received in Step 2.
-
Done!
AboutrecordCountThe
recordCounton a dataset (for example fromGET /datasets/:id) is a pre-deduplication count. It counts every row written to the dataset, including superseded versions of a record and rows marked as deleted. As a result:
- Loading records with a primary key that already exists adds to
recordCountrather than replacing the earlier version.- Deleting records does not decrease
recordCount.recordCountcan be larger than the number of unique, live records in the dataset.The deduplicated set (latest version per primary key, with deletes removed) is what is delivered downstream and on retrieval, not
recordCount.
Questions? We're here to help! Reach out to us at [email protected].
Updated 5 days ago

