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 | 3 January 2020 | Authorization scheme enhanced |
0.4 | 26 March 2020 | MediaObject - add masterfile ids, derivative ids are actual ids instead of track ids now, structure can be inlined with query param |
Table of Contents
...
Retrieves a subset of the mods for the specified media object
...
(parameter :include_structure specifies if structure should be included in response)
GET /media_objects.json
Retrieves a paged list of media_objects (parameters :page and :per_page specify page number and number per page for pagination)
...
label (optional),
id,
title,
file_location,
file_checksum,
file_size,
duration,
display_aspect_ratio,
original_frame_size,
file_format,
poster_offset,
thumbnail_offset,
date_digitized,
structure (optional): structure xml as a string,
captions(optional): captions text from vtt or srt file as a string,
captions_type (optional): required if captions are present,
other_identifier (multiple),
comment (multiple),
workflow_name,
date_digitized,
files: an array of derivative hashes
...
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 | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "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": "12532-medium26d00ae1-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": "12532-highe87804de-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": "12532-low6cc0e00a-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 | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "mk61rh07c": "{\ "id\":\ "mk61rh07c\",\ "title\":\ "elec1 2882 bug\",\ "collection\":\ "2882 mallorn\",\ "unit\":\ "Indiana University Libraries\",\ "main_contributors\": [],\ "publication_date\": null,\ "published_by\": null,\ "published\": false,\ "summary\": null,\ "visibility\":\ "private\",\ "read_groups\": [],\ "files\": [{\ { "id": "tq57nr13n", "workflow_name\":\ "avalon\",\ "percent_complete\": null,\ "status_code\": null,\ "structure\": null,\ "label\":\ "\",\ "thumbnail_offset\": 2000,\" "poster_offset\": 2000,\ "physical_description\": null,\ "file_location\":\ "/tmp/electricbeat-1.mp4\",\ "file_size\":\ "337659\",\ "duration\":\ "5334\",\ "date_digitized\":\ "2018-03-29T17:59:15Z\",\ "file_checksum\":\ "94000912e0c10c6c668f13dfb0a70072\",\ "file_format\":\ "Moving image\",\ "other_identifier\": [],\ "captions\":\ "WEBVTT\\r\\n\\r\\n1\\r\\n00:00:00.200 --\\u003e> 00:00:02.000\\r\\nTitle frame 1-2 sec\\r\\n\\r\\n2\\r\\n00:00:04.000 --\\u003e> 00:00:05.000\\r\\n4 seconds\",\ "captions_type\":\ "text/vtt\",\ "comment\": [],\ "display_aspect_ratio\":\ "1.3333333333333333\",\ "original_frame_size\":\ "320x240\",\ "width\": 320,\ "height\": 240,\ "files\": [{\"label\":\ { "label": "quality-high\",\ "id\":\"track-8\",\"url\":\ "0b5272fe-b498-47d5-b75f-6c258894296d", "url": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:c9eb28f9-4ef3-4040-9478-1633bfa58b74/e3037981-dd6f-4663-b8b0-adb1c2dc54e2/electricbeat_1\",\ "hls_url\":\ "https://mallorn.dlib.indiana.edu:8980/avalon/c9eb28f9-4ef3-4040-9478-1633bfa58b74/e3037981-dd6f-4663-b8b0-adb1c2dc54e2/electricbeat_1.mp4.m3u8\",\ "duration\":\ "5334\",\ "mime_type\":\ "video/mp4\",\ "audio_bitrate\": null,\ "audio_codec\": null,\"video "video_bitrate\":\ "2000000.0\",\ "video_codec\":\ "AVC\",\ "width\":\ "960\",\ "height\":\ "720\",\ "location\":\ "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:c9eb28f9-4ef3-4040-9478-1633bfa58b74/e3037981-dd6f-4663-b8b0-adb1c2dc54e2/electricbeat_1\",\ "track_id\":\ "track-8\",\ "hls_track_id\":\ "track-11\",\ "managed\": false,\ "derivativeFile\":\ "file:///var/avalon/rtmp_streams/c9eb28f9-4ef3-4040-9478-1633bfa58b74/e3037981-dd6f-4663-b8b0-adb1c2dc54e2/electricbeat_1.mp4\"},{\"label\":\" }, { "label": "quality-medium\",\ "id\":\"track-7\",\"url\":\ "11a94a20-335d-459a-a3d2-042226bc83d4", "url": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:c9eb28f9-4ef3-4040-9478-1633bfa58b74/826b8471-6125-4c88-b332-1026fa27b6aa/electricbeat_1\",\ "hls_url\":\ "https://mallorn.dlib.indiana.edu:8980/avalon/c9eb28f9-4ef3-4040-9478-1633bfa58b74/826b8471-6125-4c88-b332-1026fa27b6aa/electricbeat_1.mp4/index.m3u8\",\ "duration\":\ "5334\",\ "mime_type\":\ "video/mp4\",\ "audio_bitrate\": null,\ "audio_codec\": null,\ "video_bitrate\":\ "1064690.0\",\ "video_codec\":\ "AVC\",\ "width\":\ "640\",\ "height\":\ "480\",\"location\":\", "location": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:c9eb28f9-4ef3-4040-9478-1633bfa58b74/826b8471-6125-4c88-b332-1026fa27b6aa/electricbeat_1\",\ "track_id\":\ "track-7\",\ "hls_track_id\":\ "track-10\",\ "managed\": false,\ "derivativeFile\":\ "file:///var/avalon/rtmp_streams/c9eb28f9-4ef3-4040-9478-1633bfa58b74/826b8471-6125-4c88-b332-1026fa27b6aa/electricbeat_1.mp4\"},{\"label\":\" }, { "label": "quality-low\",\ "id\":\"track-9\",\"url\":\ "7c71553f-8b0d-45ae-a2de-14768f3baeec", "url": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:c9eb28f9-4ef3-4040-9478-1633bfa58b74/10cd97b9-6d32-4196-9e9a-83250308b170/electricbeat_1\",\ "hls_url\":\ "https://mallorn.dlib.indiana.edu:8980/avalon/c9eb28f9-4ef3-4040-9478-1633bfa58b74/10cd97b9-6d32-4196-9e9a-83250308b170/electricbeat_1.mp4/index.m3u8\",\ "duration\":\ "5334\",\ "mime_type\":\ "video/mp4\",\ "audio_bitrate\": null,\ "audio_codec\": null,\ "video_bitrate\":\ "530724.0\",\ "video_codec\":\ "AVC\",\ "width\":\ "480\",\ "height\":\ "360\",\ "location\":\ "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:c9eb28f9-4ef3-4040-9478-1633bfa58b74/10cd97b9-6d32-4196-9e9a-83250308b170/electricbeat_1\",\ "track_id\":\ "track-9\",\ "hls_track_id\":\ "track-12\",\ "managed\": false,\ "derivativeFile\":\ "file:///var/avalon/rtmp_streams/c9eb28f9-4ef3-4040-9478-1633bfa58b74/10cd97b9-6d32-4196-9e9a-83250308b170/electricbeat_1.mp4\"}]}],\"fields\":{\"duration\":\"5334\",\" } ] } ], "fields": { "duration": "5334", "avalon_resource_type\":[\ [ "moving image\" ],\ "avalon_publisher\": null,\ "avalon_uploader\":\ "saidulla@iu.edu\",\ "identifier\": [],\ "title\":\ "elec1 2882 bug\",\ "alternative_title\": [],\ "translated_title\": [],\ "uniform_title\": [],\ "statement_of_responsibility\": null,\ "creator\": [],\ "date_created\": null,\ "date_issued\":\ "1111\",\ "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/mk/61/rh/07/mk61rh07c\" ],\ "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 } }", "sx61dm430": "{\ "id\":\ "sx61dm430\",\ "title\":\ "Luna r642\",\ "collection\":\ "2882 mallorn\",\ "unit\":\ "Indiana University Libraries\",\ "main_contributors\": [],\ "publication_date\": null,\ "published_by\": null,\ "published\": false,\ "summary\": null,\ "visibility\":\ "private\",\ "read_groups\": [],\ "files\": [{\ { "id": "5138jd99j", "workflow_name\":\ "fullaudio\",\ "percent_complete\": null,\ "status_code\": null,\ "structure\": null,\"label\ "label":\ "\",\ "thumbnail_offset\": 0,\ "poster_offset\": 0,\ "physical_description\": null,\ "file_location\":\ "/tmp/Caruso-LunaDestate.mp3\",\ "file_size\":\ "2165531\",\ "duration\":\ "135209\",\ "date_digitized\":\ "2018-04-18T15:09:20Z\",\ "file_checksum\":\ "df20cc5ee6ec04ed63b0d8497e41fbd0\",\ "file_format\":\ "Sound\",\"other "other_identifier\": [],\ "captions\": null,\ "captions_type\": null,\ "comment\": [],\ "display_aspect_ratio\": null,\ "original_frame_size\": null,\ "width\": null,\ "height\": null,\ "files\": [{\"label\":\ { "label": "quality-medium\",\ "id\":\"track-7\",\"url\":\ "adad926d-3cb2-4547-9159-02dd6c85d014", "url": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:d7ffad5f-9c41-4106-94af-99abf055d5d5/9ff00ea7-2652-4087-a630-dc48638d861f/Caruso_LunaDestate\",\ "hls_url\":\ "https://mallorn.dlib.indiana.edu:8980/avalon/d7ffad5f-9c41-4106-94af-99abf055d5d5/9ff00ea7-2652-4087-a630-dc48638d861f/Caruso_LunaDestate.mp4.m3u8\",\ "duration\":\ "135207\",\ "mime_type\":\ "audio/mp4\",\ "audio_bitrate\":\ "124204.0\",\ "audio_codec\":\ "AAC\",\ "video_bitrate\": null,\ "video_codec\":null,\"width\":null,\"height\":null,\"location\":\": null, "width": null, "height": null, "location": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:d7ffad5f-9c41-4106-94af-99abf055d5d5/9ff00ea7-2652-4087-a630-dc48638d861f/Caruso_LunaDestate\",\ "track_id\":\ "track-7\",\ "hls_track_id\":\ "track-9\",\ "managed\": false,\ "derivativeFile\":\ "file:///var/avalon/rtmp_streams/d7ffad5f-9c41-4106-94af-99abf055d5d5/9ff00ea7-2652-4087-a630-dc48638d861f/Caruso_LunaDestate.mp4\"},{\"label\":\" }, { "label": "quality-high\",\ "id\":\"track-6\",\"url\":\ "86452f55-b9d5-4045-a9a9-25a6e6438936", "url": "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:d7ffad5f-9c41-4106-94af-99abf055d5d5/cd18d1ca-870d-48fa-a395-c576efbf4bab/Caruso_LunaDestate\",\ "hls_url\":\ "https://mallorn.dlib.indiana.edu:8980/avalon/d7ffad5f-9c41-4106-94af-99abf055d5d5/cd18d1ca-870d-48fa-a395-c576efbf4bab/Caruso_LunaDestate.mp4/index.m3u8\",\ "duration\":\ "135207\",\ "mime_type\":\ "audio/mp4\",\"", "audio_bitrate\":\ "147344.0\",\ "audio_codec\":\ "AAC\",\ "video_bitrate\": null,\ "video_codec\": null,\ "width\": null,\ "height\": null,\ "location\":\ "rtmp://mallorn.dlib.indiana.edu:1935/avalon/mp4:d7ffad5f-9c41-4106-94af-99abf055d5d5/cd18d1ca-870d-48fa-a395-c576efbf4bab/Caruso_LunaDestate\",\ "track_id\":\"track-6\",\" "track-6", "hls_track_id\":\ "track-8\",\ "managed\": false,\ "derivativeFile\":\ "file:///var/avalon/rtmp_streams/d7ffad5f-9c41-4106-94af-99abf055d5d5/cd18d1ca-870d-48fa-a395-c576efbf4bab/Caruso_LunaDestate.mp4\"}]}],\"fields\":{\"duration\":\"135209\",\" } ] } ], "fields": { "duration": "135209", "avalon_resource_type\":[\ [ "sound recording\" ],\ "avalon_publisher\": null,\ "avalon_uploader\":\ "saidulla@iu.edu\",\ "identifier\": [],\ "title\":\ "Luna r642\",\ "alternative_title\": [],\ "translated_title\": [],\ "uniform_title\": [],\ "statement_of_responsibility\": null,\ "creator\": [],\ "date_created\": null,\ "date_issued\":\ "1212\",\ "copyright_date\": null,\ "abstract\": null,\ "format\":[\ [ "audio/mpeg\" ],\ "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/sx/61/dm/43/sx61dm430\" ],\ "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 | ||||
---|---|---|---|---|
| ||||
curl -H "Avalon-Api-Key:abcdef123456" -X POST -d @data.json -H "Content-type:application/json" -H "Accept:application/json" https://mallorn.dlib.indiana.edu/admin/collections.json |
...