1

I would like to import a csv file to my Carto account using R. I know the csv has been generated, and I'm able to save it in other locations.

Running the code to upload this file to Carto appears to be successful (see success message below), yet I'm unable to find/retrieve the csv in my carto account.

Here is the code I'm using to import my csv:

apiurl <- "https://"MY ACCOUNT".carto.com/api/v1/imports/?api_key= "MY API KEY"

inputFile <- "MyFile.csv"

writeLines(inputFile)

resp<-POST(apiurl, body=upload_file("MyFile.csv"), encode="multipart")
content(resp)

I'm pretty sure the code I'm using is correct, since it generates this message:

content(resp)
$item_queue_id
[1] "(a unique alphanumeric string) "

$success
[1] TRUE

... but where is my csv?

  • Could you share a sample/dummy data similar to the one you are importing? If the problem persists, please send an email to support@carto.com (disclaimer: I work at CARTO). – ramiroaznar Feb 28 at 8:35
  • @ramiroaznar I'd be happy to! Here is a link to a data set I manually added to Carto: wisc.carto.com/u/widell/dataset/cartoinput_aus. Does that provide enough information for you to work with? – SydWidell Mar 4 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.