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 /datasetsendpoint.

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 ParameterDescriptionNote
:idPassed 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 ParametersDescriptionNote
?mode=replaceReplaces all existing records for the given dataset ID with the new records being uploadedOptional
?mode=createReturns an error when attempting to upload records to a non-empty dataset. Default upon creation.Default, Optional

Parameters

ParameterTypeDescriptionNote
contentTypestringOptions 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"
}