Documentation

POSTing files using our upload tool

We provide a Java program that performs file uploads (via HTTPS POST) to Crossref. This program allows you to upload a single file, a list of files, or a whole directory of files.

To use, download crossref-upload-tool.jar and place it in /usr/local/lib.

How to use our upload tool

In the following examples:

  • user is the username and password from your Crossref account credentials. If you are using organization-wide shared role credentials, the username is the role. If you’re using personal user credentials, the username is your email address plus the role in the following format email@address.com/role.
  • file is the name of the file you are uploading or
  • directory is the name of the directory containing files to upload

To upload a metadata file

java -jar crossref-upload-tool.jar --user [username] [password] --metadata ([filename/directory])

Using role credentials (note: in these examples, we have used the fictional role and password combination of mrcrossref and abc134):

java -jar crossref-upload-tool.jar --user mrcrossref abc134 --metadata crdeposit234.xml

Using user credentials (note: in these examples, we have used the fictional user credential, role, and password combination of: email@address.com/role, mrcrossref, and abc134)

java -jar crossref-upload-tool.jar --user email@address.com/mrcrossref abc134 --metadata crdeposit234.xml

To upload a resource-only deposit file

java -jar crossref-upload-tool.jar --user [username] [password] --resources ([filename/directory])

for example:

java -jar crossref-upload-tool.jar --user mrcrossref abc134 --metadata cr_refs.xml

To upload conflict files

Single file:

java -jar crossref-upload-tool.jar --user mrcrossref abc134 --conflicts ticket1234.txt

Directory of files:

java -jar crossref-upload-tool.jar --user mrcrossref abc134 --conflicts ALIAS_123

To upload bulk Resource URL updates

Single file:

java -jar crossref-upload-tool.jar -user mrcrossref abc 134 -transfers ticket1234.text

Directory of files:

java -jar crossref-upload-tool.jar -user mrcrossref abc134 -transfer ALIAS_123

To direct upload(s) to the test system

If you don’t already have Crossref test system credentials configured, you’ll need to contact our technical support team in order for us to enable a test account for test.crossref.org.

java -jar crossref-upload-tool.jar --user mrcrossref abc134 --host test.crossref.org --metadata crdeposit234.xml

Dry run (test)

Note that if the –metadata option is given a directory name instead of a filename then all files within the directory are uploaded. To ensure that you are uploading what you want use the –dry-run option and review the listing of files, eg:

java -jar crossref-upload-tool.jar --user mrcrossref abc134 --metadata mydeposits/ --dry-run

Additional info

If your upload is successful, you will see this message:

[…] INFO uploading to https://doi-crossref-org.turing.library.northwestern.edu/
[…] INFO uploading submission: file=myfile.xml
[…] INFO uploaded submission: file=myfile.xml
[…] INFO done

If the username is wrong, you will see the message:

[…] INFO uploading to https://doi-crossref-org.turing.library.northwestern.edu/
[…] INFO uploading submission: file=myfile.xml
[…] INFO unauthorized: file=myfile.xml; user=mrcrossref
[…] INFO done

Upload options

--user name password
--metadata ( file | directory )
--query ( file | directory )
--transfers ( file | directory )
--handles ( file | directory )
--resources ( file | directory )
--conflicts ( file | directory )
--address host port
--protocol ( http | https )
--dry-run
--help

Where:

  • user: your Crossref system username (either role, for role credentials, or email@address.com/role, for user credentials) and password
  • metadata: use for metadata deposits
  • query: use for query deposits
  • transfers: admin use only
  • handles: admin use only
  • resources: resource-only deposits
  • conflicts: conflict resolution files
  • address: direct to a different address (such as test.crossref.org)
  • protocol: http or https
  • dry-run: test uploader without uploading
  • help: displays the above list of upload options

Further examples

Entry into terminal

java -jar /usr/local/crossref-upload-tool.jar --user mrcrossref abc134 --metadata /Users/mistercrossref/Uploader/September/19/134/

Key for entry into terminal:

  • usr/local/crossref-upload-tool.jar = location of the upload program on your machine
  • mrcrossref abc134 = Crossref role and password you are using for upload
  • metadata = type of content being uploaded
  • Users/mistercrossref/Uploader/September/19/134/ = location of XML files on my machine being uploaded

Page owner: Isaac Farley   |   Last updated 2024-January-22