Link relation aa:update-time-based

Overview

Modify a layer of time-based annotation.

HTTP method

PATCH

Creates and updates segments:

  • The given segments are updated if they exist, or created if they don’t exist.

  • Segments that are not given in the body stay as they are.

PUT

Replaces the segments of the given layers:

  • The given segments are updated if they exist, or created if they don’t exist.

  • Segments that are not given in the body, are deleted.

URL template parameters

-

Query parameters

-

Request body

An aa:time-based resource with one or more layers. Example:

{
    "layers": [
        {
            "name": "EDITORIAL_CONTENT",
            "segments": [
                {
                    "id": "42",
                    "start": 10,
                    "duration": 20,
                    "attributes": [
                        {
                            "name": "SEGMENT_DESCRIPTION",
                            "value": "Lukas Podolski scores"
                        }
                    ]
                }
			]
		}
	]
}
  • When used with the HTTP method PATCH, the given segment is updated if it exists, or created if it doesn’t exist. All other segments stay as they are.

  • When used with the HTTP method PUT, the layer EDITORIAL_CONTENT will contain only the given segment. All other segments will be deleted.

  • Both operations allow to leave the "id" property for individual segments away. In this case, new ids are created automatically.

HTTP response

200 OK

Response body

A bare JSON object (i.e. not a "full" aa:time-based resource) reflecting the PATCHed/PUT layers and segments in the order they where passed. If segment ids were created, those will be present in the response as well.

{
    "layers": [
        {
            "name": "TEST_STRATUM_TYPES",
            "segments": [
                {
                    "id": "5",
                    "start": 50,
                    "duration": 10
                },
                {
                    "id": "4",
                    "start": 40,
                    "duration": 25
                },
                {
                    "id": "6",
                    "start": 60,
                    "duration": 10
                }
            ]
        }
    ]
}

Available in

Description

Modify a layer of time-based annotation.

The behavior depends on the HTTP verb used when calling the link.

  • PATCH: Existing segments are updated, non-existing segments are created. Segments that are not mentioned in the body are left untouched.

  • PUT: Replace the existing segments with the given segments. Existing segments are updated, non-existing segments are created. Segments that are not mentioned in the body are deleted.