Deposit API

API for data deposit.

Not a complete implementation of but conform to the Sword3 specification:

[Sword 3.0]
SWORD 3.0 Specification.
Contents

URL Schemes

File-URL
{scheme}://{server}/deposit/{repository}/{identifier}/file/**
FileSet-URL
{scheme}://{server}/deposit/{repository}/{identifier}/fileSet
Metadata-URL
{scheme}://{server}/deposit/{repository}/{identifier}/metadata
Object-URL
{scheme}://{server}/deposit/{repository}/{identifier}
Service-URL
{scheme}://{server}/deposit/{repository}

Requests

1. Retrieve the Service Document

GET {scheme}://{server}/deposit/{repository}

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#1.

Example Request
GET /api.ka3.uni-koeln.de/deposit/{repository} HTTP/1.1
Host: api.ka3.uni-koeln.de  
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

2. Creating New Objects

2.1. Creating Objects with only Metadata

POST {scheme}://{server}/deposit/{repository}

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#2.1.

Example Request
POST /api.ka3.uni-koeln.de/deposit/{repository} HTTP/1.1
Host: api.ka3.uni-koeln.de 
Content-Type: application/json 
Content-Disposition: attachment; metadata=true
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

{
  "@context": "https://swordapp.github.io/swordv3/swordv3.jsonld",
  "@id": "",
  "@type" : "Metadata",
  "dc:title" : "Some title",
  "dcterms:abstract": "Some abstract"
}
Implementation Specifics

2.2. Creating Objects with only By-Reference Files

POST {scheme}://{server}/deposit/{repository}

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#2.2.

Example Request
POST /api.ka3.uni-koeln.de/deposit/{repository} HTTP/1.1
Host: api.ka3.uni-koeln.de 
Content-Type: application/json 
Content-Disposition: attachment; by-reference=true
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

{
  "@context" : "https://swordapp.github.io/swordv3/swordv3.jsonld",
  "@type" : "ByReference",
  "byReferenceFiles" : [
    {
      "@id": "https://uni-koeln.sciebo.de/s/RnL6h6q4nVZ3i24/download",
      "contentType": "application/zip",
      "contentDisposition": "attachment; filename=testdata.zip",
      "packaging": "http://purl.org/net/sword/packaging/SimpleZip",
      "dereference": true,
      "contentLength": 0,
      "contentDisposition": "",
      "digest": ""
    }
  ]
  }
Implementation Specifics

2.3. Creating Objects with both Metadata and By-Reference Files

POST {scheme}://{server}/deposit/{repository}

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#2.3.

Example Request
POST /api.ka3.uni-koeln.de/deposit/{repository} HTTP/1.1
Host: api.ka3.uni-koeln.de 
Content-Type: application/json 
Content-Disposition: attachment; metadata=true; by-reference=true
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

{
  "metadata": {
    "@context": "https://swordapp.github.io/swordv3/swordv3.jsonld",
    "@type": "Metadata",
    "dc:title" : "Some title",
    "dcterms:abstract": "Some abstract"
  },
  "by-reference": {
    "@context": "https://swordapp.github.io/swordv3/swordv3.jsonld",
    "@type": "ByReference",
    "byReferenceFiles": []
  }
}
Implementation Specifics

3. Retrieving all or part of Objects

3.1. Retrieving an Object's Status

GET {scheme}://{server}/deposit/{repository}/{identifier}

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#3.1.

Example Request
GET /api.ka3.uni-koeln.de/deposit/{repository}/{identifier} HTTP/1.1
Host: api.ka3.uni-koeln.de  
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

3.2. Retrieving the Metadata from an Object

GET {scheme}://{server}/deposit/{repository}/{identifier}/metadata

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#3.2.

Example Request
GET /api.ka3.uni-koeln.de/deposit/{repository}/{identifier}/metadata HTTP/1.1
Host: api.ka3.uni-koeln.de  
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

3.3. Retrieving a Binary File from an Object

GET {scheme}://{server}/deposit/{repository}/{identifier}/file/**

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#3.3.

Example Request
GET /api.ka3.uni-koeln.de/deposit/{repository}/{identifier}/file/** HTTP/1.1
Host: api.ka3.uni-koeln.de  
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

5. Replacing all or part of existing Objects

5.1. Replacing the Metadata of an Object

PUT {scheme}://{server}/deposit/{repository}/{identifier}/metadata

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#5.1.

Example Request
PUT /api.ka3.uni-koeln.de/deposit/{repository} HTTP/1.1
Host: api.ka3.uni-koeln.de 
Content-Type: application/json 
Content-Disposition: attachment; metadata=true
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

{
  "@context": "https://swordapp.github.io/swordv3/swordv3.jsonld",
  "@id": "https://api.ka3.uni-koeln.de/deposit/a5-1/9b67fab2-d6b7-4155-801b-4cc19278c6b6/metadata",
  "@type" : "Metadata",
  "dc:title" : "Some title",
  "dcterms:abstract": "Some abstract"
}

5.5. Replacing the FileSet of an Object with By-Reference Files

PUT {scheme}://{server}/deposit/{repository}/{identifier}/fileSet

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#5.5.

Example Request
PUT /api.ka3.uni-koeln.de/deposit/{repository} HTTP/1.1
Host: api.ka3.uni-koeln.de 
Content-Type: application/json 
Content-Disposition: attachment; by-reference=true
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

{
  "@context" : "https://swordapp.github.io/swordv3/swordv3.jsonld",
  "@type" : "ByReference",
  "byReferenceFiles" : [
    {
      "@id": "https://uni-koeln.sciebo.de/s/RnL6h6q4nVZ3i24/download",
      "contentType": "application/zip",
      "contentDisposition": "attachment; filename=testdata.zip",
      "packaging": "http://purl.org/net/sword/packaging/SimpleZip",
      "dereference": true,
      "contentLength": 0,
      "contentDisposition": "",
      "digest": ""
    }
  ]
  }
Implementation Specifics

6. Deleting all or part of Objects

6.3. Deleting all the Files from an Object

DELETE {scheme}://{server}/deposit/{repository}/{identifier}/fileSet

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#6.3.

Example Request
DELETE /api.ka3.uni-koeln.de/deposit/{repository}/{identifier}/fileSet HTTP/1.1
Host: api.ka3.uni-koeln.de  
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...

6.4. Deleting the entire Object

DELETE {scheme}://{server}/deposit/{repository}/{identifier}

See: https://swordapp.github.io/swordv3/swordv3-behaviours.html#6.4.

Example Request
DELETE /api.ka3.uni-koeln.de/deposit/{repository}/{identifier} HTTP/1.1
Host: api.ka3.uni-koeln.de  
Authorization: Bearer eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00if...