Geovisualization Developer's Guide

Uploading Data from a URL

As an alternative to uploading a dataset directly from a file via HTTP, you can use the Geovisualization REST API to ingest a file which is available through a URL. This can be useful if the file is very big.

Note: Read this guide for more guidance on the best formatting for the file you upload.

To ingest a file via a URL, you take the following steps.

Create an Empty Dataset

Create an empty dataset with a POST request including your APP_ID, APP_CODE and a name and description in the body:{YOUR_APP_ID}&app_code={YOUR_APP_CODE}
  "name": "Name of your new dataset",
  "description": "Description of your new dataset, can be empty"

You can also use the datasets endpoint in the 04. Datasets CRUD folder of our Postman collection.

You will receive a response body that contains the new dataset ID.
Note: The supported protocols for the URL are HTTP, HTTPS and SFTP. For SFTP, the URL must point to a directory instead of a file. All csv, csv.gz or zip files in that directory are downloaded and added to the dataset. The dataset must have a predefined schema and all files in the directory must conform to it.

Upload the File

POST to the following endpoint with request body as the data source and the dataset ID received in the previous step:{DATASET_ID}?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}          

  "source": {"url":"[URL of your file (or folder for SFTP)]"}
You can also use the datasets/_ID_ endpoint in the 04.1. Dataset Import folder of our Postman collection.

Check Progress of an Upload

Optionally, you can check the progress of the data ingestion by sending a GET to the following resource, where {JOB_ID} is the job ID included in the response of the previous step:{JOB_ID}?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}
You can also use the jobs/_ID_ endpoint in the 10. Dataset Transformations folder of our Postman collection.