-
Using MacOSX.
-
Open your browser and log in your CartoDB account.
-
Get your API key:
2a) Click on your "user-->Your API keys" option. (Up-right section)
2b) Copy your api key (you can click on the icon).
-
Open your terminal (bash).
-
We are going to use cURL and this command:
curl -F file=@/path/file.csv "https://{{account}}.cartodb.com/api/v1/imports/?api_key={{api_key}}&type_guessing=false"
4a) Get the path file you want to upload and replace it in the last command. Example: file=@/Users/jaimechapinal/workspace/datasets/test_import_2.csv
4b) Replace your name account in {{account}} section. Example: https://xatpy.cartodb.com/
4c) Replace your API key (you got it in the second step). Example (please, note it is a fake id): api_key=ab444afbbbb11165b237c3a4c37fadbb7fddc111
4d) Final example:
curl -F file=@/Users/jaimechapinal/workspace/datasets/test_import_2.csv "https://xatpy.cartodb.com/api/v1/imports/?api_key=ab444afbbbb11165b237c3a4c37fadbb7fddc111&type_guessing=false"
-
Press Enter.
-
If it was OK, you'll see the following message in your console (with another id):
{"item_queue_id":"74872d0b-13e5-4b5b-812b-ae1770260d78","success":true}%
- Now you can check in your dashboard that you have your data without guessing (so all fields are strings).