Overview

The Archivematica Storage Service API is documented on the following page. I tried using some of these APIs, and this is a memo of my experience.

https://www.archivematica.org/en/docs/archivematica-1.13/dev-manual/api/api-reference-storage-service/

If basic authentication is required, please use the following credentials:

  • Username: demo
  • Password: Nd4Ev3XJ

PACKAGE

A package is a bundle of one or more files transferred from an external service; for example, a package may be an AIP, a backlogged transfer, or a DIP. Each package is stored in a location.

You can view the list of AIPs and DIPs from the following URL. By default, data was returned in XML format, but by adding format=json, data could be downloaded in JSON format.

http://18.215.157.75:8001/api/v2/file/?format=json

{
  "meta": {
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null,
    "total_count": 2
  },
  "objects": [
    {
      "current_full_path": "/var/archivematica/sharedDirectory/www/AIPsStore/8dfd/b901/9cb1/44be/bfde/e872/15df/9813/test-8dfdb901-9cb1-44be-bfde-e87215df9813.7z",
      "current_location": "/api/v2/location/b9661f20-63fa-4843-98aa-05f8c6228c1e/",
      "current_path": "8dfd/b901/9cb1/44be/bfde/e872/15df/9813/test-8dfdb901-9cb1-44be-bfde-e87215df9813.7z",
      "encrypted": false,
      "misc_attributes": {

      },
      "origin_pipeline": "/api/v2/pipeline/e395113a-2885-4163-bf5a-a2786dad948e/",
      "package_type": "AIP",
      "related_packages": [
        "/api/v2/file/65f81712-399b-4edb-a1a7-1b841a738fc1/"
      ],
      "replicas": [

      ],
      "replicated_package": null,
      "resource_uri": "/api/v2/file/8dfdb901-9cb1-44be-bfde-e87215df9813/",
      "size": 61495776,
      "status": "UPLOADED",
      "uuid": "8dfdb901-9cb1-44be-bfde-e87215df9813"
    },
    {
      "current_full_path": "/var/archivematica/sharedDirectory/www/DIPsStore/65f8/1712/399b/4edb/a1a7/1b84/1a73/8fc1/test-8dfdb901-9cb1-44be-bfde-e87215df9813",
      "current_location": "/api/v2/location/f403aa21-749c-4d93-b71e-b95635d8ce14/",
      "current_path": "65f8/1712/399b/4edb/a1a7/1b84/1a73/8fc1/test-8dfdb901-9cb1-44be-bfde-e87215df9813",
      "encrypted": false,
      "misc_attributes": {

      },
      "origin_pipeline": "/api/v2/pipeline/e395113a-2885-4163-bf5a-a2786dad948e/",
      "package_type": "DIP",
      "related_packages": [
        "/api/v2/file/8dfdb901-9cb1-44be-bfde-e87215df9813/"
      ],
      "replicas": [

      ],
      "replicated_package": null,
      "resource_uri": "/api/v2/file/65f81712-399b-4edb-a1a7-1b841a738fc1/",
      "size": 30175868,
      "status": "UPLOADED",
      "uuid": "65f81712-399b-4edb-a1a7-1b841a738fc1"
    }
  ]
}

Let’s access the resource with package_type set to AIP.

http://18.215.157.75:8001/api/v2/file/8dfdb901-9cb1-44be-bfde-e87215df9813?format=json

{
  "current_full_path": "/var/archivematica/sharedDirectory/www/AIPsStore/8dfd/b901/9cb1/44be/bfde/e872/15df/9813/test-8dfdb901-9cb1-44be-bfde-e87215df9813.7z",
  "current_location": "/api/v2/location/b9661f20-63fa-4843-98aa-05f8c6228c1e/",
  "current_path": "8dfd/b901/9cb1/44be/bfde/e872/15df/9813/test-8dfdb901-9cb1-44be-bfde-e87215df9813.7z",
  "encrypted": false,
  "misc_attributes": {

  },
  "origin_pipeline": "/api/v2/pipeline/e395113a-2885-4163-bf5a-a2786dad948e/",
  "package_type": "AIP",
  "related_packages": [
    "/api/v2/file/65f81712-399b-4edb-a1a7-1b841a738fc1/"
  ],
  "replicas": [

  ],
  "replicated_package": null,
  "resource_uri": "/api/v2/file/8dfdb901-9cb1-44be-bfde-e87215df9813/",
  "size": 61495776,
  "status": "UPLOADED",
  "uuid": "8dfdb901-9cb1-44be-bfde-e87215df9813"
}

Adding /download/ as a path parameter allowed downloading the AIP tar file.

http://18.215.157.75:8001/api/v2/file/8dfdb901-9cb1-44be-bfde-e87215df9813/download/?format=json

Summary

By effectively utilizing the above APIs, it should be possible to integrate Archivematica with other systems (such as Omeka S). I plan to continue investigating this.