Media
CRUD
CRUD | Http Verb | Route | Description |
---|---|---|---|
READ | GET | /media/{id} | Retrieve a single Media from it's id |
CREATE | POST | /media | Create a Media |
UPDATE | POST | /media/{id} | Update a Media |
DELETE | DELETE | /media/{id} | Delete a Media |
SEARCH | GET | /media | Looking for Medias |
BATCH DELETE | DELETE | /media | Delete multiple Medias |
Model
WARNING: This Model is the one retrieve using X-API-MODE="get" (see READ & SEARCH operations). So if you use the legacy one (standard), the model may differs on some fields.
CAUTION: Media is an abstract class, so you can't create a Media, you will always have to create an inherited entity of Media.
Field | Type | Readonly | Nullable | Translatable | Description |
---|---|---|---|---|---|
client_id | string | An arbitrary field used to store external identfier to match our own | |||
created_at | datetime(ISO 8601) | Create datetime | |||
description | string | Description | |||
end_at | datetime(ISO 8601) | Media end datetime | |||
id | int | Identifier | |||
name | string | Name | |||
playlists | array | List of Playlists | |||
playlists[] | array | ||||
playlists[].id | Poi#id | Playlist identifier | |||
playlists[].position | int | Media position used to sort medias. The sorting order is descending regarless position, in case of equals positions lower identifier will come first. | |||
pois | array | List of POIs | |||
pois[] | Poi#id | Poi identifier | |||
preview | File#id | Image used as preview | |||
signature | string | Unique optional identifier used to reference that Site to be used in data import | |||
site | Site#id | Site identifier | |||
start_at | datetime(ISO 8601) | Media start datetime | |||
tags | array | List of Tags | |||
tags[] | Tag#id | Tag identifier | |||
type | string | Media discriminator field | |||
updated_at | datetime(ISO 8601) | Last updated datetime | |||
version | int | Revision version, it's incremented on each change |
Discriminator Map
Discriminator Value | Class |
---|---|
image | MediaImage |
movie | Movie |
MediaPdf | |
text | MediaText |
url | MediaUrl |
video | MediaVideo |
MediaImage
Field | Type | Readonly | Nullable | Translatable | Description |
---|---|---|---|---|---|
file | File#id | Image file |
Movie
Field | Type | Readonly | Nullable | Translatable | Description |
---|---|---|---|---|---|
actors | array | List of actors | |||
actors[] | string | ||||
coming_sessions | array | List of coming sessions datetime | |||
coming_sessions[] | datetime(ISO 8601) | ||||
director | string | Director | |||
certification | string | Certification | |||
duration | int | Duration in minutes | |||
file | File#id | Video or Image file |
MediaPdf
Field | Type | Readonly | Nullable | Translatable | Description |
---|---|---|---|---|---|
file | File#id | Pdf file |
MediaText
Field | Type | Readonly | Nullable | Translatable | Description |
---|---|---|---|---|---|
content | string | The content | |||
identifier | string | ||||
format | string | Content format |
MediaUrl
Field | Type | Readonly | Nullable | Translatable | Description |
---|---|---|---|---|---|
link | string | Link url |
MediaVideo
Field | Type | Readonly | Nullable | Translatable | Description |
---|---|---|---|---|---|
file | File#id | Video file |
READ
Parameters
Name | In | Type | Required | Default | Constraint | Description |
---|---|---|---|---|---|---|
id | Route | int | ||||
X-API-LOCALE | Header | string | Site#locale | Must be one of Site#languages | ||
X-API-MODE | Header | string | standard | "standard" or "get" | The "standard" mode is deprecated. Note that X-API-MODE will change serialization format. |
Responses
Http Code | Description | Response type | Response Content | Note |
---|---|---|---|---|
200 | Success | application/json | Media | The Media serialisation will differs depending on X-API-MODE |
400 | Invalid data | application/json | Error | |
403 | Authentication Error | application/json | Error | |
404 | Not Found | |||
500 | Internal Server Error | application/json | Error | |
503 | Service Unavailable |
CREATE
You cannot create a Poi as it's abstract, you must choose an inherited entity.
Parameters
Shared Parameters
Name | In | Type | Nullable | Required | Default | Constraint |
---|---|---|---|---|---|---|
X-API-LOCALE | Header | string | Site#locale | Must be one of Site#languages | ||
client_id | Data | string | null | |||
description | Data | string | null | |||
end_at | Data | datetime(ISO 8601) | null | |||
name | Data | string | Not empty string | |||
playlists | Data | array | [] | |||
playlists[] | Data | object | ||||
playlists[].id | Data | Playlist#id | Valid Playlist#id on same Site | |||
playlists[].position | Data | int | ||||
pois | Data | array | [] | |||
pois[] | Data | Poi#id | Valid Poi#id on same Site | |||
preview | Data | File#id | null | Valid File#id on same Site | ||
signature | Data | string | null | |||
site | Data | int | Valid Site#id | |||
start_at | Data | datetime(ISO 8601) | null | |||
tags | Data | array | [] | |||
tags[] | Data | Tag#id | Valid Tag#id on same site | |||
type | Data | string | One of discriminator value |
MediaImage specific parameters (type="image")
Name | In | Type | Nullable | Required | Default | Constraint |
---|---|---|---|---|---|---|
file | Data | File#id | Valid File#id on same Site |
Movie specific parameters (type="movie")
Name | In | Type | Nullable | Required | Default | Constraint |
---|---|---|---|---|---|---|
actors | Data | array | [] | |||
actors[] | Data | string | ||||
coming_sessions | Data | array | [] | |||
coming_sessions[] | Data | datetime(ISO8601) | ||||
director | Data | string | null | |||
certification | Data | string | null | |||
duration | Data | int | null | |||
file | Data | File#id | null | Valid File#id on same Site |
MediaPdf specific parameters (type="pdf")
Name | In | Type | Nullable | Required | Default | Constraint |
---|---|---|---|---|---|---|
file | Data | File#id | Valid File#id on same Site |
MediaText specific parameters (type="text")
Name | In | Type | Nullable | Required | Default | Constraint |
---|---|---|---|---|---|---|
content | Data | string | null | |||
identifier | Data | string | null | |||
format | Data | string | null |
MediaUrl specific parameters (type="url")
Name | In | Type | Nullable | Required | Default | Constraint |
---|---|---|---|---|---|---|
link | Data | string |
MediaVideo specific parameters (type="video")
Name | In | Type | Nullable | Required | Default | Constraint |
---|---|---|---|---|---|---|
file | Data | File#id | Valid File#id on same Site |