0

I am trying to update json file from local machine to cartodb.I used below command but it is not working. curl -v -F file=@C:/Users/k/Desktop/In/da.json --request "PUT" "https://account-name.cartodb.com/api/v1/synchronizations/Import-ID/sync_now?api_key={API-KEY}"

Is there any specific command for updating data from local machine?

asked May 27, 2015 at 17:17
2
  • PUT? should it be POST? docs.cartodb.com/cartodb-platform/maps-api.html curl -X POST 'https://{account}.cartodb.com/api/v1/map/named/:template_id' -H 'Content-Type: application/json' Commented May 27, 2015 at 17:38
  • Initially I used POST command for uploading data in to cartodb after that I am just trying to replace old data with new data.Every it is creating new file instead of replacing old file. Commented May 27, 2015 at 17:57

1 Answer 1

2

Once you have created a Sync table you cannot update the field from which it's being updated.

Also, a Sync Table cannot be created from a local file. CartoDB needs the file to be publicly accessible in the Internet (or safe inside your Dropbox/GDrive account).

If you already have a Sync Table and you want to force a Sync, just follow the API:

curl -v --request "PUT" "https://{account}.cartodb.com/api/v1/synchronizations/<import_id>/sync_now?api_key={account API Key}" --header "Content-Length:0"

If you have a Sync Table but you want to Sync another file, you'll have to start from the beginning of the process, just creating a new table.

If you have a local file and you want it to be Synced, you can use Dropbox/Google Drive or use the SQL API in order to add your data by pieces in CartoDB tables by using INSERT or UPDATE statements.

This question is very related to yours: Can you force cartoDB to read a file as a synced table

nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
answered May 28, 2015 at 15:18

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.