- 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.
After being confused by the instructions above, I wrote yet another description of the procedure ...
The command syntax below is for the csh/tcsh shells under Unix/Linux.
In a command line shell, move to the directory holding the files to upload.
At https://zenodo.org/account/settings/applications/tokens/new/ create an "access token" with the "deposit:write" and "deposit:actions" scopes. Save the token in your notes, and in an environment variable, e.g.
setenv ZENODO_TOKEN kLbOoMwEiDZDdfLOJ6oJX4UlQS4fwyzjWxTA9ZTcSCsBh3Ti7QC1LtqfFGbp
At https://zenodo.org/deposit/new fill in the required fields (red) for a new upload in the usual way:
Press the Save button, then look for a 7-digit "deposit ID" at the end of the URL shown in that browser window. Save that ID in your notes and in an environment variable, e.g.
setenv DEPOSIT_ID 8371329
In the shell where you've defined those environment variables, run the following curl query:
curl "https://zenodo.org/api/deposit/depositions/${DEPOSIT_ID}?access_token=${ZENODO_TOKEN}"
In the long string returned by that query, look for a URL following the word "bucket", and save that URL in your notes and in an environment variable, e.g.
setenv UPLOAD_URL "https://zenodo.org/api/files/dcabeb90-3791-462d-ae83-d29dd2f32e4e"
Use your shell's looping mechanism to upload a list of files, e.g.
For my unreliable Internet connection, the
--retry 12 --retry-all-errors
options were absolutely required.Confirm that all files were uploaded:
curl "https://zenodo.org/api/deposit/depositions/${DEPOSIT_ID}/files?access_token=${ZENODO_TOKEN}"
AFTER EVERYTHING IS UPLOADED, press the Publish button on the upload page created in step #2.
My experience has been that once an Zenodo archive has been published, another upload attempt with curl will fail, with the message:
{"status": 403, "message": "Bucket is locked for modifications."}
Within the first 30 days, Zenodo Support can help you make modifications to a published archive.