connect
search

File Markers

Prerequisites

  • An organization

  • Bucket(s)

  • One or more video files

Workflow

Important

All GraphQL queries and mutations related to file markers require the internal ID of the file(s) being operated on.

You must first obtain the internal file IDs with a query such as filesByLocators, including the file id in the response.

Example

Query

query filesByLocators($locators: [FileLocatorInput!]!) {
filesByLocators(locators: $locators) {
id
}
}

Variables

{
"locators": [
{
"type": "S3FileLocator",
"bucket": "my-bucket",
"key": "example/path/my-file.mov"
},
{
"type": "S3FileLocator",
"bucket": "my-bucket",
"key": "example/path/my-other-file.mov"
}
]
}

Response

{
"data": {
"filesByLocators": [
{
"id": "f63a3849-3cf3-4835-be33-6743af08747c"
},
{
"id": "6ff1ee7d-d1e6-429b-81cd-0d07ea42bc9b"
}
]
}
}

Inserting a Single Marker

After obtaining the file IDs, you can insert markers one at a time by using the createMarker mutation.

Example

Mutation

mutation CreateMarker($input: MarkerInput!) {
createMarker(input: $input) {
id
fileId
start
end
type
name
}
}

Variables

{
"input": {
"fileId": "f63a3849-3cf3-4835-be33-6743af08747c",
"start": 0,
"end": 32,
"name": "Marker 1",
"type": "clip"
}
}

Response

{
"data": {
"creatMarker": {
"id": "3e137ef5-e64a-46ce-9fb8-6d3d6f850a0a",
"fileId": "f63a3849-3cf3-4835-be33-6743af08747c",
"start": 0,
"end": 32,
"name": "Marker 1",
"type": "clip"
},
}
}

Inserting Markers in Bulk

To insert or update multiple markers at once, you can use the bulkUpsertMarkers mutation to either insert or update multiple markers for each file.

Example

Mutation

mutation BulkUpsertMarkers($input: [MarkerInput!]!) {
bulkUpsertMarkers(data: $input) {
id
fileId
type
name
start
end
}
}

Variables

{
"input": [
{
"fileId": "f63a3849-3cf3-4835-be33-6743af08747c",
"start": 0,
"end": 61,
"name": "Marker 1",
"type": "clip"
},
{
"fileId": "f63a3849-3cf3-4835-be33-6743af08747c",
"start": 62,
"end": 125,
"name": "Marker 2",
"type": "clip"
},
{
"fileId": "6ff1ee7d-d1e6-429b-81cd-0d07ea42bc9b",
"start": 0,
"end": 32,
"name": "Marker 1",
"type": "clip"
}
]
}

Response

{
"data": {
"bulkUpsertMarkers": [
{
"id": "3e137ef5-e64a-46ce-9fb8-6d3d6f850a0a",
"fileId": "f63a3849-3cf3-4835-be33-6743af08747c",
"start": 0,
"end": 61,
"name": "Marker 1",
"type": "clip"
},
{
"id": "ed033cb2-7ac4-465e-b5f1-067fe473f29e",
"fileId": "f63a3849-3cf3-4835-be33-6743af08747c",
"start": 62,
"end": 125,
"name": "Marker 2",
"type": "clip"
},
{
"id": "b24e5c7d-e9de-419f-8aea-2e3be4018c75",
"fileId": "6ff1ee7d-d1e6-429b-81cd-0d07ea42bc9b",
"start": 0,
"end": 32,
"name": "Marker 1",
"type": "clip"
}
]
}
}

Getting Markers

You can list the markers for a specific file using the markers query.

Example

Query

query Markers($filters: MarkerFilters) {
markers(filters: $filters) {
edges {
node {
id
fileId
start
end
type
name
}
}
}
}

Variables

{
"filters": {
"fileId": {
"eq": "f63a3849-3cf3-4835-be33-6743af08747c"
}
}
}

Response

{
"data": {
"markers": {
"edges": [
{
"node": {
"id": "3e137ef5-e64a-46ce-9fb8-6d3d6f850a0a",
"fileId": "f63a3849-3cf3-4835-be33-6743af08747c",
"start": 0,
"end": 32,
"name": "Marker 1",
"type": "clip"
}
}
]
}
}
}

Updating a Single Marker

You can update the details of an existing marker using the updateMarker mutation.

Example

Mutation

mutation UpdateMarker($id: ID!, $input: MarkerInput!) {
updateMarker(id: $id, input: $input) {
id
start
end
}
}

Variables

{
"id": "3e137ef5-e64a-46ce-9fb8-6d3d6f850a0a",
"input": {
"start": 20,
"end": 45
}
}

Response

{
"data": {
"updateMarker": {
"id": "3e137ef5-e64a-46ce-9fb8-6d3d6f850a0a",
"start": 20,
"end": 45
}
}
}

Deleting a Single Marker

To delete an existing marker, you can use the deleteMarker mutation.

Example

Mutation

mutation DeleteMarker($id: ID!) {
deleteMarker(id: $id) {
id
}
}

Variables

{
"id": "3e137ef5-e64a-46ce-9fb8-6d3d6f850a0a"
}

Response

{
"data": {
"deleteMarker": null
}
}

Deleting Markers in Bulk

To delete multiple markers at once, you can use the deleteMarkers mutation.

Example

Mutation

mutation DeleteMarkers($ids: [ID!]!) {
deleteMarkers(ids: $ids) {
id
}
}

Variables

{
"ids": [
"3e137ef5-e64a-46ce-9fb8-6d3d6f850a0a",
"ed033cb2-7ac4-465e-b5f1-067fe473f29e"
]
}

Response

{
"data": {
"deleteMarkers": null
}
}
Ad Break MarkersCPL Markers