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 thePOST /uploadUrl
endpoint.
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 |
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"
}
Updated about 1 month ago