POST /datasets/:id/records:load

Description

Load file from a pre-existing, pre-signed URL of a JSON or CSV file. This API call must provide a pre-signed URL and will likely be from AWS S3 or GCP Cloud Storage

🚧

This endpoint is for users with a pre-existing URL. If you need to generate a pre-signed URL to upload a dataset, please see the POST /uploadUrl endpoint.

Path Parameters

Path ParameterDescriptionNote
: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 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

URL Structure

https://app.movementinfrastructure.org/api/v1/datasets/:id/records:load

Or, if you specific query parameters:

https://app.movementinfrastructure.org/api/v1/datasets/:id/records:load?mode={mode}

Example Request Body

{ 
  "url": "https://storage.googleapis.com/my-own-url-not-a-mig-requested-url/gotv_texas.csv?X-Goog-Algorithm=GOOG4-RSA-SHA111"
}

Example Response Body

{ 
  "datasetId": "812e3xam4-5678-91ple-abdc-312692jk2lm",
  "url": "https://storage.googleapis.com/my-own-url-not-a-mig-requested-url/gotv_texas.csv?X-Goog-Algorithm=GOOG4-RSA-SHA111",
  "jobId": "12023400-123b-5678-1234-121201220110"
}