Media Annotations Endpoints¶
Media Annotations API endpoints.
Overview¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/media-resources/{media_resource_id}/annotations/ |
Get Annotations |
| POST | /api/v1/media-resources/{media_resource_id}/annotations/draws |
Create Or Update Draw |
| PUT | /api/v1/media-resources/{media_resource_id}/annotations/draws/{draw_id} |
Update Draw |
| DELETE | /api/v1/media-resources/{media_resource_id}/annotations/draws/{draw_id} |
Delete Draw |
| POST | /api/v1/media-resources/{media_resource_id}/annotations/pins |
Create Pin |
| PATCH | /api/v1/media-resources/{media_resource_id}/annotations/pins/{pin_id} |
Update Pin |
| DELETE | /api/v1/media-resources/{media_resource_id}/annotations/pins/{pin_id} |
Delete Pin |
| POST | /api/v1/media-resources/{media_resource_id}/annotations/pins/{pin_id}/attachments |
Add Pin Attachment |
| DELETE | /api/v1/media-resources/{media_resource_id}/annotations/pins/{pin_id}/attachments/{attachment_resource_id} |
Remove Pin Attachment |
API Reference¶
Sartiq Backend Server - Media Annotations 0.1.0¶
Media Annotations¶
GET /api/v1/media-resources/{media_resource_id}/annotations/¶
Get Annotations
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
context_id |
query | No | |||
context_type |
query | No | |||
media_resource_id |
path | string | No |
Responses
{
"pins": [
{
"id": "71a93a73-1a22-499d-86ed-9b341b840ebe",
"media_resource_id": "0a1b002b-cd86-4ec1-97a1-1cf005da12e8",
"owner_id": "f9c0955f-0f35-4d34-9da8-cb9ee3a5cc3e",
"owner_full_name": null,
"owner_email": null,
"position_x": 10.12,
"position_y": 10.12,
"number": 0,
"note_text": "string",
"context_type": null,
"context_id": null,
"attachments": [
{
"id": "a1fe7e22-c181-4117-84a6-c768c227e97a",
"resource_type": "IMAGE",
"url": "string",
"content_hash": "string",
"extension": "string",
"file_size": 0,
"width": null,
"height": null,
"dominant_color": null,
"protected": true,
"alt_text": null,
"caption": null,
"color_profile": null,
"duration": null,
"aspect_ratio": null,
"orientation": null,
"created_at": "2022-04-13T15:42:05.901Z"
}
],
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z"
}
],
"draws": [
{
"id": "320cdc62-54c8-4708-9c20-2f8b420d2085",
"media_resource_id": "373a12d7-ef21-42f3-b77d-5487579a8fbe",
"owner_id": "2b29151d-06eb-4b1b-b6fa-0e7f573c0f6d",
"owner_full_name": null,
"owner_email": null,
"strokes": [
{
"points": [
{
"x": 10.12,
"y": 10.12,
"pressure": null
}
],
"color": null,
"width": null
}
],
"context_type": null,
"context_id": null,
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z"
}
]
}
Schema of the response body
{
"properties": {
"pins": {
"items": {
"$ref": "#/components/schemas/AnnotationPinPublic"
},
"type": "array",
"title": "Pins",
"default": []
},
"draws": {
"items": {
"$ref": "#/components/schemas/AnnotationDrawPublic"
},
"type": "array",
"title": "Draws",
"default": []
}
},
"type": "object",
"title": "MediaAnnotationsPublic"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
POST /api/v1/media-resources/{media_resource_id}/annotations/pins¶
Create Pin
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
media_resource_id |
path | string | No |
Request body
{
"position_x": 10.12,
"position_y": 10.12,
"note_text": "string",
"context_type": null,
"context_id": null,
"attachments": null
}
Schema of the request body
{
"properties": {
"position_x": {
"type": "number",
"title": "Position X"
},
"position_y": {
"type": "number",
"title": "Position Y"
},
"note_text": {
"type": "string",
"title": "Note Text"
},
"context_type": {
"anyOf": [
{
"$ref": "#/components/schemas/AnnotationContextType"
},
{
"type": "null"
}
]
},
"context_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Context Id"
},
"attachments": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/MediaInput"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Attachments"
}
},
"type": "object",
"required": [
"position_x",
"position_y",
"note_text"
],
"title": "AnnotationPinCreate"
}
Responses
{
"id": "7a8e12c1-24e1-451d-8cce-6e8765c03c40",
"media_resource_id": "7bb2bf2e-08fe-4026-9432-94775dd76b98",
"owner_id": "ddf03272-75ae-4b24-946e-7d1fa1e7eeca",
"owner_full_name": null,
"owner_email": null,
"position_x": 10.12,
"position_y": 10.12,
"number": 0,
"note_text": "string",
"context_type": null,
"context_id": null,
"attachments": [
{
"id": "0fbf651f-46bc-4648-934c-bce636290a03",
"resource_type": "IMAGE",
"url": "string",
"content_hash": "string",
"extension": "string",
"file_size": 0,
"width": null,
"height": null,
"dominant_color": null,
"protected": true,
"alt_text": null,
"caption": null,
"color_profile": null,
"duration": null,
"aspect_ratio": null,
"orientation": null,
"created_at": "2022-04-13T15:42:05.901Z"
}
],
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"media_resource_id": {
"type": "string",
"format": "uuid",
"title": "Media Resource Id"
},
"owner_id": {
"type": "string",
"format": "uuid",
"title": "Owner Id"
},
"owner_full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Full Name"
},
"owner_email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Email"
},
"position_x": {
"type": "number",
"title": "Position X"
},
"position_y": {
"type": "number",
"title": "Position Y"
},
"number": {
"type": "integer",
"title": "Number"
},
"note_text": {
"type": "string",
"title": "Note Text"
},
"context_type": {
"anyOf": [
{
"$ref": "#/components/schemas/AnnotationContextType"
},
{
"type": "null"
}
]
},
"context_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Context Id"
},
"attachments": {
"items": {
"$ref": "#/components/schemas/MediaResourcePublic"
},
"type": "array",
"title": "Attachments",
"default": []
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
}
},
"type": "object",
"required": [
"id",
"media_resource_id",
"owner_id",
"position_x",
"position_y",
"number",
"note_text",
"created_at",
"updated_at"
],
"title": "AnnotationPinPublic"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
PATCH /api/v1/media-resources/{media_resource_id}/annotations/pins/{pin_id}¶
Update Pin
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
pin_id |
path | string | No |
Request body
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the request body
{
"properties": {
"position_x": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Position X"
},
"position_y": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Position Y"
},
"note_text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Note Text"
},
"attachments": {
"anyOf": [
{
"items": {
"$ref": "#/components/schemas/MediaInput"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Attachments"
}
},
"type": "object",
"title": "AnnotationPinUpdate"
}
Responses
{
"id": "a0818de9-c7e5-41ef-a2b4-85b0e29532be",
"media_resource_id": "51cb9b60-6321-490b-bbe6-db315f498965",
"owner_id": "107275be-cf03-41e4-9576-0d6d62a17de4",
"owner_full_name": null,
"owner_email": null,
"position_x": 10.12,
"position_y": 10.12,
"number": 0,
"note_text": "string",
"context_type": null,
"context_id": null,
"attachments": [
{
"id": "06d10b79-9589-45a5-893e-29d71d6f11f7",
"resource_type": "IMAGE",
"url": "string",
"content_hash": "string",
"extension": "string",
"file_size": 0,
"width": null,
"height": null,
"dominant_color": null,
"protected": true,
"alt_text": null,
"caption": null,
"color_profile": null,
"duration": null,
"aspect_ratio": null,
"orientation": null,
"created_at": "2022-04-13T15:42:05.901Z"
}
],
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"media_resource_id": {
"type": "string",
"format": "uuid",
"title": "Media Resource Id"
},
"owner_id": {
"type": "string",
"format": "uuid",
"title": "Owner Id"
},
"owner_full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Full Name"
},
"owner_email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Email"
},
"position_x": {
"type": "number",
"title": "Position X"
},
"position_y": {
"type": "number",
"title": "Position Y"
},
"number": {
"type": "integer",
"title": "Number"
},
"note_text": {
"type": "string",
"title": "Note Text"
},
"context_type": {
"anyOf": [
{
"$ref": "#/components/schemas/AnnotationContextType"
},
{
"type": "null"
}
]
},
"context_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Context Id"
},
"attachments": {
"items": {
"$ref": "#/components/schemas/MediaResourcePublic"
},
"type": "array",
"title": "Attachments",
"default": []
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
}
},
"type": "object",
"required": [
"id",
"media_resource_id",
"owner_id",
"position_x",
"position_y",
"number",
"note_text",
"created_at",
"updated_at"
],
"title": "AnnotationPinPublic"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
DELETE /api/v1/media-resources/{media_resource_id}/annotations/pins/{pin_id}¶
Delete Pin
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
pin_id |
path | string | No |
Responses
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
POST /api/v1/media-resources/{media_resource_id}/annotations/pins/{pin_id}/attachments¶
Add Pin Attachment
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
pin_id |
path | string | No |
Request body
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Responses
{
"id": "e731c63e-58a3-4ab2-b04d-a33e54a38b58",
"resource_type": "IMAGE",
"url": "string",
"content_hash": "string",
"extension": "string",
"file_size": 0,
"width": null,
"height": null,
"dominant_color": null,
"protected": true,
"alt_text": null,
"caption": null,
"color_profile": null,
"duration": null,
"aspect_ratio": null,
"orientation": null,
"created_at": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"resource_type": {
"$ref": "#/components/schemas/MediaResourceType"
},
"url": {
"type": "string",
"title": "Url"
},
"content_hash": {
"type": "string",
"title": "Content Hash"
},
"extension": {
"type": "string",
"title": "Extension"
},
"file_size": {
"type": "integer",
"title": "File Size"
},
"width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Width"
},
"height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Height"
},
"dominant_color": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Dominant Color"
},
"protected": {
"type": "boolean",
"title": "Protected",
"default": false
},
"alt_text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Alt Text"
},
"caption": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Caption"
},
"color_profile": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Color Profile"
},
"duration": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Duration"
},
"aspect_ratio": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Aspect Ratio"
},
"orientation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Orientation"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
}
},
"type": "object",
"required": [
"id",
"resource_type",
"url",
"content_hash",
"extension",
"file_size",
"created_at"
],
"title": "MediaResourcePublic",
"description": "Public output schema for media resources.\n\nThe `url` field contains the full CDN URL resolved from the\ninternal `storage_key`."
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
DELETE /api/v1/media-resources/{media_resource_id}/annotations/pins/{pin_id}/attachments/{attachment_resource_id}¶
Remove Pin Attachment
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
attachment_resource_id |
path | string | No | ||
pin_id |
path | string | No |
Responses
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
POST /api/v1/media-resources/{media_resource_id}/annotations/draws¶
Create Or Update Draw
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
media_resource_id |
path | string | No |
Request body
{
"strokes": [
{
"points": [
{
"x": 10.12,
"y": 10.12,
"pressure": null
}
],
"color": null,
"width": null
}
],
"context_type": null,
"context_id": null
}
Schema of the request body
{
"properties": {
"strokes": {
"items": {
"$ref": "#/components/schemas/DrawStroke"
},
"type": "array",
"title": "Strokes"
},
"context_type": {
"anyOf": [
{
"$ref": "#/components/schemas/AnnotationContextType"
},
{
"type": "null"
}
]
},
"context_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Context Id"
}
},
"type": "object",
"required": [
"strokes"
],
"title": "AnnotationDrawCreate"
}
Responses
{
"id": "237a8181-0d19-4294-87c0-6d013c211cd2",
"media_resource_id": "ab9b1ea5-0982-4068-89d3-3eac3ae02fbe",
"owner_id": "ef41c12f-bd47-4a56-b779-9408a1e5eea6",
"owner_full_name": null,
"owner_email": null,
"strokes": [
{
"points": [
{
"x": 10.12,
"y": 10.12,
"pressure": null
}
],
"color": null,
"width": null
}
],
"context_type": null,
"context_id": null,
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"media_resource_id": {
"type": "string",
"format": "uuid",
"title": "Media Resource Id"
},
"owner_id": {
"type": "string",
"format": "uuid",
"title": "Owner Id"
},
"owner_full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Full Name"
},
"owner_email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Email"
},
"strokes": {
"items": {
"$ref": "#/components/schemas/DrawStroke"
},
"type": "array",
"title": "Strokes"
},
"context_type": {
"anyOf": [
{
"$ref": "#/components/schemas/AnnotationContextType"
},
{
"type": "null"
}
]
},
"context_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Context Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
}
},
"type": "object",
"required": [
"id",
"media_resource_id",
"owner_id",
"strokes",
"created_at",
"updated_at"
],
"title": "AnnotationDrawPublic"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
PUT /api/v1/media-resources/{media_resource_id}/annotations/draws/{draw_id}¶
Update Draw
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
draw_id |
path | string | No |
Request body
Responses
{
"id": "c481eeae-dd97-48fe-9fe9-78d9470655ab",
"media_resource_id": "261afde2-4a88-4788-a677-8dd19a0b326b",
"owner_id": "83b3c053-1683-4795-8312-2b1a98e82b3c",
"owner_full_name": null,
"owner_email": null,
"strokes": [
{
"points": [
{
"x": 10.12,
"y": 10.12,
"pressure": null
}
],
"color": null,
"width": null
}
],
"context_type": null,
"context_id": null,
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"media_resource_id": {
"type": "string",
"format": "uuid",
"title": "Media Resource Id"
},
"owner_id": {
"type": "string",
"format": "uuid",
"title": "Owner Id"
},
"owner_full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Full Name"
},
"owner_email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Email"
},
"strokes": {
"items": {
"$ref": "#/components/schemas/DrawStroke"
},
"type": "array",
"title": "Strokes"
},
"context_type": {
"anyOf": [
{
"$ref": "#/components/schemas/AnnotationContextType"
},
{
"type": "null"
}
]
},
"context_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Context Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
}
},
"type": "object",
"required": [
"id",
"media_resource_id",
"owner_id",
"strokes",
"created_at",
"updated_at"
],
"title": "AnnotationDrawPublic"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
DELETE /api/v1/media-resources/{media_resource_id}/annotations/draws/{draw_id}¶
Delete Draw
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
draw_id |
path | string | No |
Responses
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schemas¶
AnnotationContextType¶
Type: string
AnnotationDrawCreate¶
| Name | Type | Description |
|---|---|---|
context_id |
||
context_type |
||
strokes |
Array<DrawStroke> |
AnnotationDrawPublic¶
| Name | Type | Description |
|---|---|---|
context_id |
||
context_type |
||
created_at |
string(date-time) | |
id |
string(uuid) | |
media_resource_id |
string(uuid) | |
owner_email |
||
owner_full_name |
||
owner_id |
string(uuid) | |
strokes |
Array<DrawStroke> | |
updated_at |
string(date-time) |
AnnotationDrawUpdate¶
| Name | Type | Description |
|---|---|---|
strokes |
Array<DrawStroke> |
AnnotationPinCreate¶
| Name | Type | Description |
|---|---|---|
attachments |
||
context_id |
||
context_type |
||
note_text |
string | |
position_x |
number | |
position_y |
number |
AnnotationPinPublic¶
| Name | Type | Description |
|---|---|---|
attachments |
Array<MediaResourcePublic> | |
context_id |
||
context_type |
||
created_at |
string(date-time) | |
id |
string(uuid) | |
media_resource_id |
string(uuid) | |
note_text |
string | |
number |
integer | |
owner_email |
||
owner_full_name |
||
owner_id |
string(uuid) | |
position_x |
number | |
position_y |
number | |
updated_at |
string(date-time) |
AnnotationPinUpdate¶
| Name | Type | Description |
|---|---|---|
attachments |
||
note_text |
||
position_x |
||
position_y |
DrawStroke¶
| Name | Type | Description |
|---|---|---|
color |
||
points |
Array<StrokePoint> | |
width |
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
MediaAnnotationsPublic¶
| Name | Type | Description |
|---|---|---|
draws |
Array<AnnotationDrawPublic> | |
pins |
Array<AnnotationPinPublic> |
MediaInput¶
| Name | Type | Description |
|---|---|---|
alt_text |
||
caption |
||
color_profile |
||
dominant_color |
||
duration |
||
height |
||
media_resource_id |
||
protected |
boolean | |
url |
||
width |
MediaResourcePublic¶
| Name | Type | Description |
|---|---|---|
alt_text |
||
aspect_ratio |
||
caption |
||
color_profile |
||
content_hash |
string | |
created_at |
string(date-time) | |
dominant_color |
||
duration |
||
extension |
string | |
file_size |
integer | |
height |
||
id |
string(uuid) | |
orientation |
||
protected |
boolean | |
resource_type |
MediaResourceType | |
url |
string | |
width |
MediaResourceType¶
Type: string
PinAttachmentCreate¶
| Name | Type | Description |
|---|---|---|
media_resource_id |
string(uuid) |
StrokePoint¶
| Name | Type | Description |
|---|---|---|
pressure |
||
x |
number | |
y |
number |
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |