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": "2c57f3fc-4af4-4816-b934-01c84e80ca13",
"media_resource_id": "16d76bc6-c02e-457a-89cc-8bebf45fe9e6",
"owner_id": "205ab8ea-bd1d-4626-9b12-2ba77bf4729a",
"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": "39864b29-70c5-41b6-b14a-b493bcab9232",
"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": "8af3c55a-6467-4d9c-86b0-594d0c3bee8d",
"media_resource_id": "9fccf5e6-5cf4-4cdc-8885-7adf0c6852b5",
"owner_id": "5fc1f878-7aae-4a3f-be0b-18aca37d97f1",
"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": "1381002d-9f61-4fa0-a7df-8bb7d612984c",
"media_resource_id": "226c9f80-93f3-414d-bbe0-e74ce2713df8",
"owner_id": "402f72b4-e334-4d69-9725-d8cb4e271569",
"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": "d83678d2-b152-43b5-81f9-1daecb28ca85",
"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": "f553c4c7-7b1c-4085-9dd9-e29988b6b491",
"media_resource_id": "20e980fa-6764-47c5-90ed-1774938d2627",
"owner_id": "7eb48ec9-121f-4a94-bb1f-2671bc17c4b5",
"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": "05ebc16e-51cf-47b7-82e0-351a1a3c8c08",
"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": "3130d9ad-3cac-4c09-8b45-647ab5a7f02f",
"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": "c80e60b7-2743-4970-a2e8-8ad64d3965e8",
"media_resource_id": "72f3b367-e202-4314-a11b-373abcc88002",
"owner_id": "b3668d35-6d3e-4b86-b660-013d8492ab7d",
"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": "9b631c18-e722-4d29-ade0-5e82ce752602",
"media_resource_id": "70a8f48a-623c-4484-b68c-d44b01342b6a",
"owner_id": "702ef34e-7e30-4d44-bca1-cf0a5e163bac",
"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 |