GET /services/content/v1/ad/[slug]
Description
Use this API to get the ad definition for the specified item. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
break_id | string | An identifier used to group ad breaks together. |
time_offset | string | Specifies when the ad occurs. Can be “start”, “end”, or a time offset, e.g. “00:05:12.744” |
override_ad_tag | string | The VAST tag that overwrites the default VAST tag. If this is null the default VAST tag is used. |
Examples
Request the Ad Definition for Film 71
curl -i 'https://store.shift72.com/services/content/v1/ad/film/71' \
-H 'x-auth-token: 1a95b58722d5ac829ba3db8a79bbc24f'
Response: Success
HttpStatus: 200
[
{
"break_id":"preroll",
"time_offset":"start",
"override_ad_tag":null
}
]
Response: Unauthorized
HttpStatus: 401
PUT /services/content/v1/ad/[slug]
Description
Use this API to update the ad definition for the specified item. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
break_id | string | An identifier used to group ad breaks together. |
time_offset | string | Specifies when the ad occurs. Can be “start”, “end”, or a time offset, e.g. “00:05:12.744” |
override_ad_tag | string | The VAST tag that overwrites the default VAST tag. If this is null the default VAST tag is used. |
Response Parameters
Returns Ad Definition
Examples
Update the Ad Definition for Film 71
curl -i 'https://store.shift72.com/services/content/v1/ad/film/71' \
-X PUT \
-H 'x-auth-token: 1a95b58722d5ac829ba3db8a79bbc24f' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '[{
"break_id":"preroll",
"time_offset":"start",
"override_ad_tag":null
}]'
Response: Success
HttpStatus: 200
[
{
"break_id":"preroll",
"time_offset":"start",
"override_ad_tag":null
}
]
Response: Unauthorized
HttpStatus: 401
GET /services/content/v1/ad/vmap/[slug]
Description
Use this API to get the VMAP 1.0 response for the specified item. The VMAP 1.0 response is XML that specifies when ads should be played along with the associated VAST tag.
Response Parameters
Refer to the IAB VMAP Specification.
Examples
Request the VMAP for Film 71
curl -i 'https://store.shift72.com/services/content/v1/ad/vmap/film/71'
Response: Success
HttpStatus: 200
<?xml version="1.0" encoding="UTF-8"?>
<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">
<vmap:AdBreak timeOffset="start" breakType="linear" breakId="preroll">
<vmap:AdSource id="preroll-ad-1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[https://pubads.g.doubleclick.net/gampad/ads?sz=1024x576&iu=/179733448/SHIFT72_STANDARD&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&description_url=[description_url]&correlator=[timestamp]]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
</vmap:VMAP>
Response: No Ads
HttpStatus: 200
<?xml version="1.0" encoding="UTF-8"?>
<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0"/>
GET /services/content/configuration
Description
Use this API to get the configuration settings for the Configuration service.
Response Parameters
Parameter | Type | Description |
---|---|---|
rental_redeem_period | string | The number of days that an item is rented for. |
base_download_url | string | The base path to use to download content. |
base_url | string | The base path to use for streaming content. |
chromecast | string | Set to false if Chromecast is disabled, otherwise Chromecast is enabled. |
telemetry_freq | string | Frequency, in seconds, to send the telemetry data. Default is 30 seconds. |
Examples
Content Configuration Request
curl -i 'https://store.shift72.com/services/content/configuration'
Response: Success
HttpStatus: 200
{
"rental_redeem_period":"3",
"base_download_url":"https://indiereign02-a.akamaihd.net",
"base_url":"https://indiereign02-a.akamaihd.net",
"telemetry_freq":"20"
}
GET /services/content/v1/configuration/private
Description
Use this API to get the configuration settings that can be changed by an administrator. These configuration settings may include private settings that are only visible to administrators. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
rental_redeem_period | number | The number of days that an item is rented for. |
default_vast | string | The default VAST URL tag used for video ads. |
Examples
Admin Configuration Request
curl -i 'https://store.shift72.com/services/content/v1/configuration/private' \
-H 'x-auth-token: 7e628644bf631464bcf68575bcd8f89e'
Response: Success
HttpStatus: 200
{
"rental_redeem_period":5.0,
"default_vast":"https://pubads.g.doubleclick.net/gampad/ads?sz=1024x576\u0026iu=/179733448/SHIFT72_HOUSE\u0026impl=s\u0026gdfp_req=1\u0026env=vp\u0026output=xml_vast2\u0026unviewed_position_start=1\u0026url=[referrer_url]\u0026description_url=[description_url]\u0026correlator=[timestamp]"
}
Response: Unauthorized
HttpStatus: 401
PATCH /services/content/v1/configuration/private
Description
Use this API to update the configuration settings for the site. These configuration settings may include private settings that are only visible to administrators. This API is only accessible to users who have the admin role.
Request Parameters
Parameter | Type | Description |
---|---|---|
rental_redeem_period | number | Optional. The number of days that an item is rented for. |
default_vast | string | Optional. The default VAST URL tag used for video ads. |
Response Parameters
Returns Configuration (Admin).
Examples
Admin Configuration Request
curl -i 'https://store.shift72.com/services/content/v1/configuration/private' \
-X PATCH \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{ "rental_redeem_period":4 }'
Response: Success
HttpStatus: 200
{
"rental_redeem_period":4.0
}
Response: Key Doesn’t Exist
HttpStatus: 400
{
"error":"Bad request, request contains invalid key."
}
Response: Unauthorized
HttpStatus: 401
GET /services/content/ingestion/v3/profiles
Description
Use this API to get a list of ingestion profiles that can be used when ingesting content. If this API is called with an admin auth-token, then all available ingestion profiles are returned, otherwise only the public ingestion profiles are returned.
Response Parameters
Parameter | Type | Description |
---|---|---|
name | string | The internal name of the profile. |
friendly_name | string | The name of the profile. |
description | string | Description of what the profile does. |
default | bool | Set to true if this is the default profile. |
Examples
Get the Ingestion Profiles
curl -i 'https://store.shift72.com/services/content/ingestion/v3/profiles'
Response: Success
HttpStatus: 200
[
{
"name": "adaptive",
"friendly_name": "HD",
"description": "High definition encoding",
"default": true
},
{
"name": "trailer_full",
"friendly_name": "Trailer",
"description": "creates a trailer",
"default": true
},
{
"name": "adaptive_sd",
"friendly_name": "SD",
"description": "Standard definition encoding",
"default": false
}
]
GET /services/content/ingestion/v3/source
Description
Use this API to get a list of source files that have been uploaded in to the S3 bucket. This API is only accessible to users who have the admin role.
Response Parameters
Files
Parameter | Type | Description |
---|---|---|
Key | string | The name of the file. |
LastModified | string | The ISO 8601 time and date the file was last updated. |
Size | number | The size of the file in bytes. |
Bucket | string | The name of the S3 bucket. |
Profiles
Parameter | Type | Description |
---|---|---|
friendly_name | string | Deprecated. The name of the profile. |
description | string | Deprecated. Description of what the profile does. |
name | string | Deprecated. The internal name of the profile. |
Examples
Get the Source Files
curl -i 'https://store.shift72.com/services/content/ingestion/v3/source' \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'
Response: Success
HttpStatus: 200
{
"files":[
{
"Key":"Ambrosia_HD.mp4",
"LastModified":"2014-09-15T22:30:42.000Z",
"Size":22492027,
"Bucket":"s72-client-2"
},
{
"Key":"Andy-Made-A-Friend_HD.mp4",
"LastModified":"2014-09-15T22:26:28.000Z",
"Size":10683736,
"Bucket":"s72-client-2"
},
{
"Key":"Blood-Brothers_HD.mp4",
"LastModified":"2014-09-15T22:26:10.000Z",
"Size":21138034,
"Bucket":"s72-client-2"
}
],
"profiles":[]
}
Response: Unauthorized
HttpStatus: 401
Response: Forbidden
HttpStatus: 403
POST /services/content/ingestion/v3/start_job
Description
Use this API to start an ingestion job for the specified item. This API is only accessible to users who have the admin role.
Request Parameters
Parameter | Type | Description |
---|---|---|
source | string | The location of the source file to be ingested in the following formats: s3://bucket name/file name https://public-site/video.mp4[?optional signature] |
source_region | string | Optional. The AWS S3 Region of the S3 bucket where the source file is stored. This is only required if the bucket location can not be automatically determined. Required. if the source is an https url then the source location is the geographic location that the encoding will be processed in. |
base_filename | string | Used in the name of the ingested file. |
profile | string | The profile to use in this ingestion job. Contact us for a list of profiles as these are specific to your setup. |
notify_id | string | The slug of the film or TV show and season. |
Supported Source Regions
Region | Name |
---|---|
us-east-1 |
North Virginia |
us-east-2 |
Ohio |
us-west-1 |
North California |
us-west-2 |
Oregon |
ca-central-1 |
Central Canada |
ap-northeast-1 |
Tokyo |
ap-northeast-2 |
Seoul |
ap-south-1 |
Mumbai |
ap-southeast-1 |
Singapore |
ap-southeast-2 |
Sydney |
eu-central-1 |
Frankfurt |
eu-west-1 |
Ireland |
eu-west-2 |
London |
sa-east-1 |
Sao Paulo |
ap-northeast-1 |
Tokyo |
Response Parameters
Parameter | Type | Description |
---|---|---|
id | string | The unique ID of the ingestion job. |
encoder_job_id | string | The unique ID provided by the encoder. |
Examples
Start an Ingestion Job for Film 118
curl -i 'https://store.shift72.com/services/content/ingestion/v3/start_job' \
-X POST \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{
"source":"s3://s72-client-2/Ambrosia_HD.mp4",
"source_region": "ap-southeast-2",
"base_filename":"ambrosia_2",
"profile":"nzfcadaptive",
"notify_id":"/film/118"
}'
Response: Success
HttpStatus: 200
{
"id":"3a3c0b8d-9dcb-4443-9479-b9e51a58bbdd",
"encoder_job_id":166088085
}
Response: Access to the File is Forbidden
HttpStatus: 403
Response: Unauthorized
HttpStatus: 401
GET /services/content/v4/media_content/download/[slug]
Description
Use this API to get the download links for the specified item and encoding type. This API authenticates using either an x-auth-token or an x-play-token which is returned via the Play Token API. This API differs from the Play API in that it will return a download link if the film is in pre-sale.
The supported encoding_type fields depend on the ingestion profile used. DASH encoding_type is used for browsers that support MPEG-DASH and this is currently Chrome, Opera, Firefox, Edge, Internet Explorer 11 and native iOS and Android apps. Download encoding_type is for legacy iOS and Android apps that support downloading content. MP4 encoding_type can be used to get an unencrypted file.
Alternatively, the information can be requested by specifying the type of DRM. Widevine is used in Chrome, Opera, Firefox and Internet Explorer 10. PlayReady is used in in Edge and Internet Explorer 11. Fairplay is used in Safari.
If both encoding_type and drm are specified drm takes preference.
Query String Request Parameters
Parameter | Description |
---|---|
encoding_type | Request the specific encoding type. Options are: dash, stream, download, mp4, dash_live. |
drm | Request the specific drm type. Options are: widevine, playready, fairplay, none. |
Response Parameters
Parameter | Type | Description |
---|---|---|
ad_tag | string | Optional. A VAST tag for advertising. This is only included if the video has ads scheduled to play. |
play_session | string | X-Play-Session token that’s used when reporting Telemetry. This will be the same as the x-play-token when requests use x-play-token to authenticate. |
streams[url] | string | The url to the media content. |
streams[width] | number | The width of the media content. |
streams[height] | number | The height of the media content. |
streams[bitrate] | number | The bitrate of the media content. |
streams[encoding_type] | string | The type of encoding used on the media content. |
streams[drm_key_encoded] | string | The DRM key of the media content. |
playback_progress[last_played_at] | string | The ISO 8601 date and time when the content was last viewed. |
playback_progress[length] | number | Length of the content. |
playback_progress[play_position] | number | The last position, in seconds, where the content was viewed. |
Examples
Request the DASH Download Information for Film 71 Using Auth Token
curl -i 'https://store.shift72.com/services/content/v4/media_content/download/film/71?drm=widevine' \
-H 'x-auth-token: 023644c4043e76f4cb8cef015d22b4ad'
Response: DASH Success for Film 71 Using Auth Token
HttpStatus: 200
{
"play_session":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c3IiOjEsInVpZCI6IlNISUZUNzIiLCJleHAiOjE0NjgwMzczMTIsImNpZCI6Miwic2x1ZyI6Ii9maWxtLzUyIn0.LaPLncFTncOXRyCUcSseV_OgKjVHNYB74Xdy8_LSGgs",
"streams":[
{
"url":"https://indiereign02-a.akamaihd.net/7ebf883a-7b0d-4ee8-abbe-5edc0c9e841a/grabbers_480_1000_kb_dash_HD.mpd",
"width":640,
"height":360,
"bitrate":1069,
"encoding_type":"hd_dash",
"drm_key_encoded":"N2ViZjg4M2EtN2IwZC00ZWU4LWFiYmUtNWVkYzBjOWU4NDFhX0hE\n"
}
],
"ad_tag":"https://store.shift72.com/services/content/v1/ad/vmap/film/71",
"playback_progress":{
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":71
}
}
Response: Unauthorized
HttpStatus: 401
Response: Forbidden - User Doesn’t Own Film
HttpStatus: 403
{
"error":"The request was a valid request, but the server is refusing to respond to it. Unlike a 401 Unauthorized response, authenticating will make no difference."
}
GET /services/content/v3/media_content/[slug]
Description
Use this API to get the media content for the specified item. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
id | number | The unique media content ID. |
media_owner_id | number | The media content ID that this item belongs to. |
film_id | number | The unique ID of the film. |
tv_id | number | The unique ID of the TV show. |
season | number | The season number of the TV show. |
episode | number | The episode number of the TV season. |
created_at | string | The ISO 8601 time and date the item was created. |
updated_at | string | The ISO 8601 time and date the item was last updated. |
available_from | string | The date and time when the content is available to view. |
client_id | number | Deprecated. This is no longer used. |
bonus | number | The bonus number that relates to the film or TV Season. |
requires_pin_code | boolean | Boolean indicating whether the user should be prompted for their Pin code before purchasing/renting/playing. |
Response Parameters - Media Encoding Attributes
Parameter | Type | Description |
---|---|---|
id | number | The unique media encoding ID. |
content_encoding_id | string | The type of media encoding. |
drm_id | number | The type of DRM used. 0 = no DRM, 2 = Widevine. |
drm_key | string | The DRM key of the media content. |
location | string | The location of the media content. This needs to be appended to base_url to get the full path to the media content. |
width | number | The width of the media content. |
height | number | The height of the media content. |
bitrate | number | The bitrate of the media content. |
is_live | bool | Determines if this media content is live. |
updated_at | string | The ISO 8601 time and date the item was last updated. |
created_at | string | The ISO 8601 time and date the item was created. |
Content Encoding Types
Status | Description |
---|---|
hd_stream | The streams used for the flash player. There may be two items in this set, one for SD and one for HD. |
hd_dash | The stream used for the DASH player. |
hd_download | The file that can be downloaded. |
hd_trailer | The trailer. |
Examples
Get the Media Content for Film 92
curl -i 'https://store.shift72.com/services/content/v3/media_content/film/92' \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'
Response: Success
HttpStatus: 200
{
"media_content":{
"id":92,
"media_owner_id":null,
"film_id":92,
"tv_id":null,
"season":null,
"episode":null,
"created_at":"2014-09-15T22:59:34.369Z",
"updated_at":"2015-03-23T22:49:06.599Z",
"available_from":"2015-04-01T01:20:00.000Z",
"client_id":2,
"bonus":null,
"requires_pin_code": true,
"media_encodings_attributes":[
{
"id":382,
"content_encoding_id":"hd_stream",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_720_1500_kb_stream_HD.wvm",
"width":1280,
"height":718,
"bitrate":1654,
"is_live":true,
"updated_at":"2014-09-18T09:01:01.160Z",
"created_at":"2014-09-18T09:01:01.160Z"
},
{
"id":380,
"content_encoding_id":"hd_stream",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_480_1000_kb_stream_HD.wvm",
"width":848,
"height":476,
"bitrate":1146,
"is_live":true,
"updated_at":"2014-09-18T08:56:26.565Z",
"created_at":"2014-09-18T08:56:26.565Z"
},
{
"id":379,
"content_encoding_id":"hd_download",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_720_3600_kb_download_HD.wvm",
"width":1280,
"height":718,
"bitrate":3286,
"is_live":true,
"updated_at":"2014-09-18T08:54:24.356Z",
"created_at":"2014-09-18T08:54:24.356Z"
},
{
"id":1612,
"content_encoding_id":"hd_dash",
"drm_id":3,
"drm_key":"520bfa08-033a-421b-9608-5d1a135eb7c9_HD",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_480_1000_kb_dash_HD.mpd",
"width":848,
"height":476,
"bitrate":1146,
"is_live":true,
"updated_at":"2015-01-07T01:18:02.150Z",
"created_at":"2015-01-07T01:18:02.150Z"
},
{
"id":1247,
"content_encoding_id":"hd_trailer",
"drm_id":0,
"drm_key":"None",
"location":"/043ffa3d-bb80-4e4b-9125-2026c5012180/ambrosia_480_2000_trailer_kb_trailer_HD.mp4",
"width":848,
"height":476,
"bitrate":2158,
"is_live":true,
"updated_at":"2014-12-02T00:51:52.045Z",
"created_at":"2014-12-02T00:51:52.045Z"
},
{
"id":1246,
"content_encoding_id":"hd_download",
"drm_id":2,
"drm_key":"25529750",
"location":"/043ffa3d-bb80-4e4b-9125-2026c5012180/ambrosia_480_2000_kb_download_SD.wvm",
"width":848,
"height":476,
"bitrate":2158,
"is_live":false,
"updated_at":"2015-05-18T01:38:45.261Z",
"created_at":"2015-05-18T01:38:45.261Z"
}
]
},
"bonus_media_contents":[
]
}
Response: Unauthorized
HttpStatus: 401
DELETE /services/content/v4/media_content/[slug]
Description
Use this API to delete media content from the specified item. Note that providing the slug ‘/tv/1’ will delete all the seasons, episodes and any bonus content. It will also remove the related records in Media Encodings and User Library. Providing the slug /tv/1/season/1 will remove all the episodes for a season and so on. This API is only accessible to users who have the admin role.
Examples
Delete Bonus Content 1 from Film 92
curl -i 'https://store.shift72.com/services/content/v4/media_content/film/92/bonus/1' \
-X DELETE \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'
Response: Success
HttpStatus: 204
Response: Error - Media Content Doesn’t Exist
HttpStatus: 404
{
"error":"No media content to remove for provided slug"
}
Response: Unauthorized
HttpStatus: 401
PUT /services/content/v3/media_content/[slug]
Description
Use this API to update the media content records for the specified item. This API is only accessible to users who have the admin role.
Request Parameters
The same as the Media Content data.
Response Parameters
Returns Media Content.
Examples
Create Media Content Records for Film 92
curl -i 'https://store.shift72.com/services/content/v3/media_content/film/92' \
-X PUT \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{
"media_content":{
"id":92,
"media_owner_id":null,
"film_id":92,
"tv_id":null,
"season":null,
"episode":null,
"created_at":"2014-09-15T22:59:34.369Z",
"updated_at":"2015-03-23T22:49:06.599Z",
"available_from":"2015-04-01T01:20:00.000Z",
"client_id":2,
"bonus":null,
"requires_pin_code": false,
"media_encodings_attributes":[
{
"id":382,
"content_encoding_id":"hd_stream",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_720_1500_kb_stream_HD.wvm",
"width":1280,
"height":718,
"bitrate":1654,
"is_live":true,
"updated_at":"2014-09-18T09:01:01.160Z"
},
{
"id":380,
"content_encoding_id":"hd_stream",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_480_1000_kb_stream_HD.wvm",
"width":848,
"height":476,
"bitrate":1146,
"is_live":true,
"updated_at":"2014-09-18T08:56:26.565Z"
},
{
"id":379,
"content_encoding_id":"hd_download",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_720_3600_kb_download_HD.wvm",
"width":1280,
"height":718,
"bitrate":3286,
"is_live":true,
"updated_at":"2014-09-18T08:54:24.356Z"
},
{
"id":1612,
"content_encoding_id":"hd_dash",
"drm_id":3,
"drm_key":"520bfa08-033a-421b-9608-5d1a135eb7c9_HD",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_480_1000_kb_dash_HD.mpd",
"width":848,
"height":476,
"bitrate":1146,
"is_live":true,
"updated_at":"2015-01-07T01:18:02.150Z"
},
{
"id":1247,
"content_encoding_id":"hd_trailer",
"drm_id":0,
"drm_key":"None",
"location":"/043ffa3d-bb80-4e4b-9125-2026c5012180/ambrosia_480_2000_trailer_kb_trailer_HD.mp4",
"width":848,
"height":476,
"bitrate":2158,
"is_live":true,
"updated_at":"2014-12-02T00:51:52.045Z"
},
{
"id":1246,
"content_encoding_id":"hd_download",
"drm_id":2,
"drm_key":"25529750",
"location":"/043ffa3d-bb80-4e4b-9125-2026c5012180/ambrosia_480_2000_kb_download_SD.wvm",
"width":848,
"height":476,
"bitrate":2158,
"is_live":false,
"updated_at":"2015-05-18T01:38:45.261Z"
}
]
},
"bonus_media_contents":[
{
"bonus":1,
"media_encodings_attributes":[
]
}
]
}'
Response: Success
HttpStatus: 200
{
"media_content":{
"id":92,
"media_owner_id":null,
"film_id":92,
"tv_id":null,
"season":null,
"episode":null,
"created_at":"2014-09-15T22:59:34.369Z",
"updated_at":"2015-03-23T22:49:06.599Z",
"available_from":"2015-04-01T01:20:00.000Z",
"client_id":2,
"bonus":null,
"requires_pin_code": false,
"media_encodings_attributes":[
{
"id":382,
"content_encoding_id":"hd_stream",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_720_1500_kb_stream_HD.wvm",
"width":1280,
"height":718,
"bitrate":1654,
"is_live":true,
"updated_at":"2014-09-18T09:01:01.160Z",
"created_at":"2014-08-18T09:01:01.160Z"
},
{
"id":380,
"content_encoding_id":"hd_stream",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_480_1000_kb_stream_HD.wvm",
"width":848,
"height":476,
"bitrate":1146,
"is_live":true,
"updated_at":"2014-09-18T08:56:26.565Z",
"created_at":"2014-08-18T08:56:26.565Z"
},
{
"id":379,
"content_encoding_id":"hd_download",
"drm_id":2,
"drm_key":"23922609",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_720_3600_kb_download_HD.wvm",
"width":1280,
"height":718,
"bitrate":3286,
"is_live":true,
"updated_at":"2014-09-18T08:54:24.356Z",
"created_at":"2014-08-18T08:54:24.356Z"
},
{
"id":1612,
"content_encoding_id":"hd_dash",
"drm_id":3,
"drm_key":"520bfa08-033a-421b-9608-5d1a135eb7c9_HD",
"location":"/520bfa08-033a-421b-9608-5d1a135eb7c9/ambrosia_480_1000_kb_dash_HD.mpd",
"width":848,
"height":476,
"bitrate":1146,
"is_live":true,
"updated_at":"2015-01-07T01:18:02.150Z",
"created_at":"2015-01-06T01:18:02.150Z"
},
{
"id":1247,
"content_encoding_id":"hd_trailer",
"drm_id":0,
"drm_key":"None",
"location":"/043ffa3d-bb80-4e4b-9125-2026c5012180/ambrosia_480_2000_trailer_kb_trailer_HD.mp4",
"width":848,
"height":476,
"bitrate":2158,
"is_live":true,
"updated_at":"2014-12-02T00:51:52.045Z",
"created_at":"2014-11-02T00:51:52.045Z"
},
{
"id":1246,
"content_encoding_id":"hd_download",
"drm_id":2,
"drm_key":"25529750",
"location":"/043ffa3d-bb80-4e4b-9125-2026c5012180/ambrosia_480_2000_kb_download_SD.wvm",
"width":848,
"height":476,
"bitrate":2158,
"is_live":false,
"updated_at":"2015-05-18T01:38:45.261Z",
"created_at":"2015-04-18T01:38:45.261Z"
}
]
},
"bonus_media_contents":[
{
"id":616,
"media_owner_id":null,
"film_id":92,
"tv_id":null,
"season":null,
"episode":null,
"created_at":"2015-06-08T23:31:34.766Z",
"updated_at":"2015-06-08T23:31:34.766Z",
"available_from":null,
"client_id":2,
"bonus":1,
"media_encodings_attributes":[
]
}
]
}
Response: Error - Media Content Not Supplied
HttpStatus: 422
{
"error":"No media_content"
}
Response: Unauthorized
HttpStatus: 401
GET /services/content/v4/media_content/play/[slug]
Description
Use this API to get the play links for the specified item and encoding type. This API authenticates using either an x-auth-token or an x-play-token which is returned via the Play Token API.
The supported encoding_type fields depend on the ingestion profile used. DASH encoding_type is used for browsers that support MPEG-DASH and this is currently Chrome, Opera, Firefox, Edge, Internet Explorer 11 and native iOS and Android apps. Download encoding_type is for legacy iOS and Android apps that support downloading content. MP4 encoding_type can be used to get an unencrypted file.
Alternatively, the information can be requested by specifying the type of DRM. Widevine is used in Chrome, Opera, Firefox and Internet Explorer 10. PlayReady is used in in Edge and Internet Explorer 11. Fairplay is used in Safari.
If both encoding_type and drm are specified drm takes preference.
Query String Request Parameters
Parameter | Description |
---|---|
encoding_type | Request the specific encoding type. Options are: dash, stream, download, mp4, dash_live. |
drm | Request the specific drm type. Options are: widevine, playready, fairplay, none. |
Response Parameters
Parameter | Type | Description |
---|---|---|
ad_tag | string | Optional. A VAST tag for advertising. This is only included if the video has ads scheduled to play. |
play_session | string | X-Play-Session token that’s used when reporting Telemetry. This will be the same as the x-play-token when requests use x-play-token to authenticate. |
streams[url] | string | The url to the media content. |
streams[width] | number | The width of the media content. |
streams[height] | number | The height of the media content. |
streams[bitrate] | number | The bitrate of the media content. |
streams[encoding_type] | string | The type of encoding used on the media content. |
streams[drm_key_encoded] | string | The DRM key of the media content. |
playback_progress[last_played_at] | string | The ISO 8601 date and time when the content was last viewed. |
playback_progress[length] | number | Length of the content. |
playback_progress[play_position] | number | The last position, in seconds, where the content was viewed. |
Examples
Request the DASH Play Information for Film 71 Using Auth Token
curl -i 'https://store.shift72.com/services/content/v4/media_content/play/film/71?drm=widevine' \
-H 'x-auth-token: 023644c4043e76f4cb8cef015d22b4ad'
Request the DASH Play Information for TV 2, Season 1, Episode 1 Using Play Token
curl -i 'https://store.shift72.com/services/content/v4/media_content/play/tv/2/season/1/episode/1?drm=widevine' \
-H 'x-play-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c3IiOjEsInVpZCI6IlNISUZUNzIiLCJleHAiOjE0NjgwMzczMTIsImNpZCI6Miwic2x1ZyI6Ii9maWxtLzUyIn0.LaPLncFTncOXRyCUcSseV_OgKjVHNYB74Xdy8_LSGgs'
Response: DASH Success for Film 71 Using Auth Token
HttpStatus: 200
{
"play_session":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c3IiOjEsInVpZCI6IlNISUZUNzIiLCJleHAiOjE0NjgwMzczMTIsImNpZCI6Miwic2x1ZyI6Ii9maWxtLzUyIn0.LaPLncFTncOXRyCUcSseV_OgKjVHNYB74Xdy8_LSGgs",
"streams":[
{
"url":"https://indiereign02-a.akamaihd.net/7ebf883a-7b0d-4ee8-abbe-5edc0c9e841a/grabbers_480_1000_kb_dash_HD.mpd",
"width":640,
"height":360,
"bitrate":1069,
"encoding_type":"hd_dash",
"drm_key_encoded":"N2ViZjg4M2EtN2IwZC00ZWU4LWFiYmUtNWVkYzBjOWU4NDFhX0hE\n"
}
],
"ad_tag":"https://store.shift72.com/services/content/v1/ad/vmap/film/71",
"playback_progress":{
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":71
}
}
Response: Unauthorized
HttpStatus: 401
Response: Forbidden - User Doesn’t Own Film
HttpStatus: 403
{
"error":"The request was a valid request, but the server is refusing to respond to it. Unlike a 401 Unauthorized response, authenticating will make no difference."
}
POST /services/playback/user/external/play_token/[slug]
Description
Use this API to get the play token for the specified item. Returns a JWT that allows an external user to play content hosted on Shift72’s platform.
As these tokens are for external users, no ownership, device limits, or region checks will be done. You need to ensure that the recipient is allowed to play this content before giving them a token.
You must provide an expiry time for the token, no more than 24 hours in the future. After a token has expired, attempts to start playback or perform license checks will fail and a new token will be required.
This API is only accessible to users who have the admin role.
Request Parameters
Parameter | Type | Description |
---|---|---|
usr | string | Required. User id to associate with the play token. This can be the user id from an external system. |
exp | string | Required. The ISO 8601 time and date that the play token will expire and cease to function. This is encoded in the JWT response as Unix Time, i.e. the number of seconds that have elapsed since midnight Thursday, 1 January 1970. |
uid | string | Optional. Text to overlay as a watermark over the playback experience. |
olv | string | Optional. The position and placement of the any text specified by the uid parameter. Two options are available: apple displays the text in a different corner for 20 seconds at a time. Every 15 minutes the corner used is changed. og displays the text permanently on the left edge of the video. |
Adding additional claims to the token
You can add extra information such as an external ID, age, or gender property so that you can track those demographics via the telemetry requests.
Additional properties in the request body will be included as claims in the token, provided that they meet the following criteria:
- Are a JSON string, number or boolean. Null values are not supported.
- Do not have the same name as any Shift72 claims. Using a naming prefix for your claims will avoid potential conflicts.
Any invalid claims will not be included in the token.
Response Parameters
Returns a JWT including the following claims and any valid additional claims included in the request.
Claim | Type | Description |
---|---|---|
exp | number | The expiration time for this token as a Unix timestamp |
iat | number | The issued at time for this token as a Unix timestamp |
cid | number | Your Shift72 client ID |
slug | string | Identifies the Shift72 media item being played |
usr | string | The external user ID you provided |
olv | string | Optional The overlay style. apple or og` |
uid | string | Optional Text to display on the overlay watermark |
The playtoken includes other claims for Shift72’s internal use and must not be relied on.
Examples
Request a Play Token for Film 71
curl -i 'https://store.shift72.com/services/playback/user/external/play_token/film/71' \
-X POST \
-H 'x-auth-token: a1e5404cc31a3e09d1b6d2f9d4130c4b' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{
"usr":"12345-ABCDE",
"uid":"SHIFT72",
"exp":"2023-01-11T02:50:06.000Z"
}'
Response: Success
HttpStatus: 200
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzbHVnIjoiL2ZpbG0vNzEiLCJ1c3IiOiIxMjM0NS1BQkNERSIsInVpZCI6IlNISUZUNzIiLCJleHAiOjE2NzM0MDU0MDYsImNpZCI6IjIifQ.KpXtmj1ICScoqNFt92Xt-DPRib1hrXTivCi-W8pUi08"
Response: Unauthorized
HttpStatus: 401
Response: Forbidden - Content Doesn’t Belong to Client
HttpStatus: 403
{
"error":"content does not belong to client"
}
GET /services/content/v4/media_content/streams/[slug]
Description
Use this API to get the collection of stream URLs for the specified item and encoding type, as well as site-specific config settings and an individual’s progress for the item. It is intended as a single source of information for a particular content item.
This API authenticates using either an x-auth-token or an x-play-token which is returned via the Play Token API.
Response Parameters
Parameter | Type | Description |
---|---|---|
play_session | string | X-Play-Session token that’s used when reporting Telemetry. This will be the same as the x-play-token when requests use x-play-token to authenticate. |
playback_progress[last_played_at] | string | The ISO 8601 date and time when the content was last viewed. |
playback_progress[length] | number | Length of the content. |
playback_progress[play_position] | number | The last position, in seconds, where the content was viewed. |
streams[url] | string | The url to the media content. |
streams[width] | number | The width of the media content. |
streams[height] | number | The height of the media content. |
streams[bitrate] | number | The bitrate of the media content. |
streams[encoding_type] | string | The type of encoding used on the media content. |
streams[drm_key_encoded] | string | The DRM key of the media content. |
streams[drm_type] | array | List of supported DRM policies supported by this stream. Supported values are ‘widevine’, ‘playready’, ‘fairplay’ or none. |
timings | array | If enabled, a list of timing events associated with this content, grouped by timing category. |
ad_tag | string | URL to VMAP for video advertising. This is only included if the video has ads scheduled to play. |
config | string | List of config options and feature toggles pertaining to the streaming of content. |
Examples
Get the Media Content for Film 92
curl -i 'https://store.shift72.com/services/content/v4/media_content/streams/film/92' \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'
Response: Success
HttpStatus: 200
{
"play_session": "eyJ1c3IiOjk0NiwiY2lkIjoxOSwibWlkIjo0NzAsImdlbyI6Im56IiwiYWdlIjpudWxsLCJnaWQiOm51bGwsInFpZCI6ImhkIiwic2x1ZyI6Ii90di8zNy9zZWFzb24vMS9lcGlzb2RlLzEiLCJleHAiOjE1NzQyMTQ4MDN9.CkkR5N7NHZO1NKbYKqCdEsd45qcXRPML5q2MEYh9-ho",
"playback_progress": {
"play_position": 0,
"length": 114,
"last_played_at": "2017-10-10T00:40:05.617Z"
},
"streams": [
{
"url": "https://indiereign-a.akamaihd.net/aac56b14-b99d-4be4-adeb-abcdefg123/2766/hls/okay.m3u8",
"width": 1024,
"height": 576,
"bitrate": 1990,
"encoding_type": "hls",
"drm_key_encoded": null,
"drm_type": [
"fairplay"
]
},
{
"url": "https://indiereign-a.akamaihd.net/aac56b14-b99d-4be4-adeb-abcdefg123/okay.mpd",
"width": 1024,
"height": 576,
"bitrate": 1990,
"encoding_type": "hd_dash",
"drm_key_encoded": "YWFjNTZiMTQtYjk5ZC00YabcdefgWItNGVmNTQ0OWI5N2YxX0hE\n",
"drm_type": [
"widevine"
]
}
],
"timings": {
"skip_to": [],
"moment": [],
"end_of_play": [
{
"label": "Watch next episode",
"time": 1643,
"action": "next"
}
]
},
"ad_tag": "https://store.shift72.local/services/content/v1/ad/vmap/film/92",
"config": {
"streams_api_enabled": true,
"base_download_url": "https://indiereign-a.akamaihd.net",
"base_url": "https://indiereign-a.akamaihd.net",
"chromecast": "true",
"default_availability_period_days": "30",
"disallow_blocked_content": "Please turn off Ad-Blocker to enjoy this amazing content free of charge.",
"encoding_profile_hd": "avod_profile_1",
"encoding_profile_sd": "_",
"feature_ads": "true",
"ingestion_manager_version": "3",
"mp4_fallback": "true",
"platform_type": "avod",
"rental_redeem_period": "7"
}
}
Response: Unauthorized
HttpStatus: 401
Response: Forbidden - User Doesn’t Own Film
HttpStatus: 403
{
"error":"The request was a valid request, but the server is refusing to respond to it. Unlike a 401 Unauthorized response, authenticating will make no difference."
}
POST /services/content/ingestion/v1/screener
Description
Use this API to start an ingestion job to create a screener for the specified item. A screener is a file that has the specified watermark and can be downloaded as an MP4 file without DRM encryption. This API is only accessible to users who have the admin role.
Request Parameters
Parameter | Type | Description |
---|---|---|
slug | string | The slug of the film or TV show and season. |
text | string | The text to be displayed as the watermark. |
direction | string | Optional. The direction of the text. Can be “right”, “left”, “up”, or “down”. Default is “right”. |
x | string | The x position of the text. Can also be “centered”. A negative number can be used to right align the text. |
y | string | The x position of the text. Can also be “centered”. A negative number can be used to align the text from the bottom of the screen. |
Response Parameters
Parameter | Type | Description |
---|---|---|
token | string | The unique ID of the ingestion job. |
status | string | The overall status of the ingestion job. Can be one of: “in_progress”, “completed”, or “errored”. |
Examples
Create a Screener for Film 118
curl -i 'https://store.shift72.com/services/content/ingestion/v1/screener' \
-X POST \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{
"slug": "/film/118",
"text": "Watermark Sample",
"direction": "right",
"x": "centered",
"y": "centered"
}'
Response: Success
HttpStatus: 200
{
"token":"blon572akl4c05mq2fd0",
"status":"in_progress"
}
Response: Invalid JSON
HttpStatus: 400
{
"error":"request body invalid",
"code":"request_invalid"
}
Response: Access to the API is Forbidden
HttpStatus: 403
Response: Unauthorized
HttpStatus: 401
POST /services/content/ingestion/v1/screener/[token]/url?timelimit=[time]
Description
Use this API to create a signed URL to download the screener for the specified item. This API is only accessible to users who have the admin role.
Query String Request Parameters
Parameter | Description |
---|---|
timeout | The number of minutes that the signed URL will be valid for. |
Response Parameters
Parameter | Type | Description |
---|---|---|
url | string | The URL to the file to be downloaded. |
Examples
Create a Signed URL That’s Valid for 10 Minutes
curl -i 'https://store.shift72.com/services/content/ingestion/v1/screener/blon572akl4c05mq2fd0/url/timeout=10' \
-X POST \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'
Response: Success
HttpStatus: 200
{
"url":"https://s72-screeners-ap-southeast-2.s3.ap-southeast-2.amazonaws.com/simon_test_blooleqakl4c05mq2feg.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=ASIAZT3HMUS2FMNSPQXJ%2F20190906%2Fap-southeast-2%2Fs3%2Faws4_request\u0026X-Amz-Date=20190906T030007Z\u0026X-Amz-Expires=600\u0026X-Amz-Security-Token=AgoJb3JpZ2luX2VjEJr%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0yIkYwRAIgYiOu3mV2s%2BOauagIxZ5ZKtuuNtNiLFnzpPbrGUuCR%2BMCIGABGZ%2B9iq1%2BDwkdrJf7ohe1PCkrfISOwee6qMcYBMGaKuQDCFMQABoMNjYxMTA0OTI3OTI0Igxu8edarjB7kQ7T8P4qwQNm9SXSQ1AfqhyqvPA1RYpg781wV34ijS1ztjlrPtGq3zjHA1dVJWhGktK9cf6SIRuEZln1vfPC6WXXJCrYvht0wciaEh8KKLEBkO4RhPc8MeGjC%2FOqSUqPXXpvSExLStzyF0DnAme0%2BQt6Xp73P%2FFdzKTzqYdt0PaLEiFmMVf%2BTPNQ%2FFBziwxlUuY4MawSXzm07TuYypu6oCSzytdqtcSenh4p9ApaaRnqDiZ9m9kySF60gGmx5eMbhfKw5QkT3CasCJ%2F30RaPHh8f4hVwnOGpW6PffLUBMGfeZlqUD21HHFlq0yH1W%2FFieYcapfd4Z%2FkOpCCzvsJ2yy4ID11%2Bfw5NmKDNCkBMj4yvp0eixq3xl6gi8K1aymw7943faJN2z4rOjobucmvtM5EUoBvFhoHijBcjhO0lqWCXi8d1J4kaFpkBRYm7HjYakI79WrCsecYB1nClk02E84VMYEuM6WLrEITPiPgNjw28Do%2FlqmXc1Tbx3Mvr0xwyH6jMQVWlzr3%2Bol7MTfFtu640OOGORRR18roFWq3LsUys9RV%2FPFBX%2FL3Svyb%2BdtueRGIbKNYDFslny6z8%2BU5WiyA%2FFHI2LDqy%2BDC4%2FMbrBTq1Aa0ma4SFqSxP7v8QjwGrBc%2FmN5v0Mw39jgvcz%2BP1OvpcyN%2BtgUaljWc0QeD%2FLzA3aXrMyMHy5KI7E16kz9HEPMSmhcRgCQ9zgONObWa9rZBL2hT5zXvx0VjkAJcsEPfk5l2Mq5Dl6Jh0BKBHG8pZRD1RTL7afZs8aI9%2BcSvjjrOJywpzmuBf38X19N1mYSLsXI7NG1tuKy7BhEWKKcgjjKguSu7Srx7AImegNXHxbxhoa4XDdCU%3D\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=9976d355950cdc5121eae2d26e4b1dad5029cc6a293e4a2a2459bca8f1faa886"
}
Response: Access to the API is Forbidden
HttpStatus: 403
Response: Unauthorized
HttpStatus: 401
GET /services/content/ingestion/v1/upload_buckets
Description
Use this API to view the list of possible S3 buckets that the file can be uploaded to.
Response Parameters
Parameter | Type | Description |
---|---|---|
aws_region | string | The AWS S3 Region where the bucket is located . |
aws_bucket | string | The name of the AWS S3 bucket. |
name | string | A user friendly display name of the AWS S3 bucket and region. |
Examples
View the Upload Buckets
curl -i 'https://store.shift72.com/services/content/v1/upload_buckets'
Response: Success
HttpStatus: 200
[
{
"aws_bucket":"s72-client-2",
"aws_region":"us-west-2",
"name":"US West"
}
]
POST /services/content/ingestion/v1/upload_invite
Description
Use this API to send an invite for someone to upload media content. This API is only accessible to users who have the admin role.
Request Parameters
Parameter | Type | Description |
---|---|---|
email_address | string | Optional. The email address to send the invitation to. |
ingest_on_completion | bool | Set to true if the ingestion job should start once the upload is completed. |
ingestion_profile | string | The profile to use in this ingestion job. |
item_title | string | Title of the media content. |
slug | string | The slug of the film or TV show and season. |
publish_after_ingestion | bool | Set to true if the ingestion job should auto publish the content when the ingestion is completed. |
Response Parameters
Returns Upload Invite.
Examples
Send an Upload Invitation
curl -i 'https://store.shift72.com/services/content/v1/upload_invite' \
-X POST \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{
"email_address":"user@example.com",
"slug":"/film/165",
"item_title":"King Lear",
"ingestion_profile":"nzfcadaptive",
"ingest_on_completion":true,
"publish_after_ingestion":true
}'
Response: Success
HttpStatus: 200
{
"email_address":"user@example.com",
"status":"invited",
"token":"c5ae80afe5fe47ec2ad047611ffb9aaa",
"item_title":"Everybody Wants Some",
"upload_id":null,
"file_key":null,
"aws_region":null,
"invite_sent":null,
"invite_claimed":null,
"last_chunk_uploaded":null,
"invite_completed":null,
"slug":"/film/165",
"completed":0
}
Response: Unauthorized
HttpStatus: 401
GET /services/content/ingestion/v1/upload_invite?item=[slug]
Description
Use this API to view the invitations that have been sent for the media content. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
aws_region | string | The AWS S3 Region that the file was uploaded to. |
completed | number | This percentage of the file that has been uploaded. |
file_key | string | The name of the file stored in the S3 bucket. |
invite_claimed | string | The ISO 8601 UTC date and time that the invite was claimed by the invitee. |
invite_completed | string | The ISO 8601 UTC date and time that the file was successfully uploaded. |
invite_sent | string | The ISO 8601 UTC date and time that the invitation was sent. |
item_title | string | Title of the media content. |
last_chunk_uploaded | string | The ISO 8601 UTC date and time that the most recent part of the file was uploaded. |
slug | string | The slug of the film or TV show and season. |
status | string | This will be set to “invited”, “claimed” or “completed”. |
token | string | The upload token. |
upload_id | string | S3 ID. |
Examples
View the Upload Invitations for Film 72
curl -i 'https://store.shift72.com/services/content/v1/upload_invite?item=/film/72' \
-H 'x-auth-token: 15ee139195e16f0d4b40338aabc191f3'
Response: Success
HttpStatus: 200
[
{
"email_address":"user@example.com",
"status":"invited",
"token":"656b40cb185474b8e854ad973d293ba4",
"item_title":"Everybody Wants Some",
"upload_id":null,
"file_key":null,
"aws_region":null,
"invite_sent":null,
"invite_claimed":null,
"last_chunk_uploaded":null,
"invite_completed":null,
"slug":"/film/72",
"completed":0
},
{
"email_address":"user@example.com",
"status":"claimed",
"token":"c5ae80afe5ae47ec2ad047611ffb9aaa",
"item_title":"Everybody Wants Some",
"upload_id":null,
"file_key":"everybody_wants_some_film_165_uid31_hunting_dog.mp4",
"aws_region":"us-west-2",
"invite_sent":null,
"invite_claimed":"2016-01-10T22:35:18.036Z",
"last_chunk_uploaded":null,
"invite_completed":null,
"slug":"/film/72",
"completed":0
},
{
"email_address":"user@example.com",
"status":"completed",
"token":"5add94575fea5897305155e623bf786c",
"item_title":"Everybody Wants Some",
"upload_id":"kUtkotLFQatXFVgGnwp_cCTZJXo2n13RZ_k4APG_SJWSJ4dJRWF0wCkVOgiStwDziHk2NVeB87rMnCGkTxCr1DFvMWpwatYFoUtsMIC9FwHs3F_u1XAQFWYSPWZig4Bj",
"file_key":"everybody_wants_some_film_165_uid17_everybody_wants_some.mp4",
"aws_region":"us-west-2",
"invite_sent":null,
"invite_claimed":"2016-01-07T20:46:57.997Z",
"last_chunk_uploaded":"2016-01-07T20:52:43.320Z",
"invite_completed":"2016-01-07T20:52:44.088Z",
"slug":"/film/72",
"completed":100
}
]
Response: Unauthorized
HttpStatus: 401
DELETE /services/content/ingestion/v1/upload_invite/[token]
Description
Use this API to delete an upload invite. This API is only accessible to users who have the admin role.
Examples
Delete an Upload Invitation
curl -i 'https://store.shift72.com/services/content/v1/upload_invite/f8a88e4366f79c1641f771d8d0222174' \
-X DELETE \
-H 'x-auth-token: 15ee139195e16f0d4b40338aabc191f3'
Response: Success
HttpStatus: 200
Response: Unauthorized
HttpStatus: 401
Response: Token Doesn’t Exist
HttpStatus: 404
{
"error":"Could not find invitation"
}
GET /services/content/ingestion/v1/upload_invite/[token]
Description
Use this API to view the status of an invitation.
Response Parameters
Parameter | Type | Description |
---|---|---|
status | string | This will be set to “invited”, “claimed”, “uploading” or “completed”. |
item_title | string | Title of the media content. |
upload_id | string | S3 ID. |
slug | string | The slug of the film or TV show and season. |
url | string | URL to the S3 bucket. |
auth | string | S3 authentication details. |
file | string | Information about the file being uploaded. |
Examples
Get the Upload Information for the Given Token
curl -i 'https://store.shift72.com/services/content/v1/upload_invite/54c5d1972780ad22f62d54f69142647f'
Response: Success
HttpStatus: 200
{
"status":"uploading",
"item_title":"Example Film",
"upload_id":".J3PgDM9DPuEJiFdvi6iM5He552Vqd7CyjpjuXBpytd5sWRlL55myQd3EE.TOkoQzOYEgf2lnTlJ3q9XQa155cyr5zPMTOaN0IMoqFmQwHo4HO55.A155gpouYz3lHTE",
"slug":"/film/72",
"url":"https://s72-client-02-external-eu-west-1.s3-eu-west-1.amazonaws.com",
"auth":{
"date":"2016-02-29T01:27:15.874Z",
"signature":"55d7403d4562bfee63e551f70bb22cf9a02d3daa55697c587e116cd76dab1c1d",
"access_key":"AKIAJGATQ5BNSAFBICIA",
"aws_region":"eu-west-1",
"aws_bucket":"s72-client-02-external-eu-west-1",
"content_type":"video/mp4"
},
"file":{
"key":"example_film_72_uid54_example_film_140730_prores422.mov",
"backup_key":"example_film_72_uid54_example_film_140730_prores422.mov.852980",
"file_name":"Example Film 140730 ProRes422.mov",
"file_size":3973451716,
"file_last_modified":"2014-07-30T12:01:47.000Z",
"last_chunk_uploaded":"2016-02-26T18:24:35.196Z",
"file_chunks_uploaded":[ ]
}
}
Response: Token Not Found
HttpStatus: 404
{
"error": "Could not find invitation"
}
DELETE /services/content/v1/user_devices/[device_id]
Description
Use this API to deregister a device from a user.
Request Parameters
Parameter | Type | Description |
---|---|---|
device_id | string | Required. The unique ID or the registered device to remove. |
Response Parameters
Parameter | Type | Description |
---|---|---|
success | string | A message that provides more information about the request. |
error | string | A message that provides more information about the error. |
Examples
Remove a Device for User 693
curl -i 'https://store.shift72.com/services/content/v1/user_devices/693' \
-X DELETE \
-H 'x-auth-token: 37966929704a98d1a28971430ae5f2ab' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{"device_id":"116152b3-ec95-4a63-94be-be57c5a2f355"}'
Response: Success
HttpStatus: 200
{
"success":"removed device"
}
Response: Invalid Device ID
HttpStatus: 422
{
"error":"no device with that id"
}
Response: Unauthorized
HttpStatus: 401
Response: Delete limit reached
HttpStatus: 403
{
"error": "delete limit reached"
}
GET /services/content/v1/user_devices/[user_id]
Description
Use this API to get a list of registered devices for a user. This API is not currently used but may be used in the future when limitations on the number of registered devices are required.
Response Parameters
Parameter | Type | Description |
---|---|---|
id | number | Deprecated. This is no longer used. |
device_id | string | Unique ID given to this registered device. |
friendly_name | string | Friendly name for the user to identify this device. |
account_id | number | The user’s unique ID. |
start_ownership_range | string | The ISO 8601 time and date the device was registered against this account. |
end_ownership_range | string | The ISO 8601 time and date the device was deregistered from this account. |
created_at | string | Deprecated. This is no longer used. |
updated_at | string | Deprecated. This is no longer used. |
device_type | string | The type of device, e.g. “ipad”, “android” |
can_delete | boolean | Whether the user is able to delete this device |
days_until_next_delete | number | If applicable, how many days the user will need to delete until the device is able to be deleted |
Currently the values for can_delete
and days_until_next_delete
(if present) will be the identical across all devices for the user.
Examples
Get the Registered Devices for User 5769
curl -i 'https://store.shift72.com/services/content/v1/user_devices/5769' \
-H 'x-auth-token: 980d099188d97f8e213ec9d6a4660b78'
Response: Success
HttpStatus: 200
{
"devices":[
{
"id":1557,
"device_id":"9ce4ee5b-a277-4ebc-8239-508f61a22a4e",
"friendly_name":"My iPad",
"account_id":5769,
"start_ownership_range":"2015-06-08",
"end_ownership_range":null,
"created_at":"2015-06-08T02:03:39.603Z",
"updated_at":"2015-06-08T02:03:39.603Z",
"device_type":"iPad",
"can_delete": false,
"days_until_next_delete": 3
},
{
"id":1558,
"device_id":"850f7c43-f238-4152-9ec6-46582be8ed4d",
"friendly_name":"My droid",
"account_id":5769,
"start_ownership_range":"2015-06-08",
"end_ownership_range":null,
"created_at":"2015-06-08T02:05:52.141Z",
"updated_at":"2015-06-08T02:05:52.141Z",
"device_type":"Android Phone",
"can_delete": false,
"days_until_next_delete": 3
}
]
}
Response: Unauthorized
HttpStatus: 401
GET /services/content/v3/user_library/[user_id]/index
Description
Use this API to get the items in the specified user’s library.
Response Parameters
Parameter | Type | Description |
---|---|---|
item | string | The slug of the film or TV show and season. |
info[expiry] | string | The date and time when the content is no longer available to the user. |
info[quality] | string | The quality. This will either be “hd” or “sd”. |
info[available_from] | string | The date and time when the content is available to view. |
info[playback_start] | string | The date and time when the playback started. |
info[playback_end] | string | The date and time when the playback will end and can no longer be viewed. This is used in the scenario where the user has x days to start watching and y hours to finish watching once started. |
info[film_id] | number | The unique ID of the film. |
info[bonus] | number | The bonus number that relates to the film or TV Season. |
info[tv_id] | number | The unique ID of the TV show. |
info[season] | number | The season number of the TV show. |
info[episode] | number | The episode number of the TV season. |
playback_progress[completed] | bool | True if the content has been fully watched. |
playback_progress[last_played_at] | string | The date and time when the content was last viewed. |
playback_progress[length] | number | Length of the content. |
playback_progress[play_position] | number | The last position, in seconds, where the content was viewed. |
Examples
Request the Library for User 693
curl -i 'https://store.shift72.com/services/content/v3/user_library/693/index' \
-H 'x-auth-token: 023644c4043e76f4cb8cef015d22b4ad'
Response: Success
HttpStatus: 200
[
{
"item":"/film/71",
"info":{
"expiry":null,
"quality":"hd",
"available_from":"2014-10-29T22:56:50.000Z",
"film_id":71
},
"playback_progress":{
"completed":false,
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":71
}
},
{
"item":"/film/93",
"info":{
"expiry":"2015-06-30T22:16:54.830Z",
"quality":"hd",
"available_from":null,
"film_id":93
},
"playback_progress":{
"completed":false,
"length":3601,
"last_played_at":"2015-06-29T22:56:50.000Z",
"play_position":1071
}
},
{
"item":"/tv/2/season/1/episode/2",
"info":{
"expiry":null,
"quality":"hd",
"available_from":null,
"episode":2,
"season":1,
"tv_id":2
},
"playback_progress":{
"completed":true,
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":117
}
},
{
"item":"/tv/2/season/1/episode/3",
"info":{
"expiry":null,
"quality":"hd",
"available_from":null,
"episode":3,
"season":1,
"tv_id":2
},
"playback_progress":{
"completed":false,
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":71
}
},
{
"item":"/tv/2/season/1/episode/1",
"info":{
"expiry":null,
"quality":"hd",
"available_from":null,
"episode":1,
"season":1,
"tv_id":2
},
"playback_progress":{
"completed":false,
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":71
}
},
{
"item":"/tv/2/season/1/episode/4",
"info":{
"expiry":null,
"quality":"hd",
"available_from":null,
"episode":4,
"season":1,
"tv_id":2
},
"playback_progress":{
"completed":false,
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":71
}
},
{
"item":"/film/71/bonus/2",
"info":{
"expiry":null,
"quality":"hd",
"available_from":"2015-03-17T01:12:49.416Z",
"film_id":71,
"bonus":2
},
"playback_progress":{
"completed":false,
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":71
}
},
{
"item":"/film/71/bonus/1",
"info":{
"expiry":null,
"quality":"hd",
"available_from":"2014-10-23T23:30:00.000Z",
"film_id":71,
"bonus":1
},
"playback_progress":{
"completed":false,
"length":117,
"last_played_at":"2015-10-29T22:56:50.000Z",
"play_position":71
}
}
]
Response: Unauthorized
HttpStatus: 401
GET /services/content/v3/user_library/admin/[user_id]/index
Description
Use this API if you are an administrator and want to get the user library of a specific user. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
id | number | The unique library ID. |
expiry | string | The date and time, in ISO 8601 format, when the content expires. Set to null if the item never expires. |
playback_start | string | The date and time when the playback started. |
playback_end | string | The date and time when the playback will end and can no longer be viewed. This is used in the scenario where the user has x days to start watching and y hours to finish watching once started. |
created_at | string | The ISO 8601 time and date the item was added to the user’s library. |
order_id | number | The order ID that was used to make the purchase. If zero, then it was added by an administrator. |
quality | string | The quality. This will either be “hd” or “sd”. |
ownership | string | The ownership type, i.e. “buy” or “rent”. |
media_content_id | number | The unique ID of the media content. |
film_id | number | The unique ID of the film. |
tv_id | number | The unique ID of the TV show. |
season | number | The season number of the TV show. |
episode | number | The episode number of the TV season. |
bonus | number | The bonus number that relates to the film or TV Season. |
available_from | string | The date and time when the content is available to view. |
Examples
Request the Library for User 693
curl -i 'https://store.shift72.com/services/content/v3/user_library/admin/693/index' \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'
Response: Success
HttpStatus: 200
[
{
"id":68166,
"expiry":null,
"created_at":"2015-05-18T22:17:04.200Z",
"order_id":0,
"quality":"hd",
"ownership":"buy",
"media_content_id":71,
"film_id":71,
"tv_id":null,
"season":null,
"episode":null,
"bonus":null,
"available_from":"2014-10-29T22:56:50.000Z"
},
{
"id":68167,
"expiry":null,
"created_at":"2015-05-18T22:17:04.270Z",
"order_id":0,
"quality":"hd",
"ownership":"buy",
"media_content_id":409,
"film_id":71,
"tv_id":null,
"season":null,
"episode":null,
"bonus":2,
"available_from":"2015-03-17T01:12:49.416Z"
}
]
Response: Unauthorized
HttpStatus: 401
POST /services/content/v2/user_library/admin/[user_id]/create
Description
Use this API if you are an administrator and want to add an item to a user’s library. This API is only accessible to users who have the admin role.
Request Parameters
Parameter | Type | Description |
---|---|---|
item | string | The slug of the film or TV show and season. |
account_id | number | The user’s unique ID. |
order_id | number | The order ID that was used to make the purchase. If zero, then it was added by an administrator. |
quality | string | Deprecated. This will always be hd. |
ownership | string | The ownership type, i.e. “buy” or “rent”. |
expiry | string | The date and time, in ISO 8601 format, when the content expires. Set to null if the item never expires. |
Response Parameters
Parameter | Type | Description |
---|---|---|
item | string | The slug of the film or TV show and season. |
account_id | number | The user’s unique ID. |
order_id | number | The order ID that was used to make the purchase. If zero, then it was added by an administrator. |
quality | string | Deprecated. This will always be hd. |
ownership | string | The ownership type, i.e. “buy” or “rent”. |
expiry | string | The date and time, in ISO 8601 format, when the content expires. Set to null if the item never expires. |
client_id | number | Deprecated. This is no longer used. |
Examples
Add Film 91 to the Library of User 5769
curl -i 'https://store.shift72.com/services/content/v2/user_library/admin/create' \
-X POST \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{"library_item":{"item":"/film/91","account_id":5769,"order_id":0,"quality":"hd","ownership":"rent","expiry":"2015-06-16T03:22:02.338Z"}}'
Response: Success
HttpStatus: 200
{
"item":"/film/91",
"account_id":5769,
"order_id":0,
"quality":"hd",
"ownership":"rent",
"expiry":"2015-06-16T03:22:02.338Z",
"client_id":"2"
}
Response: Invalid ID
HttpStatus: 422
{
"error":"No library item found for provided id"
}
Response: Unauthorized
HttpStatus: 401
DELETE /services/content/v2/user_library/admin/[library_id]/destroy
Description
Use this API if you are an administrator and want to remove an item from a user’s library. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
success | bool | Deprecated. This is no longer used. |
error | string | A message that provides more information about the error. |
Examples
Remove the Item From the User’s Library with ID 67475
curl -i 'https://store.shift72.com/services/content/v2/user_library/admin/67475/destroy' \
-X DELETE \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'
Response: Success
HttpStatus: 200
{
"success":true
}
Response: Invalid ID
HttpStatus: 422
{
"error":"No library item found for provided id"
}
Response: Unauthorized
HttpStatus: 401
GET /services/content/v1/timings/[slug]
Description
Use this API to select all the timing records for the media content associated with the slug. These can be used by the player UI to display elements for users to interact with. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
id | number | The ID of the record. |
category | string | One of either skip_to , moment or end_of_play . |
label | string | Text to display to the user. |
time | number | Time, in seconds, when this event should occur. Fractions of seconds are accepted, e.g. 750.2. |
action | string | (end_of_play events only) The preferred action at the end of the content. Valid values are next , for the next episode in a TV season, recommendations , library or a content slug. |
destination | number | (skip_to events only) Time to skip to if the user interacts with the timing event. |
duration | number | (skip_to events only) Time the event should last. |
Examples
Request the Timings for Film 130
curl -i 'https://store.shift72.com/services/content/v1/timings/film/130' \
-H 'x-auth-token: 023644c4043e76f4cb8cef015d22b4ad'
Response: Success
HttpStatus: 200
[
{
"id":23,
"type": "end_of_play",
"label": "Watch the next episode",
"action": "next",
"time": 3600
},
{
"id": 24,
"type": "moment",
"label": "Steve falls over",
"time": 2500.25
},
{
"id": 25,
"type": "moment",
"label": "Steve falls over again",
"time": 2508.25
},
{
"id": 28,
"type": "skip_to",
"label": "Skip intro",
"time": 600,
"duration": 15,
"destination": 630
}
]
Response: Record Doesn’t Exist
HttpStatus: 422
{
"error": {
"error": "Missing matching media content record",
"code": "missing_media_content_record"
}
}
Response: Forbidden
HttpStatus: 403
{
"error": {
"error": "Not permitted",
"code": "not_permitted"
}
}
POST /services/content/v1/timings/[slug]
Description
Use this API to create a new timing event for the media content associated with the slug. This API is only accessible to users who have the admin role.
Request Parameters
Parameter | Type | Description |
---|---|---|
category | string | One of either skip_to , moment or end_of_play . |
time | number | Time, in seconds, when this event should occur. Fractions of seconds are accepted, e.g. 750.2. |
label | string | Text to display to the user. |
action | string | (end_of_play events only) The preferred action at the end of the content. Valid values are next , for the next episode in a TV season, recommendations , library or a content slug. |
destination | number | (skip_to events only) Time to skip to if the user interacts with the timing event. |
duration | number | (skip_to events only) Time the event should last. |
Response Parameters
Returns Timings.
Examples
Add a Timing for Film 130
curl -i 'https://store.shift72.com/services/content/v1/timings/film/130' \
-X POST \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8xyd' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{"category": "moment", "time": 30, "label": "Check this out"}'
Response: Success
HttpStatus: 200
{
"id": 1,
"category": "moment",
"time": 30,
"label": "Check this out"
}
Response: Forbidden
HttpStatus: 403
{
"error": {
"error": "Not permitted",
"code": "not_permitted"
}
}
Response: Slug Doesn’t Exist
HttpStatus: 422
{
"error": {
"error": "Missing matching media content record",
"code": "missing_media_content_record"
}
}
Response: Missing Category
HttpStatus: 422
{
"error": {
"error": "Validation failed: Category can't be blank",
"code": "add_error"
}
}
Response: Missing Time
HttpStatus: 422
{
"error": {
"error": "Validation failed: Time is not a number",
"code": "add_error"
}
}
Response: Time Isn’t a Positive Number
HttpStatus: 422
{
"error": {
"error": "Validation failed: Time must be greater than or equal to 0",
"code": "add_error"
}
}
Response: Missing Label
HttpStatus: 422
{
"error": {
"error": "Validation failed: Label can't be blank",
"code": "add_error"
}
}
Response: Missing Action (end_of_play
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Action can't be blank",
"code": "add_error"
}
}
Response: Unsupported Action (end_of_play
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Action Unsupported action or slug",
"code": "add_error"
}
}
Response: Missing Destination (skip_to
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Destination is not a number",
"code": "add_error"
}
}
Response: Destination Isn’t a Positive Number (skip_to
only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Destination must be greater than 0",
"code": "add_error"
}
}
Response: Missing Duration (skip_to
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Duration is not a number",
"code": "add_error"
}
}
Response: Duration Isn’t a Positive Number (skip_to
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Duration must be greater than 0",
"code": "add_error"
}
}
DELETE /services/content/v1/timings/[id]
Description
Use this API to delete a pre-existing timing event. This API is only accessible to users who have the admin role.
Examples
Delete a Timing for ID 19
curl -i 'https://store.shift72.com/services/content/v1/timings/19' \
-X DELETE \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8xyd'
Response: Success
HttpStatus: 204
Response: Record Doesn’t Exist
HttpStatus: 404
{
"error": {
"error": "Timing record not found",
"code": "record_not_found"
}
}
Response: Forbidden
HttpStatus: 403
{
"error": {
"error": "Not permitted",
"code": "not_permitted"
}
}
PUT /services/content/v1/timings/[id]
Description
Use this API to update a pre-existing timing event. This API is only accessible to users who have the admin role.
Request Parameters
The same as the Timings Create request.
Response Parameters
Returns Timings.
Examples
Update a Timing for ID 19
curl -i 'https://store.shift72.com/services/content/v1/timings/19' \
-X PUT \
-H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8xyd' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{"category": "moment", "time": 60, "label": "Check this out now!"}'
Response: Success
HttpStatus: 200
{
"id": 19,
"category": "moment",
"time": 60,
"label": "Check this out now!"
}
Response: Forbidden
HttpStatus: 403
{
"error": {
"error": "Not permitted",
"code": "not_permitted"
}
}
Response: ID Doesn’t Exist
HttpStatus: 404
{
"error": {
"error": "Timing record not found",
"code": "record_not_found"
}
}
Response: Missing Category
HttpStatus: 422
{
"error": {
"error": "Validation failed: Category can't be blank",
"code": "add_error"
}
}
Response: Missing Time
HttpStatus: 422
{
"error": {
"error": "Validation failed: Time is not a number",
"code": "add_error"
}
}
Response: Time Isn’t a Positive Number
HttpStatus: 422
{
"error": {
"error": "Validation failed: Time must be greater than or equal to 0",
"code": "add_error"
}
}
Response: Missing Label
HttpStatus: 422
{
"error": {
"error": "Validation failed: Label can't be blank",
"code": "add_error"
}
}
Response: Missing Action (end_of_play
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Action can't be blank",
"code": "add_error"
}
}
Response: Unsupported Action (end_of_play
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Action Unsupported action or slug",
"code": "add_error"
}
}
Response: Missing Destination (skip_to
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Destination is not a number",
"code": "add_error"
}
}
Response: Destination Isn’t a Positive Number (skip_to
only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Destination must be greater than 0",
"code": "add_error"
}
}
Response: Missing Duration (skip_to
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Duration is not a number",
"code": "add_error"
}
}
Response: Duration Isn’t a Positive Number (skip_to
Only)
HttpStatus: 422
{
"error": {
"error": "Validation failed: Duration must be greater than 0",
"code": "add_error"
}
}
GET /services/content/v1/availabilities/[slug]
Description
Use this API to get the availability dates for the specified item.
Unless the provided authentication token has admin permissions, only content marked as ‘published’ will be returned.
Response Parameters
Parameter | Type | Description |
---|---|---|
available_from | string | The ISO 8601 UTC time that the content is available from. |
available_to | string | The ISO 8601 UTC time that the content is available until. |
Example
Request Availability for Film 33
curl -i 'https://store.shift72.com/services/content/v1/availabilities/film/33' \
-H 'x-auth-token: 1a95b58722d5ac829ba3db8a79abc24f'
Response: Success
HttpStatus: 200
{
"available_from":"2025-04-09T21:52:00.766Z",
"available_to":"2025-05-03T00:00:00.999Z"
}
Response: Slug not found
HttpStatus: 404
{
"error":"Slug not found",
"code":"slug_not_found"
}
GET /services/content/v1/availabilities/?items=[slug],[slug]
Description
Use this API to get the availability for the specified items. This is used to determine if an item can be watched now.
Response Parameters
Parameter | Type | Description |
---|---|---|
item | string | The slug of the film or TV show and season. |
available_from | string | The ISO 8601 UTC time that the content is available from. |
ms_from | number | Number of milliseconds, at the time of request, until the content is available. |
available_to | string | The ISO 8601 UTC time that the content is available until. |
ms_to | number | Number of milliseconds, at the time of request, until the content is no longer available. |
requires_pin_code | boolean | If PIN codes are enabled, indicates whether a user should be prompted for their PIN code before purchasing, renting, or watching this content |
rental_duration_minutes | number | How long a user has access to an item once purchased/rented in minutes. If film/tv season doesn’t have a rental duration, then a site-wide duration will be applied. Episodes will have the same rental duration as the season or site-wide rental duration if the season doesn’t have a rental duration. The same goes for bonus contents. |
rental_playback_duration_minutes | number | How long a user has access to an item once they click play in minutes. This is a site-wide setting. |
Examples
Request Availability for Films 64 and 71
curl -i 'https://store.shift72.com/services/content/v1/availabilities/?items=/film/64,/film/71'
Response: Success
HttpStatus: 200
[
{
"slug":"/film/64",
"from":"2015-04-09T21:52:00.766Z",
"ms_from":0,
"to":"2015-08-10T14:00:00.000Z",
"ms_to":43346182.062781,
"requires_pin_code": true,
"rental_duration_minutes": 240,
"rental_playback_duration_minutes": 120
},
{
"slug":"/film/71",
"from":"2015-09-21T21:05:00.000Z",
"ms_from":3698607081.229939,
"to":null,
"ms_to":null,
"requires_pin_code": false,
"rental_duration_minutes": 240,
"rental_playback_duration_minutes": 120
}
]
PUT /services/content/v1/availabilities/[slug]
Description
Use this API to update the availability dates for the specified item.
If the cascade
parameter is set to true
, these dates will also be applied to any children items (i.e. a film’s bonus items; seasons, episodes and bonus items for a tv show; and all episodes for a tv season).
Request Parameters
Parameter | Type | Description |
---|---|---|
available_from | string | The ISO 8601 UTC time that the content is available from. |
available_to | string | The ISO 8601 UTC time that the content is available until. |
cascade | boolean | Indicates whether the availability dates should be applied to related content. |
Response Parameters
Parameter | Type | Description |
---|---|---|
available_from | string | The ISO 8601 UTC time that the content is available from. |
available_to | string | The ISO 8601 UTC time that the content is available until. |
Examples
Request Availability for Film 33
curl -i 'https://store.shift72.com/services/content/v1/availabilities/film/33' \
-H 'x-auth-token: 1a95b58722d5ac829ba3db8a79abc24f' \
-H 'content-type: application/json;charset=UTF-8' \
--data-binary '{"available_from": "2025-01-01T00:00:00Z", "available_to": "2025-12-31T23:59:59Z", "cascade": true }'
Response: Success
HttpStatus: 200
{
"available_from":"2025-01-01T00:00:00Z",
"available_to":"2025-12-31T23:59:59Z"
}
Response: Request not authorised
HttpStatus: 401
{
"error":"Request not authorised",
"code": "request_not_authorised"
}
Response: Missing parameters
HttpStatus: 422
{
"error":"Missing available_from",
"code": "missing_available_from"
}
HttpStatus: 422
{
"error":"Missing available_to",
"code": "missing_available_to"
}
Response: available_from is after available_to
HttpStatus: 422
{
"error":"Available from should be earlier than available to",
"code": "available_from_after_available_to"
}
Response: Record not found
HttpStatus: 404
{
"error":"Matching record not found",
"code": "record_not_found"
}
GET /services/content/v1/devices/[device]/version/[ver_num]/check
Description
This API is used by devices to check the status of their version to determine if they need to be updated. Currently the device can be either “ipad” or “android”.
Response Parameters
Parameter | Type | Description |
---|---|---|
status | string | The supported status. See below for definitions. |
Status Types
Status | Description |
---|---|
blocked | This version is no longer supported and must be updated. |
request_update | This version is supported but a newer update is available. |
refresh | This version is supported and will automatically refresh the meta data. |
supported | This version is supported. |
Examples
Check Version 1.0.0 for iPad
curl -i 'https://store.shift72.com/services/content/v1/devices/ipad/version/1.0.0/check'
Response: Success
HttpStatus: 200
{
"status":"supported"
}
GET services/content/v2/media_encoding/index
Description
Use this API to get the media encodings. This API is only accessible to users who have the admin role.
Response Parameters
Parameter | Type | Description |
---|---|---|
id | number | The unique media encoding ID. |
media_content_id | number | The ID of the media content. |
content_encoding_id | string | The type of media encoding. |
drm_id | number | The type of DRM used. 0 = no DRM, 2 = Widevine. |
location | string | The location of the media content. This needs to be appended to base_url to get the full path to the media content. |
width | number | The width of the media content. |
height | number | The height of the media content. |
bitrate | number | The bitrate of the media content. |
drm_key | string | The DRM key of the media content. |
file_size | number | The size of the file in bytes. |
origin_url | string | The url of where the encoding output is stored. |
is_live | bool | Determines if this media content is live. |
updated_at | string | The ISO 8601 time and date the item was last updated. |
created_at | string | The ISO 8601 time and date the item was created. |
Examples
Get the Media Encodings
curl -i 'https://store.shift72.com/services/content/v2/media_encoding/index' \
-H 'x-auth-token: 111be3e60a6a236c875a014e30013748'
Response: Success
HttpStatus: 200
{
"media_encoding":[
{
"id":639,
"media_content_id":284,
"content_encoding_id":"hd_trailer",
"drm_id":0,
"location":"/8bad40e2-dac2-47d0-b544-0a469abc4e08/season_1_576_2000_trailer_kb_trailer_HD.mp4",
"created_at":"2015-03-04T05:58:17.526Z",
"updated_at":"2015-03-04T05:58:17.526Z",
"width":1024,
"height":576,
"bitrate":2104,
"drm_key":"None",
"file_size":15815774,
"origin_url":"s3://s72-media-encoded-us-east-1/8bad40e2-dac2-47d0-b544-0a469abc4e08/season_1_576_2000_trailer_kb.mp4",
"is_live":false
},
{
"id":653,
"media_content_id":178,
"content_encoding_id":"hd_download",
"drm_id":2,
"location":"/7a3ecc88-5aab-44b1-be4a-aa49da9d3231/dash_test_film_-_cf1_720_3600_kb_download_HD.wvm",
"created_at":"2015-03-04T21:06:46.448Z",
"updated_at":"2015-03-04T21:06:46.448Z",
"width":1280,
"height":720,
"bitrate":2116,
"drm_key":"27852068",
"file_size":11819418,
"origin_url":"s3://s72-media-encoded-us-east-1/7a3ecc88-5aab-44b1-be4a-aa49da9d3231/dash_test_film_-_cf1_720_3600_kb.mp4",
"is_live":false
},
{
"id":655,
"media_content_id":178,
"content_encoding_id":"hd_stream",
"drm_id":2,
"location":"/7a3ecc88-5aab-44b1-be4a-aa49da9d3231/dash_test_film_-_cf1_576_1000_kb_adaptive_SD.wvm",
"created_at":"2015-03-04T21:07:19.569Z",
"updated_at":"2015-03-04T21:07:19.569Z",
"width":1024,
"height":576,
"bitrate":1153,
"drm_key":"27852068",
"file_size":25642826,
"origin_url":"s3://s72-media-encoded-us-east-1/7a3ecc88-5aab-44b1-be4a-aa49da9d3231/dash_test_film_-_cf1_576_1000_kb.mp4",
"is_live":false
},
{
"id":785,
"media_content_id":339,
"content_encoding_id":"hd_stream",
"drm_id":2,
"location":"/0de3069d-a481-486f-bf8e-17c3ddc8c95b/bonus_behind_the_scenes_576_1000_kb_adaptive_SD.wvm",
"created_at":"2015-03-17T21:59:58.087Z",
"updated_at":"2015-03-17T21:59:58.087Z",
"width":320,
"height":174,
"bitrate":570,
"drm_key":"28263967",
"file_size":29969482,
"origin_url":"s3://s72-media-encoded-us-east-1/0de3069d-a481-486f-bf8e-17c3ddc8c95b/bonus_behind_the_scenes_576_1000_kb.mp4",
"is_live":false
}
]
}
Response: Unauthorized
HttpStatus: 401
GET /services/content/v1/playback_progress/[user_id]
Description
Use this API to get the playback progress for all of the user’s content. This is limited to the last 800 items watched.
Response Parameters
Parameter | Type | Description |
---|---|---|
item | string | The slug of the film or TV show and season. |
completed | bool | True if the content has been fully watched. |
last_played_at | string | The ISO 8601 date and time when the content was last viewed. |
length | number | Length of the content. |
play_position | number | The last position, in seconds, where the content was viewed. |
Examples
Request the Playback Progress for User 285
curl -i 'https://store.shift72.com/services/content/v1/playback_progress/285' \
-H 'x-auth-token: bcb58244a4a3112a11304d44fc7c7781'
Response: Success
HttpStatus: 200
[
{
"play_position": 0,
"length": 150,
"item": "/tv/41/season/1/episode/2",
"completed": false,
"last_played_at": null
},
{
"play_position": 0,
"length": 50,
"item": "/tv/32/season/1/episode/1",
"completed": false,
"last_played_at": "2016-04-05T02:02:40.108Z"
},
{
"play_position": 150,
"length": 150,
"item": "/film/42",
"completed": true,
"last_played_at": "2016-02-26T02:35:26.631Z"
}
]
Response: Unauthorized
HttpStatus: 401
GET /services/content/v1/user_plans
Description
Use this API to get the active plans the user is subscribed to.
Response Parameters
Parameter | Type | Description |
---|---|---|
plan_id | number | The ID of the plan the user is subscribed to. |
expiry | string | The ISO 8601 date and time when the plan expires. |
Examples
Request the Plans the User is Subscribed to
curl -i 'https://store.shift72.com/services/content/v1/user_plans' \
-H 'x-auth-token: e8c29251eb415ba4caa0e82ad062c488'
Response: Success
HttpStatus: 200
[
{
"plan_id":1,
"expiry":"2015-07-31T00:00:00.000Z"
}
]
Response: Unauthorized
HttpStatus: 401
GET /services/content/v1/user_plans/[user_id]
Description
Use this API to get the plans a specified user is subscribed to.
Response Parameters
A list of plan objects containing the following attributes:
Parameter | Type | Description |
---|---|---|
plan_id | number | The ID of the plan the user is subscribed to. |
expiry | string | The ISO 8601 date and time when the plan expires. |
A plan which never expires will return an expiry
with the value null
.
Examples
Request the Plans a User is Subscribed to
curl -i 'https://store.shift72.com/services/content/v1/user_plans/467281' \
-H 'x-auth-token: e8c29251eb415ba4caa0e82ad062c488'
Response: Success
HttpStatus: 200
[
{
"plan_id":1,
"expiry":"2015-07-31T00:00:00.000Z"
}
]
Response: Unauthorized
HttpStatus: 401
POST /services/content/v1/user_plans/[user_id]
Description
Use this API to update a list of plans which a user is subscribed to.
Request Parameters
A list of objects with the following parameters:
Parameter | Type | Description |
---|---|---|
plan_id | number | The ID of the plan to which the user should be subscribed. |
expiry | string | TheISO 8601 date and time when the plan expires. |
If the value of expiry
is null
, this is interpreted to mean the plan has no expiry date.
Response Parameters
A list of all the updated/created records, with the following parameters:
Parameter | Type | Description |
---|---|---|
plan_id | number | The ID of the plan the user is subscribed to. |
expiry | string | The ISO 8601 date and time when the plan expires. |
Examples
Update the Plans the User is Subscribed to
curl -i 'https://store.shift72.com/services/content/v1/user_plans/48458' \
-H 'x-auth-token: e8c29251eb415ba4caa0e82ad062c4xx'
--data-binary '[
{ "plan_id: 39", "expiry": "2019-10-30T07:27:58.768Z" },
{ "plan_id: 52", "expiry": null }
]'
Response: Success
HttpStatus: 200
[
{
"plan_id":39,
"expiry":"2019-10-30T07:27:58.768Z"
},
{
"plan_id":52,
"expiry":null
}
]
Response: Unauthorized
HttpStatus: 401