Skip to content

Media Drive

Media Drive is a GraphQL-based API for managing files, folders, and media assets. It supports queries (read operations) and mutations (create, update, delete operations).

Operation TypeDescription
QueryRetrieve or list existing media items
MutationCreate, update, move, rename, or delete items

For a full working sample project, see the Media Drive samples on GitHub.

All GraphQL operations are sent as POST requests to:

https://mediadrive-api.unleashlive.com/graphql

All requests require a Bearer token in the Authorization header. We recommend using a Personal Access Token (PAT). See the Authentication page for how to create one.

Authorization: Bearer <YOUR_PAT>

The primary resource returned by queries and mutations.

Fields marked with ! are required.

KeyDescription
IImage
VVideo
MModel
RReport
FLFlight log
DGeneral document
UUndefined type
FieldTypeDescription
isThermalBooleanWhether the file is thermal
hasRadiometricDataBooleanWhether radiometric data exists
minTemperatureFloatMinimum temperature detected
maxTemperatureFloatMaximum temperature detected
calibrationObjectCalibration settings (see Thermal Calibration)
tmapS3PathStringS3 path to the thermal map
FieldTypeDescription
emissivityFloatEmissivity value
reflectedTemperatureFloatReflected temperature
atmosphericTemperatureFloatAtmospheric temperature
humidityFloatHumidity
distanceFloatDistance to subject
transmissivityFloatTransmissivity value
ValueDescription
application/vnd.unleashlive.folderFolder
application/vnd.unleashlive.folderAggregateArchiveAggregate archive folder
application/vnd.unleashlive.folderAggregateResultsAggregate results folder
application/vnd.unleashlive.modelModel wrapper
application/vnd.unleashlive.model.2d2D model
application/vnd.unleashlive.model.3d3D model
application/vnd.unleashlive.model.vrVR model
application/vnd.unleashlive.model.pcPoint Cloud model

The annotations field is a stringified JSON object keyed by add-on ID.

KeyValue
{addonId}Annotation object (see below)
FieldTypeDescription
addonIdStringrequired Add-on identifier
labelsObjectLabel annotations (see Image Labels)
sessionInfoObjectSession information (see Session Info)

A map of label objects keyed by label ID.

KeyValue
{id}Label object (see below)
FieldTypeDescription
titleStringDisplay title
valueString or String[]required Session value
orderStringDisplay order
placeholderStringPlaceholder text

Item references below use the LibraryUpdateInput input type, defined as:

input LibraryUpdateInput {
id: String!
}

The inline-object syntax shown in the examples ({ id: "<ITEM_ID>" }) is equivalent to passing a LibraryUpdateInput value. Use the named type when parameterizing queries or mutations with GraphQL variables.

Fetch a single media item by its ID.

ParameterTypeDescription
itemLibraryUpdateInput!required Reference to the item

For a full working example, see get.js.


Fetch all child items of a known parent folder. The location parameter is the hierarchy path of the parent, constructed by joining the parent’s location and id with /.

If there are more items than the specified limit, the response includes a nextToken object. Pass this token to the next request to fetch the following page.

For a full working example, see list.js.


Move one or more items (including all sub-items) to a new parent folder.

mutation MoveItems {
move(
moveItems: [{ id: "<ITEM_ID>" }]
to: { id: "<DESTINATION_FOLDER_ID>" }
) {
id
parentId
location
}
}
ParameterTypeDescription
moveItems[LibraryUpdateInput!]required Array of item references to move
toLibraryUpdateInput!required Destination folder reference
{
"data": {
"move": [
{
"id": "itemId1",
"parentId": "itemId11",
"location": "teamId1/itemId11"
}
]
}
}

For a full working example, see move.js.


Rename a single media item.

mutation RenameItems {
rename(item: { id: "<ITEM_ID>" }, newName: "New name") {
id
}
}
ParameterTypeDescription
itemLibraryUpdateInput!required Reference to the item
newNameString!required The new name for the item
{
"data": {
"rename": {
"id": "itemId1"
}
}
}

For a full working example, see rename.js.


Delete one or more items, including all sub-items.

mutation DeleteItems {
delete(deleteItems: [{ id: "<ITEM_ID_1>" }, { id: "<ITEM_ID_2>" }]) {
deleteItems {
id
}
ownerId
}
}
ParameterTypeDescription
deleteItems[LibraryUpdateInput!]required Array of item references to delete
{
"data": {
"delete": {
"deleteItems": [{ "id": "itemId1" }, { "id": "itemId2" }],
"ownerId": "userId1"
}
}
}

For a full working example, see delete.js.


File uploads use the AWS S3 SDK directly, not the GraphQL endpoint. The file is uploaded to the S3 upload bucket with metadata that links it to a Media Drive location.

KeyDescription
locationHierarchy path for the upload (e.g. teamId1/folderId1)
parentIdParent folder ID (deprecated — use location)
nameDisplay name for the media item
deviceidDevice ID to associate with the item

For a full working upload example, see upload.js.


Files are downloaded from the Media Drive CDN using the item’s s3Path.

CDN Base URL

https://library.unleashlive.com

Construct the download URL by appending the s3Path to the CDN base URL:

https://library.unleashlive.com/<s3Path>
  1. Query or list items to obtain the s3Path of the desired file.
  2. Construct the full URL: https://library.unleashlive.com/{s3Path}.
  3. Perform an HTTPS GET request to download the file.

For a full working download example, see download.js.