POST /datasets/:id/uploadUrl
Description
Generate a pre-signed URL for dataset upload. The ID of the dataset for upload is returned in response body of the POST /datasets
endpoint.
Pre-signed URLs are only valid for 1 hour.
This endpoint should be used if you do NOT have a dataset (JSON or CSV) available at a pre-signed URL.There are 2 options for submitting datasets -- check out the two flows here.
Path Parameters
Path Parameter | Description | Note |
---|---|---|
:id | Passed through the URL path. This ID belongs to the dataset you intend to upload and can be found in the response body after dataset definition in POST /datasets . | Required |
Query Parameters
Query Parameters | Description | Note |
---|---|---|
?mode=replace | Replaces all existing records for the given dataset ID with the new records being uploaded | Optional |
?mode=create | Returns an error when attempting to upload records to a non-empty dataset. Default upon creation. | Default, Optional |
Parameters
Parameter | Type | Description | Note |
---|---|---|---|
contentType | string | Options are "csv" or "json" | Required |
URL Structure
https://app.movementinfrastructure.org/api/v1/datasets/:id/uploadUrl
Or, if you specify query parameters:
https://app.movementinfrastructure.org/api/v1/datasets/:id/uploadUrl?mode={mode}
Example Request Body
{
"contentType": "csv"
}
Example Response Body
{
"datasetId": "812e3xam4-5678-91ple-abdc-312692jk2lm",
"url": "https://storage.googleapis.com/example-dxapi-bucket-name/gotv.csv?X-Goog-Algorithm=GOOG4-RSA-SHA256",
"jobId": "a11167ex-334a-432m-89p1-l459ee8a33b2"
}
Updated about 1 month ago
What’s Next