- Create an access token at "https://zenodo.org/account/settings/applications/tokens/new/" with the "deposit:write" and "deposit:actions" scopes, and keep it somewhere safe (we'll refer to this token as ZENODO_TOKEN)
- Create your deposit via the web interface at "https://zenodo.org/deposit/new", fill in the minimum metadata (title, authors, description, access rights and license) and click "Save".
- On your browser's URL, you will now see the deposit ID in the form "https://zenodo/deposit/".
- Next step is to get the file upload URL. Via curl (or your HTTP client of preference) you can do:
$ # Store the Zenodo token in an envionrment variable
$ read -s ZENODO_TOKEN
$ curl "https://zenodo.org/api/deposit/depositions/222761?access_token=${ZENODO_TOKEN}"
{ ...
"links": { "bucket": "https://zenodo.org/api/files/568377dd-daf8-4235-85e1-a56011ad454b", ... },
... }
- Now you can use the URL from the
links.bucket
field from the response, and perform the following request to upload your file:
# This does a file stream PUT request to the "links.bucket" link
$ curl --upload-file "/path/to/your/file.dat" "https://zenodo.org/api/files/568377dd-daf8-4235-85e1-a56011ad454b/file.dat?access_token=${ZENODO_TOKEN}"
{ ... }
- After the upload has finished, you can click the "Publish" button on the upload's page.
Brief "How-To" Guide for Windows10 uploading data via cURL to Zenodo - from a biologist.
Extends the above: https://gist.github.com/slint/2263b2212743a68b2851b2cb7865675e
CAPITAL_WORDING: refers to things that need to be replaced with YOUR individual ones
Step 1: Create an access token at "https://zenodo.org/account/settings/applications/tokens/new/" with the "deposit:write" and "deposit:actions" scopes.
Make sure you keep it somewhere safe. It is a combination of letters and numbers, something like "sqh791dig345fyuh"
Step 2: If you haven't yet, create your deposit via the web interface at "https://zenodo.org/deposit/new".
Fill in the minimum metadata (title, authors, description, access rights and license).
Click "Save".
On your browser's URL, you will now see the deposit ID in the form "https://zenodo/deposit/ID".
Step 3: Check whether you have cURL (e.g. if you have Git "C:\Program Files\Git\mingw64\bin"; or for Windows check: https://www.addictivetips.com/windows-tips/use-curl-on-windows-10/)
Step 4: Open command line by typing "cmd" into the Windows search. This should open up a command line window.
Step 5: Type "set token=sqh791dig345fyuh" into the cmd to store your token in an environment variable.
i.e. set token=YOUR_TOKEN_HERE
Step 6: Next get deposit information using your token >> "curl "https://zenodo.org/api/deposit/depositions/1234567?access_token=%token%""
i.e. curl "https://zenodo.org/api/deposit/depositions/YOUR_DEPOSIT?access_token=%token%
Step 7: Copy that link and type:
curl --upload-file "/path/to/your/file.dat" "https://zenodo.org/api/files/14b1818f-7449-4e24-b32b-23f0cd449104/file.dat?access_token=%token%"
curl --upload-file "FILEPATH.FILETYPE" "YOUR_BUCKET_LINK/FILEPATH.FILETYPE?access_token=%token%"
Step 8: Your data should now be uploading. Once this is finished, you can upload more data or go back to the Zenodo Browser, check Metadata, and publish the data.
OVERVIEW:
set token=YOUR_TOKEN_HERE
curl "https://zenodo.org/api/deposit/depositions/YOUR_DEPOSIT?access_token=%token%"
curl --upload-file "FILEPATH.FILETYPE" "YOUR_BUCKET_LINK/FILEPATH.FILETYPE?access_token=%token%"