Upload A File

Upload a single file to a dataset.

Method

PUT /uploads/{owner}/{id}/files/{name}

Parameters

Parameter Description Parameter Type Data Type
owner Dataset owner username. Included in data.world dataset URL path, after domain.
For example, jonloyens in https://data.world/jonloyens/an-intro-to-dataworld-dataset
path string
id Dataset id. Included in data.world dataset URL, after owner's username.
For example, an-intro-to-dataworld-dataset in https://data.world/jonloyens/an-intro-to-dataworld-dataset
path string
name Name of file to upload, including extension. path string

Response schema (Status 200)

{
  "message": "string"
}

Errors

HTTP Status Code Reason Solution
400 Bad request. Check syntax and URIs.
401 Unauthorized Verify credentials / API key
403 Forbidden
404 Not found.
413 Upload too large.
422 Bad request. Check syntax and URIs.
500 Server error.

EXAMPLE

Request URL:

https://api.data.world/v0/uploads/jonloyens/an-intro-to-dataworld-dataset/files/DataDotWorld2017BBallTeam.csv

cURL:

$ export DW_API_TOKEN=<your api token goes here>
# The curl '--upload-file' option will append the filename to the url, per the curl documentation.
$ curl "https://api.data.world/v0/uploads/jonloyens/an-intro-to-dataworld-dataset/files/" \
--upload-file DataDotWorld2017BBallTeam.csv -H "Authorization: Bearer ${DW_API_TOKEN}"

Where DataDotWorld2017BBallTeam.csv references a locally stored file to upload.

Response Body:

{
  "message": "File uploaded."
}

results matching ""

    No results matching ""