26.3.0 26.2.0 26.1.0 25.4.0 25.3.0
26.3.0 26.2.0 26.1.0 25.4.0 25.3.0

x19512 API

You can use the x19512 API to preserve, retrieve, and delete content with ETSI TS 119 512, the European standard protocol for long-term preservation services. A preservation object (PO) is a file or a metadata document. The POs that you preserve together become one package in the archive, and their POID is the package ID.

An x19512 call reports its outcome in the response body, not in the HTTP status. Most calls return 200 OK, also when the request fails, and the result object in the body tells you what happened.

The archive supports four operations of the standard: RetrieveInfo, PreservePO, RetrievePO, and DeletePO. UpdatePOC, RetrieveTrace, ValidateEvidence, and Search aren't available.

Each operation is a POST with a JSON body, under the path prefix /x19512/. Every call needs the headers in Common headers and an access token, as described in Authentication.

Required role: any valid access token, for every operation. Package permissions still apply. To preserve content, the account must be able to add content to the archive. To retrieve or delete a package, it needs access to that package.

Read the result of a call

Every response has a result object:

Field

Type

Description

maj

string

The result major code: did the call succeed, and if not, whose fault was it.

min

string

The result minor code: the reason, when the call didn't succeed.

msg

object

A message with more detail, with a value and a lang. Only for some results.

The major code is one of these:

  • urn:oasis:names:tc:dss:1.0:resultmajor:Success: the call worked.

  • urn:oasis:names:tc:dss:1.0:resultmajor:RequesterError: something in your request is wrong or not supported.

  • urn:oasis:names:tc:dss:1.0:resultmajor:ResponderError: the archive couldn't handle the request.

  • urn:oasis:names:tc:dss:1.0:resultmajor:InsufficientInformation: the call partly worked. RetrievePO uses it when it returns the files but not the evidence.

The minor codes are the URIs of the standard, such as http://uri.etsi.org/19512/error/unknownPOID. Each operation lists the ones that it can return.

When a call fails before it gets to the operation, for example because the token is missing or something unexpected went wrong, you get an HTTP error status with a {code, message} body instead. To handle these, go to Errors. If Docbyte turned the API off for your archive, every call gets a 500 error like this one.

JSON
{
  "code": "EXCEPTION",
  "message": "Internal server error. Error id: 0b7e3c55-1f4a-4d2e-9c8b-6a5f4e3d2c1b"
}

Get profile information

RetrieveInfo returns the details of a preservation profile: which operations it supports, and which formats each operation accepts and returns. Use it to find the format IDs to put in a PreservePO or RetrievePO request.

POST /x19512/RetrieveInfo

Body fields:

Name

Type

Required

Description

reqId

string

No

Your own ID for the request. The response sends it back.

pro

string

Yes

The profile ID. The profile IDs are the urn values from the archive profiles in the Admin API.

stat

string

No

active or all.

JSON
{
  "reqId": "req-0001",
  "pro": "urn:example:profiles:hr-records-1.0"
}

Response: 200 OK with the result, your reqId, and a pro list that holds the Profile.

Minor codes that you can get:

  • http://uri.etsi.org/19512/error/notSupported: stat isn't active or all.

Preserve objects

You send one or more POs with PreservePO, and the archive makes one new package of them.

POST /x19512/PreservePO

Body fields:

Name

Type

Required

Description

reqId

string

No

Your own ID for the request. The response sends it back.

pro

string

Yes

The ID of the profile for the package.

po

array of PO

Yes

The objects to preserve. Each one needs id, formatId, and binaryData.

Each PO's formatId decides what it becomes in the package:

  • The namespace of a metadata schema that the archive knows, such as http://purl.org/dc/elements/1.1/ for Dublin Core: the PO becomes descriptive metadata of the package.

  • A format that the profile accepts for PreservePO: the PO becomes a representation of the package, with the PO's id as its name.

If a formatId is both, the PO becomes metadata.

JSON
{
  "reqId": "req-0002",
  "pro": "urn:example:profiles:hr-records-1.0",
  "po": [
    {
      "id": "contract.pdf",
      "formatId": "http://uri.example.com/formats/pdf",
      "mimeType": "application/pdf",
      "binaryData": {
        "value": "JVBERi0xLjcKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFI+PgpzdHJlYW0K"
      }
    },
    {
      "id": "dc.xml",
      "formatId": "http://purl.org/dc/elements/1.1/",
      "mimeType": "application/xml",
      "binaryData": {
        "value": "PG1ldGFkYXRhPjxkYzp0aXRsZT5Db250cmFjdDwvZGM6dGl0bGU+PC9tZXRhZGF0YT4="
      }
    }
  ]
}

Response: 200 OK with the result, your reqId, and the poId of the new package.

JSON
{
  "reqId": "req-0002",
  "result": {
    "maj": "urn:oasis:names:tc:dss:1.0:resultmajor:Success"
  },
  "poId": "uuid-9d2f4b6a-3c1e-4a8b-b7d5-0e6f1a2c3b4d"
}

The call returns as soon as the archive has your content. The ingest continues in the background, and until it finishes, RetrievePO answers with unknownPOID.

Minor codes that you can get:

  • http://uri.etsi.org/19512/error/parameterError: two POs have the same id.

  • http://uri.etsi.org/19512/error/POFormatError: a PO's formatId isn't a known metadata schema and isn't a format that the profile accepts.

  • http://uri.etsi.org/19512/error/internalError: the archive couldn't build the package.

Retrieve a preserved object

RetrievePO returns the files of a package, its evidence record, or both.

POST /x19512/RetrievePO

Body fields:

Name

Type

Required

Description

reqId

string

No

Your own ID for the request. The response sends it back.

poId

string

Yes

The package ID, as returned by PreservePO.

sor

string

No

What to retrieve: PO for the files, Evidence for the evidence record, or POwithDetachedEvidence for both.

poFormat

string

No

The format ID that the response reports for the files. The files themselves are returned as stored. It must be a format that the profile returns for RetrievePO. Default: the profile's default format.

evFormat

string

No

The format ID for the evidence record. It must be an evidence format of the profile. Default: the profile's default evidence format.

versionId

array of strings

No

Not supported: retrieving older versions isn't available.

optIn

object

No

To pick representations, put their names in optIn.other, each as {"val": "<representation name>"}. Without it, you get the package's first representation.

JSON
{
  "reqId": "req-0003",
  "poId": "uuid-9d2f4b6a-3c1e-4a8b-b7d5-0e6f1a2c3b4d",
  "sor": "POwithDetachedEvidence"
}

Response: 200 OK with the result, your reqId, and po: a list of PO objects.

  • Each file has the id <representation name>/<index>, for example contract.pdf/0.

  • The evidence record has the id metadata/preservation/evidence.4998.bin.

Minor codes that you can get:

  • http://uri.etsi.org/19512/error/unknownPOID: there's no package with this poId, or its ingest hasn't finished yet.

  • http://uri.etsi.org/19512/error/notSupported: sor is POwithEmbeddedEvidence or missing, or you sent a versionId.

  • http://uri.etsi.org/19512/error/unknownPOFormat: the profile doesn't return poFormat.

  • http://uri.etsi.org/19512/error/unknownEvidenceFormat: the profile doesn't have evFormat.

  • http://uri.etsi.org/19512/error/parameterError, with the message Representation not found: a representation in optIn doesn't exist in the package.

  • http://uri.etsi.org/19512/error/internalError, with the message Evidence not available: with sor set to Evidence, the package has no evidence record yet.

  • http://uri.etsi.org/19512/warning/requestOnlyPartlySuccessful, with the major code InsufficientInformation and the message Evidence not available. Returning only POs: with POwithDetachedEvidence, you get the files, but the package has no evidence record yet.

Delete a preserved object

DeletePO deletes a package from the archive.

POST /x19512/DeletePO

Body fields:

Name

Type

Required

Description

reqId

string

No

Your own ID for the request. The response sends it back.

poId

string

Yes

The package ID.

mod

string

No

The deletion mode. Only SubDOsAndEvidence is supported, and it's the default.

JSON
{
  "reqId": "req-0004",
  "poId": "uuid-9d2f4b6a-3c1e-4a8b-b7d5-0e6f1a2c3b4d"
}

Response: 200 OK with the result and your reqId.

Minor codes that you can get:

  • http://uri.etsi.org/19512/error/unknownPOID: there's no package with this poId.

  • http://uri.etsi.org/19512/error/notSupported: mod is a mode other than SubDOsAndEvidence.

If the archive refuses to delete the package, you get an HTTP error with a {code, message} body instead.

Schemas

PO

A preservation object, in a request or a response.

Field

Type

Description

id

string

The object's name. In a PreservePO request, each id must be unique.

formatId

string

The format ID: a metadata schema namespace, or a format from the profile.

mimeType

string

The MIME type of the content.

binaryData

object

The content, Base64-encoded, in its value field.

Profile

The preservation profile, as RetrieveInfo returns it. The fields follow ETSI TS 119 512. These are the ones you need most:

Field

Type

Description

pid

string

The profile ID.

op

array

The operations that the profile supports, each with its name, such as PreservePO, and its input (in) and output (out) parameters.

ef

array

The evidence formats, each with fid and def.

Each parameter in in and out lists its formats in form. In each format, fid is the format ID, and def is true for the default. So the formats that PreservePO accepts are at op[].in[].form[].fid.