Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
A lightweight API for indexing metadata and links to existing derivatives into Avalon.  
Version
Date
Description
0.1
13 October 2015
Initial Draft
0.2
16 December 2015
API as implemented
0.3
(Avalon 7.0)
3 January 2020
Authorization scheme enhanced
status_code, percent_complete, percent_succeeded, and percent_failed fields removed from Media Object parameters
0.4
(Avalon 7.1)
26 March 2020
MediaObject - add masterfile ids, derivative ids are actual ids instead of track ids now, structure can be inlined with query param
Collection items are proper JSON instead of JSON strings

Table of Contents 

Anchor
access control
access control
Access Control

...

PUT /media_objects/:id.json

Updates an media object

DELETE /media_objects/:id.json

Deletes a media object


Parameters for POST and PUTS:

...

If true, fields must include value for :bibliographic_id and may include value from controlled vocabulary for :bibliographic_id_label)
Bib import failure will result in a JSON response: {errors: ['Bib import failed', e.message]}, status: 422

replace_masterfiles (optional boolean):

...

Code Block
languagebash
titleGET /media_objects/:id.json
curl -H 'Avalon-Api-Key:abcdef123456' https://mallorn.dlib.indiana.edu/media_objects/1g05fb83r.json


Code Block
languagejs
titleExample Response
collapsetrue
{
  "id": "1g05fb83r",
  "title": "Test",
  "collection": "7.0 testing",
  "unit": "Default Unit",
  "main_contributors": [],
  "publication_date": null,
  "published_by": null,
  "published": false,
  "summary": null,
  "visibility": "private",
  "read_groups": [],
  "files": [
    {
      id: "1c18df984",
      "workflow_name": "avalon",
      "percent_complete": "100.0",
      "status_code": "COMPLETED",
      "structure": null,
      "label": "",
      "thumbnail_offset": 2000,
      "poster_offset": 2000,
      "physical_description": null,
      "file_location": "/srv/avalon/Archiver_spool/avalon/1c18df984-SampleVideo.mp4",
      "file_size": "1055736",
      "duration": "5312",
      "date_digitized": "2019-12-10T18:33:41Z",
      "file_checksum": null,
      "file_format": "Moving image",
      "other_identifier": [],
      "captions": null,
      "captions_type": null,
      "comment": [],
      "display_aspect_ratio": "1.7777777777777777",
      "original_frame_size": "1280x720",
      "width": 1280,
      "height": 720,
      "files": [
        {
          "label": "quality-medium",
          "id": "26d00ae1-44b9-4306-a310-158b3e39a7c5",
          "url": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-medium",
          "hls_url": "https://mallorn.dlib.indiana.edu:8980/avalon/ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-medium.mp4/index.m3u8",
          "duration": 5336,
          "mime_type": null,
          "audio_bitrate": 128078,
          "audio_codec": "mp4a-40-2",
          "video_bitrate": 1500000,
          "video_codec": "avc1",
          "width": "1280.0",
          "height": "720.0",
          "location": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-medium",
          "track_id": "12532-medium",
          "hls_track_id": null,
          "managed": false,
          "derivativeFile": "file:///srv/avalon/rtmp_streams/ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-medium.mp4"
        },
        {
          "label": "quality-high",
          "id": "e87804de-916b-40f9-aa28-69b8ce6dbcb4",
          "url": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-high",
          "hls_url": "https://mallorn.dlib.indiana.edu:8980/avalon/ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-high.mp4/index.m3u8",
          "duration": 5336,
          "mime_type": null,
          "audio_bitrate": 192000,
          "audio_codec": "mp4a-40-2",
          "video_bitrate": 3000000,
          "video_codec": "avc1",
          "width": "1280.0",
          "height": "720.0",
          "location": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-high",
          "track_id": "12532-high",
          "hls_track_id": null,
          "managed": false,
          "derivativeFile": "file:///srv/avalon/rtmp_streams/ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-high.mp4"
        },
        {
          "label": "quality-low",
          "id": "6cc0e00a-eaf4-4fb7-9be6-64772a5b258a",
          "url": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-low",
          "hls_url": "https://mallorn.dlib.indiana.edu:8980/avalon/ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-low.mp4/index.m3u8",
          "duration": 5336,
          "mime_type": null,
          "audio_bitrate": 128078,
          "audio_codec": "mp4a-40-2",
          "video_bitrate": 500000,
          "video_codec": "avc1",
          "width": "852.0",
          "height": "480.0",
          "location": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-low",
          "track_id": "12532-low",
          "hls_track_id": null,
          "managed": false,
          "derivativeFile": "file:///srv/avalon/rtmp_streams/ececa279-0217-45b4-92fb-daf49d552f33/outputs/SampleVideo-low.mp4"
        }
      ]
    }
  ],
  "fields": {
    "duration": "5312",
    "avalon_resource_type": [
      "moving image"
    ],
    "avalon_publisher": null,
    "avalon_uploader": "archivist1@example.com",
    "identifier": [],
    "title": "Lease Test",
    "alternative_title": [],
    "translated_title": [],
    "uniform_title": [],
    "statement_of_responsibility": null,
    "creator": [],
    "date_created": null,
    "date_issued": "2020",
    "copyright_date": null,
    "abstract": null,
    "format": [
      "video/mp4"
    ],
    "resource_type": [],
    "contributor": [],
    "publisher": [],
    "genre": [],
    "subject": [],
    "geographic_subject": [],
    "temporal_subject": [],
    "topical_subject": [],
    "terms_of_use": null,
    "table_of_contents": [],
    "physical_description": [],
    "record_identifier": [
      "http://127.0.0.1:8984/fedora4/rest/1g/05/fb/83/1g05fb83r"
    ],
    "comment": [],
    "bibliographic_id": null,
    "bibliographic_id_label": null,
    "note": null,
    "note_type": null,
    "language": null,
    "related_item_url": null,
    "related_item_label": null,
    "other_identifier": null,
    "other_identifier_type": null,
    "rights_statement": null
  }
}

...

Code Block
languagejs
titleExample Response
collapsetrue
{"id":"f4752h024"}


Code Block
languagebash
titleDELETE /media_objects/:id.json
curl -H 'Avalon-Api-Key:abcdef123456' -X DELETE https://mallorn.dlib.indiana.edu/media_objects/1g05fb83r.json


Code Block
languagexml
titleExample Response
collapsetrue
<html><body>You are being <a href="http://localhost:3000/">redirected</a>.</body></html>


Anchor
collections
collections
Admin Collection

...