MediaElement
A "MediaElement" describes the "primary data" of a resource/asset/file. It points to the location where the resource's bits are stored or served. In practice, it is an element available and loadable in a browser such as a jpeg file or a mp4 stream (reminder: in the Adways environment, a "Media" is made of one or more "MediaElement"; those "MediaElement" can then be used as thumbnails or any other formats related to this unique media).
Fields
| Field | Description | Required |
|---|---|---|
| location | The URL that serves the data. | YES |
| mime | The mime type (ex.: image/jpeg). | NO |
| width | The width in pixel unit. For 2D resources (such as images or videos). | NO |
| height | The height in pixel unit. For 2D resources (such as images or videos). | NO |
| ratio | The "width / height" ratio. For 2D resources (such as images or videos). | NO |
| size | Resource file payload, in byte unit. As an exemple, useful to monitor the loading progression. | NO |
| duration | The duration in second unit. For "timed" resources (such as musics or videos). | NO |
| framerate | NO | |
| bitrate | NO | |
| min_bitrate | NO | |
| max_bitrate | NO | |
| buffer_size | NO |
POST /media-element
Request
EndPoint
https://services.adways.com/media-element
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.media-element.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.media-element.v1+json
application/json |
Body
{
"location": "URL path",
"mime": "Mime type (ex.: image/jpeg)",
"width": "size in px",
"height": "size in px",
"ratio": "ex.: 1.777777",
"size": "In Octets",
"duration": "In seconds"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 400: Client Error
- 422: Unprocessable Entity
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.media-element.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
GET /media-element[/:media_element_id]
Request
EndPoint
https://services.adways.com/media-element[/:media_element_id]
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.media-element.v1+json
application/hal+json
application/json |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.media-element.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
PATCH /media-element[/:media_element_id]
Request
EndPoint
https://services.adways.com/media-element[/:media_element_id]
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.media-element.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.media-element.v1+json
application/json |
Body
{
"location": "URL path",
"mime": "Mime type (ex.: image/jpeg)",
"width": "size in px",
"height": "size in px",
"ratio": "ex.: 1.777777",
"size": "In Octets",
"duration": "In seconds"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.media-element.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
PUT /media-element[/:media_element_id]
Request
EndPoint
https://services.adways.com/media-element[/:media_element_id]
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.media-element.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.media-element.v1+json
application/json |
Body
{
"location": "URL path",
"mime": "Mime type (ex.: image/jpeg)",
"width": "size in px",
"height": "size in px",
"ratio": "ex.: 1.777777",
"size": "In Octets",
"duration": "In seconds"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.media-element.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
DELETE /media-element[/:media_element_id]
Request
EndPoint
https://services.adways.com/media-element[/:media_element_id]
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.media-element.v1+json
application/hal+json
application/json |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 204: No Content
- 404: Not Found
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.media-element.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |