Public share

Load a research compendium by submitting a link to a cloud resource using an HTTP POST request using multipart/form-data.

Currently, the following repositories are supported:

Common

All repositories use the same API endpoint https://…/api/v1/compendium, but with different required/optional parameters.

The upload is only allowed for logged in users.

Required user level and authentication

The user creating a new compendium must have the required user level. Requests must be authenticated with a cookie connect.sid, see user authentication.

To run the load from the command line, login on the website and open you browser cookies. Find a cookie issued by o2r.uni-muenster.de with the name connect.sid. Copy the contents of the cookie into the request example below.

Upon successful download from the public share, the id for the new compendium is returned.

curl -F "content_type=compendium" \
    -F "share_url=https://uni-muenster.sciebo.de/index.php/s/G8vxQ1h50V4HpuA"  \
    --cookie "connect.sid=<code string here>" \
     https://…/api/v1/compendium
200 OK

{"id":"b9Faz"}

Important

After successful load from a public share, the candidate process applies.

Sciebo

Sciebo is a cloud storage service at North Rhine-Westphalian universities. Although it builds on ownCloud and the implementation might be able to handle any ownCloud link, only Sciebo's publish shares are supported by this API.

File selection

Depending on the public share contents different processes are triggered:

  1. If a file named bagit.txt is found, the directory is checked for Bagit validity
  2. If a single zip file is found, the file is extracted, if multiple zip files are found, the filename has to be specified, otherwise an error is returned
  3. If a single subdirectory is found, the loader uses that subdirectory as the base directory for loading
  4. Depending on the value of content_type (see below), the public share contents are treated as a complete compendium or as a workspace

Body parameters for creating compendium from public share

  • share_url - The Sciebo link to the public share (required)
  • content_type - Form of archive. One of the following (required):
    • compendium - complete compendium
    • workspace - formless workspace
  • path - Path to a subdirectory or a zip file in the public share (optional)
    • default is /
    • the leading / is optional, the loader supports both ways
    • when a directory has multiple zip files, the path can be used to specify which file is used, e.g. path=/metatainer.zip

Examples

curl -F "content_type=compendium" \
    -F "share_url=https://uni-muenster.sciebo.de/index.php/s/G8vxQ1h50V4HpuA"  \
    -F "path=/metatainer" \
    --cookie "connect.sid=<code string here>" \
     https://…/api/v1/compendium

Error responses for creating compendium from public share

401 Unauthorized

{"error":"unauthorized: user level does not allow compendium creation"}
403 Forbidden

{"error":"public share host is not allowed"}
422 Unprocessable Entity

{"error":"files with unsupported encoding detected: [{'file':'/tmp/o2r/compendium/ejpmi/data/test.txt','encoding':'Shift_JIS'}]"}

Example data

For testing purposes you can use the following public share, which contains a few ready-to-use compendia:

`https://uni-muenster.sciebo.de/s/G8vxQ1h50V4HpuA

Zenodo

Body parameters for creating a compendium from a Zenodo record

  • Identification of the Zenodo record, one of the folloing is required:
    • share_url - The link to the zenodo record (optional). May be a link to https://zenodo.org or https://doi.org
    • doi - A DOI resolving to the zenodo record (optional)
    • zenodo_record_id - The ID of the zenodo record (optional)
  • content_type - Form of archive. One of the following (required):
    • compendium - complete compendium for inspection
    • workspace - formless workspace for creation
  • filename - Filename of your compendium. For now, only zip-files are supported. (optional)
    • if no filename is provided the first zip file is selected
    • multiple files are currently not supported

There must at least one url parameter that resolves to a zenodo record. I.e. one of the following:

Examples

  1. Zenodo Record URL (with optional filename parameter)
curl -F "content_type=compendium" \
    -F "zenodo_url=https://sandbox.zenodo.org/record/69114"  \
    -F "filename=metatainer.zip" \
    --cookie "connect.sid=<code string here>" \
     https://…/api/v1/compendium
  1. DOI
curl -F "content_type=compendium" \
    -F "doi=10.5072/zenodo.69114"  \
    --cookie "connect.sid=<code string here>" \
     https://…/api/v1/compendium
  1. Zenodo Record ID
curl -F "content_type=compendium" \
    -F "zenodo_record_id=69114"  \
    --cookie "connect.sid=<code string here>" \
     https://…/api/v1/compendium

If the Zenodo record id is supplied through the doi or zenodo_record_id parameter, or if the share_url parameter is a doi.org URL, a default base URL for the file download is used as selected by the API maintainer. This may be:

  • https://zenodo.org or
  • https://sandbox.zenodo.org

Error responses for creating compendium from a Zenodo record

401 Unauthorized

{"error":"unauthorized: user level does not allow compendium creation"}
403 Forbidden

{"error":"host is not allowed"}
422 Unprocessable Entity

{"error":"public share URL is invalid"}
422 Unprocessable Entity

{"error":"DOI is invalid"}
422 Unprocessable Entity

{"error":"files with unsupported encoding detected: [{'file':'/tmp/o2r/compendium/ejpmi/data/test.txt','encoding':'Shift_JIS'}]"}

Example data

For testing purposes you can use the following public shares. They contain the a compendium with metadata.