Debugging the DataCite API.
- Clone this repo.
- Make a local copy of the example config:
cp -nvT -- example-config.rc config.rc
- Set password-worthy permissions on your local config file:
chmod a=,u=rw -- config.rc
- Edit your local config (
config.rc
), set test parameters, save.DC_DOI_PREFIX
is treated as a dumb string that knows nothing about the DOI standard's notion of "prefix" and "suffix".
- Install
jq
, the command-line JSON processor .- Alternatively, set
JSON_INDENTER
in your config to a command that reads JSON from stdin and prints prettier JSON to stdout.
- Alternatively, set
<doi>
is the DOI you want to work on, or/
(just a slash) if you want to use theDC_DEFAULT_DOI
from your config. Either way, yourDC_DOI_PREFIX
will be added in front.<key>
is the attribute you want to change to<val>
.- If both are empty or missing, only the
doi
attribute will be sent. This can be used to create a blank new draft, or to query the current DOI information without changes. - If
<val>
doesn't look like a JSON value, the script will attempt a very simplistic conversion to a JSON string. While this is sufficient for very simple values, it's always safer to provide proper JSON as<val>
.
- If both are empty or missing, only the
Upload a custom payload from a JSON file.
./putdoi.sh / publicationYear 2024
./putdoi.sh / creators '[{"nameType":"Personal","name":"Josiah S. Carberry"}]'
./putdoi.sh / titles '[{"title":"Debugging the DataCite API"}]'
./putdoi.sh / rightsList '[]'
- Needs more/better tests and docs.
ISC