Content Service

The content service manages the ingestion and playback of video content.

Summary: Get the ad definition for the specified item
Authentication: None
                      GET /services/content/v1/ad/vmap/[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
Summary: Update the ad definition for the specified item
Authentication: None
                      PUT /services/content/v1/ad/vmap/[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
Summary: Request the VMAP for the specified item
Authentication: None
                      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"/>
Summary: Request content configuration settings
Authentication: None
                      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 '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"
}
Summary: Request admin configuration settings
Authentication: X-Auth Admin
                      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
Summary: Update admin configuration settings
Authentication: X-Auth Admin
                      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
Summary: Get the uploaded source files
Authentication: X-Auth Admin
                      GET /services/content/ingestion/v2/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.
ETag string HTTP ETag.
Size number The size of the file in bytes.
StorageClass string The type of storage. This will be STANDARD.
Owner[DisplayName] string The owner of the S3 bucket.
Owner[ID] string The unique ID of the owner of the S3 bucket.
Bucket string The name of the S3 bucket.

Profiles

Parameter Type Description
friendly_name string The name of the profile.
description string Description of what the profile does.
name string The internal name of the profile.

Examples

Get the Source Files

curl 'https://store.shift72.com/services/content/ingestion/v2/source' \
  -H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'

Response: Success

HttpStatus: 200
{  
  "files":[  
    {  
      "Key":"Ambrosia_HD.mp4",
      "LastModified":"2014-09-15T22:30:42.000Z",
      "ETag":"\"027f0dd5a0dc8225a7bfa3cf54b18969\"",
      "Size":22492027,
      "StorageClass":"STANDARD",
      "Owner":{  
        "DisplayName":"david",
        "ID":"d147f3457ee45c44aaff60416d80ce26d3963ddb1d4cf9921b422ae4adef52d5"
      },
      "Bucket":"s72-client-2"
    },
    {  
      "Key":"Andy-Made-A-Friend_HD.mp4",
      "LastModified":"2014-09-15T22:26:28.000Z",
      "ETag":"\"66c512eb4ff5102566ef06d3219187d5\"",
      "Size":10683736,
      "StorageClass":"STANDARD",
      "Owner":{  
        "DisplayName":"david",
        "ID":"d147f3457ee45c44aaff60416d80ce26d3963ddb1d4cf9921b422ae4adef52d5"
      },
      "Bucket":"s72-client-2"
    },
    {  
      "Key":"Blood-Brothers_HD.mp4",
      "LastModified":"2014-09-15T22:26:10.000Z",
      "ETag":"\"beea25f83fccd1d32ed740fdde78cf29\"",
      "Size":21138034,
      "StorageClass":"STANDARD",
      "Owner":{  
        "DisplayName":"david",
        "ID":"d147f3457ee45c44aaff60416d80ce26d3963ddb1d4cf9921b422ae4adef52d5"
      },
      "Bucket":"s72-client-2"
    }
  ],
  "profiles":[  
    {  
      "friendly_name":"Adaptive with DRM SD",
      "description":"Adaptive SD Streaming - creates an SD download, and a SD stream.",
      "name":"adaptive-sd"
    },
    {  
      "friendly_name":"Experimental - Adaptive with DRM",
      "description":"Experimental encoding.",
      "name":"nzfcadaptive-experimental"
    },
    {  
      "friendly_name":"Adaptive with DRM",
      "description":"Adaptive HD Streaming - creates an HD download, SD and HD adaptive streams.",
      "name":"nzfcadaptive"
    },
    {  
      "friendly_name":"Trailer - 5 minute",
      "description":"Creates a single encoding limited to 5 minutes long.",
      "name":"nzfctrailer-feature"
    },
    {  
      "friendly_name":"Trailer - 1 minute",
      "description":"Creates a single encoding limited to 60 seconds long.",
      "name":"nzfctrailer-short"
    },
    {  
      "friendly_name":"Trailer - Full",
      "description":"Creates a single encoding without DRM for the entire film.",
      "name":"nzfctrailer"
    }
  ]
}

Response: Unauthorized

HttpStatus: 401
Summary: Start an ingestion job
Authentication: X-Auth Admin
                      POST /services/content/ingestion/v2/start_job
                    

Description

Use this API 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.
base_filename string Name to be used in the name of the ingested file.
profile string The profile to use in this ingestion job.
notify string URL of the path that will be notified when the job is completed.

Response Parameters

Parameter Type Description
id string The unique ID of the ingestion job.
encoder_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/v2/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","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: Unauthorized

HttpStatus: 401
Summary: Get the ingestion status of the specified item
Authentication: X-Auth Admin
                      GET services/content/ingestion/v2/status?notify=[slug]
                    

Description

Use this API to get the ingestion status of the specified item. This API is only accessible to users who have the admin role.

Response Parameters

Parameter Type Description
id string The unique ID of the ingestion job.
status string The status of the ingestion job.
notify string URL of the path that will be notified when the job is completed.
encoder_id string The unique ID provided by the encoder.
encoder_profile string The profile that was used for the encoding job.
last_updated string The ISO 8601 time and date the file was last updated.
Summary string Overview of the ingestion job.

Subtasks

Parameter Type Description
id string The unique ID of the ingestion job.
status string The status of the ingestion job.
label string An identifiable label of the encoding type.
last_updated string The ISO 8601 time and date the file was last

Examples

Get the Ingestion Status of Film 92

curl -i 'https://store.shift72.com/services/content/ingestion/v2/status?notify=/film/92' \
  -H 'x-auth-token: 1a1f4363bac4df5ba34758945fae8d0d'

Response: Success

HttpStatus: 200
[
  {
    "id": "043ffa3d-bb80-4e4b-9125-2026c5012180",
    "status": "completed",
    "notify": "https://store.shift72.com/services/content/v2/media_encoding/film/92",
    "encoder_id": "129236149",
    "encoder_profile": "adaptive-sd",
    "last_updated": "2015-02-17T01:20:18.827Z",
    "subtasks": [
      {
        "id": "043ffa3d-bb80-4e4b-9125-2026c5012180_1_HD_trailer",
        "status": "completed",
        "label": "HD trailer",
        "last_updated": "2014-12-02T00:51:52"
      },
      {
        "id": "043ffa3d-bb80-4e4b-9125-2026c5012180_2_HD_dl",
        "status": "completed",
        "label": "HD download",
        "last_updated": "2014-12-02T00:50:53"
      },
      {
        "id": "043ffa3d-bb80-4e4b-9125-2026c5012180_3_HD_stream",
        "status": "completed",
        "label": "HD stream",
        "last_updated": "2014-12-02T00:51:24"
      }
    ],
    "summary": "3/3 sub tasks are completed."
  },
  {
    "id": "a44d1e66-f68c-4bab-9826-c5efa4ae2b81",
    "status": "completed",
    "notify": "https://store.shift72.com/services/content/v2/media_encoding/film/92",
    "encoder_id": "129241768",
    "encoder_profile": "nzfctrailer",
    "last_updated": "2015-02-17T01:20:18.763Z",
    "subtasks": [
      {
        "id": "a44d1e66-f68c-4bab-9826-c5efa4ae2b81_1_HD_trailer",
        "status": "completed",
        "label": "HD trailer",
        "last_updated": "2014-12-02T01:36:14"
      }
    ],
    "summary": "1/1 sub tasks are completed."
  },
  {
    "id": "520bfa08-033a-421b-9608-5d1a135eb7c9",
    "status": "completed",
    "notify": "https://store.shift72.com/services/content/v2/media_encoding/film/92",
    "encoder_id": "115325718",
    "encoder_profile": "nzfcadaptive",
    "last_updated": "2014-09-18T08:48:18.034Z",
    "subtasks": [
      {
        "id": "520bfa08-033a-421b-9608-5d1a135eb7c9_HD_stream",
        "status": "completed",
        "label": "HD stream",
        "last_updated": "2014-09-18T09:00:56"
      },
      {
        "id": "520bfa08-033a-421b-9608-5d1a135eb7c9_HD_dl",
        "status": "completed",
        "label": "HD download",
        "last_updated": "2014-09-18T08:54:04"
      },
      {
        "id": "520bfa08-033a-421b-9608-5d1a135eb7c9_HD_trailer",
        "status": "completed",
        "label": "HD trailer",
        "last_updated": "2014-09-18T09:04:05"
      },
      {
        "id": "520bfa08-033a-421b-9608-5d1a135eb7c9_5_HD_dash",
        "status": "completed",
        "label": "HD dash",
        "last_updated": "2015-01-07T01:18:02"
      }
    ],
    "summary": "4/4 sub tasks are completed."
  },
  {
    "id": "947c0957-0f37-48d0-a9b5-e5f6d3c44700",
    "status": "completed",
    "notify": "https://store.shift72.com/services/content/v2/media_encoding/film/92",
    "encoder_id": "115325690",
    "encoder_profile": "nzfctrailer",
    "last_updated": "2014-09-18T08:47:59.105Z",
    "subtasks": [
      {
        "id": "947c0957-0f37-48d0-a9b5-e5f6d3c44700_HD_trailer",
        "status": "completed",
        "label": "HD trailer",
        "last_updated": "2014-09-18T08:51:26"
      }
    ],
    "summary": "1/1 sub tasks are completed."
  }
]

Response: Unauthorized

HttpStatus: 401
Summary: Request information to download content
Authentication: X-Auth, X-Play
                      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. Stream encoding_type is used for browsers that support Flash and Widevine Classic, which is currently Safari and Internet Explorer 10. 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.

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, 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.

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'

Request the Download Information for TV 2, Season 1, Episode 1 Using Play Token

curl -i 'https://store.shift72.com/services/content/v4/media_content/download/tv/2/season/1/episode/1?encoding_type=download' \
  -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"
}

Response: Flash Success

HttpStatus: 200
{  
  "play_session":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c3IiOjEsInVpZCI6IlNISUZUNzIiLCJleHAiOjE0NjgwMzczMTIsImNpZCI6Miwic2x1ZyI6Ii9maWxtLzUyIn0.LaPLncFTncOXRyCUcSseV_OgKjVHNYB74Xdy8_LSGgs",
  "streams":[  
    {  
      "url":"https://indiereign02-a.akamaihd.net/5f0298ea-9b8c-4577-a50a-b845fa07e661/blood_and_water_720_1500_kb_adaptive_HD.wvm",
      "width":1280,
      "height":720,
      "bitrate":1611,
      "encoding_type":"hd_download",
      "drm_key_encoded":"MjUwNjA2Mjc=\n"
    }
  ]
}

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."
}
Summary: Get media content
Authentication: X-Auth Admin
                      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.

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 '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,
    "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
Summary: Delete media content
Authentication: X-Auth Admin
                      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
Summary: Update media content
Authentication: X-Auth Admin
                      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,
      "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,
    "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
Summary: Request information to play content
Authentication: X-Auth, X-Play
                      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. Stream encoding_type is used for browsers that support Flash and Widevine Classic, which is currently Safari and Internet Explorer 10. 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.

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, 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.

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 Flash 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?encoding_type=stream' \
  -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"
}

Response: Flash Success

HttpStatus: 200
{  
  "play_session":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c3IiOjEsInVpZCI6IlNISUZUNzIiLCJleHAiOjE0NjgwMzczMTIsImNpZCI6Miwic2x1ZyI6Ii9maWxtLzUyIn0.LaPLncFTncOXRyCUcSseV_OgKjVHNYB74Xdy8_LSGgs",
  "streams":[  
    {  
      "url":"https://indiereign02-a.akamaihd.net/5f0298ea-9b8c-4577-a50a-b845fa07e661/blood_and_water_720_1500_kb_adaptive_HD.wvm",
      "width":1280,
      "height":720,
      "bitrate":1611,
      "encoding_type":"hd_stream",
      "drm_key_encoded":"MjUwNjA2Mjc=\n"
    },
    {  
      "url":"https://indiereign02-a.akamaihd.net/5f0298ea-9b8c-4577-a50a-b845fa07e661/blood_and_water_480_1000_kb_adaptive_SD.wvm",
      "width":848,
      "height":476,
      "bitrate":1118,
      "encoding_type":"hd_stream",
      "drm_key_encoded":"MjUwNjA2Mjc=\n"
    }
  ]
}

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."
}
Summary: Request a play token for content
Authentication: X-Auth Admin
                      POST /services/content/v3/media_content/play_token/[slug]
                    

Description

Use this API to get the play token for the specified item. Returns a JWT with the encoded request parameters that are listed below. Any other primitive parameters (string, numbers, booleans) will also be added to the generated token. e.g. Adding an age, or gender property so that you can track those demographics via the telemetry requests. The API also adds additional “cid” and “slug” parameters to the payload which denotes the client_id in the SHIFT72 database and the content id respectively. Therefore any request parameter called “cid” or “slug” will be overridden. 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.
uid string Optional. Text to overlay as a watermark over the playback experience.
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.

Response Parameters

Returns a JWT with the above information including some meta data to support the DRM.

Examples

Request a Play Token for Film 71

curl -i 'https://store.shift72.com/services/content/v3/media_content/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":"2016-07-09T04:08:32.852Z"
  }'

Response: Success

HttpStatus: 200
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzbHVnIjoiL2ZpbG0vMTI1IiwidXNyIjoxMjM0NSwidWlkIjoiU0hJRlQ3MiIsImV4cCI6MTQzNjQxNDkxMiwiY2lkIjoiMiJ9.VbtYGDjWQBuJH2d6NgJOFY1Rjo5uXiAsMKcuuoPtpYw"

Response: Unauthorized

HttpStatus: 401

Response: Forbidden - Content Doesn’t Belong to Client

HttpStatus: 403
{
  "error":"content does not belong to client"
}
Summary: List the possible S3 buckets to upload to.
Authentication: None
                      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"
   }
]
Summary: Invitation to upload content
Authentication: X-Auth Admin
                      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 '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
Summary: View the invitations that have been sent
Authentication: X-Auth Admin
                      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
Summary: Delete an invitation
Authentication: X-Auth Admin
                      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"
}
Summary: View the status of an invitation
Authentication: None
                      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"
}
Summary: Remove a registered device for the specified user
Authentication: X-Auth
                      DELETE /services/content/v1/user_devices/[user_id]
                    

Description

Use this API to deregister a device from 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.

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
Summary: Get registered devices for a user
Authentication: X-Auth
                      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”

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"
    },
    {  
      "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"
    }
  ]
}

Response: Unauthorized

HttpStatus: 401
Summary: Request the items in the user's library
Authentication: X-Auth
                      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 Deprecated. This will always be hd.
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.

Examples

Request the Library for User 693

curl '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
    }
  },
  {  
    "item":"/film/93",
    "info":{  
      "expiry":"2015-06-30T22:16:54.830Z",
      "quality":"hd",
      "available_from":null,
      "film_id":93
    }
  },
  {  
    "item":"/tv/2/season/1/episode/2",
    "info":{  
      "expiry":null,
      "quality":"hd",
      "available_from":null,
      "episode":2,
      "season":1,
      "tv_id":2
    }
  },
  {  
    "item":"/tv/2/season/1/episode/3",
    "info":{  
      "expiry":null,
      "quality":"hd",
      "available_from":null,
      "episode":3,
      "season":1,
      "tv_id":2
    }
  },
  {  
    "item":"/tv/2/season/1/episode/1",
    "info":{  
      "expiry":null,
      "quality":"hd",
      "available_from":null,
      "episode":1,
      "season":1,
      "tv_id":2
    }
  },
  {  
    "item":"/tv/2/season/1/episode/4",
    "info":{  
      "expiry":null,
      "quality":"hd",
      "available_from":null,
      "episode":4,
      "season":1,
      "tv_id":2
    }
  },
  {  
    "item":"/film/71/bonus/2",
    "info":{  
      "expiry":null,
      "quality":"hd",
      "available_from":"2015-03-17T01:12:49.416Z",
      "film_id":71,
      "bonus":2
    }
  },
  {  
    "item":"/film/71/bonus/1",
    "info":{  
      "expiry":null,
      "quality":"hd",
      "available_from":"2014-10-23T23:30:00.000Z",
      "film_id":71,
      "bonus":1
    }
  }
]

Response: Unauthorized

HttpStatus: 401
Summary: Get the user's library as an administrator
Authentication: X-Auth Admin
                      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 Deprecated. This will always be hd.
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 '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
Summary: Add an item to the user's library
Authentication: X-Auth Admin
                      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
Summary: Delete an item from the user's library
Authentication: X-Auth Admin
                      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
Summary: Request the time when content can be played for multiple films and TV seasons
Authentication: None
                  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.

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
  },
  {  
    "slug":"/film/71",
    "from":"2015-09-21T21:05:00.000Z",
    "ms_from":3698607081.229939,
    "to":null,
    "ms_to":null
  }
]
Summary: Check if a specific version of an app is supported on the specified device
Authentication: None
                  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 'https://store.shift72.com/services/content/v1/devices/ipad/version/1.0.0/check'

Response: Success

HttpStatus: 200
{  
  "status":"supported"
}
Summary: Get media encodings
Authentication: X-Auth Admin
                  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
Summary: Request the plans the user is subscribed to
Authentication: X-Auth
                  GET /services/content/v1/user_plans
                

Description

Use this API to get the 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