-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zenodo API communication error creating draft: FORBIDDEN #26
Comments
Just ran it successfully in the Zenodo sandbox with
And it created a new record at https://sandbox.zenodo.org/record/1010558 . Could you try with a token with Also I am soon migrating to https://github.com/zenodraft/zenodraft , which does what this library can do and more. |
Below a few notes on how you could do this with zenodraft (also uses cffconvert to generate the metadata from a # check a few versions
$ node --version
v14.17.4
$ npm --version
6.14.14
# install the zenodraft tool from npm
$ npm install -g zenodraft
# enable bash autocomplete (optional steps)
$ TMPFILE=$(mktemp)
$ zenodraft-autocomplete > $TMPFILE
$ source $TMPFILE
# add the access token to the terminal as an environment variable
$ source ~/tokens/sandbox.zenodo.org
# get a local copy of an arbitrary example zip file
$ wget https://sandbox.zenodo.org/record/1010558/files/sverhoeven/justatest-v0.1.0.zip
# create a new draft deposition in a new collection on zenodo sanbox
$ zenodraft --sandbox deposition create in-new-collection
1011183
# add the zip file to the deposition 1011183
$ zenodraft --sandbox file add 1011183 justatest-v0.1.0.zip
# get an arbitrary metadata file
$ wget https://sandbox.zenodo.org/record/1010558/files/CITATION.cff
# zenodraft doesnt understand CITATION.cff but you can use a tool called cffconvert to
# generate zenodo json metadata from CITATION.cff. So download cffconvert from PyPI:
$ python3 -m pip install --user cffconvert
# generate a metadata file called .zenodo.json from CITATION.cff
$ cffconvert -f zenodo > .zenodo.json
# update metadata of the draft deposition
$ zenodraft --sandbox metadata update 1011183 .zenodo.json
# inspect the draft deposition on zenodo sandbox, if everything looks good, either click
# "Publish" on Zenodo Sandbox, or
# publish the deposition on Zenodo Sandbox
$ zenodraft --sandbox deposition publish 1011183 The resulting record on Zenodo Sandbox is here https://sandbox.zenodo.org/record/1011183 |
Trying to use the CLI tool, but getting the following message.
I have a draft deposit created, and the generated a personal access token with all 3 possible permissions (deposit:actions, deposit:write, user:email) for the tool to use.
Deposition 5767867 is a draft, with no file and the version currently set to 0.0.1.
The text was updated successfully, but these errors were encountered: