How to Use Cinema8 Data API?

Data API

This section explains the basics of how to use the Cinema8 Data API component of Cinema8 Player. It uses the same interface for HTML5 versions of the player.

Setup

Creating API Key
You can create an API key in the Advanced section of your Account Settings.


Making Requests:

Host:           https://cinema8.com/api/v1

Headers:    Authorization: Bearer <base_64_encoded(API_KEY)>

Project

Project:list
Returns list of project. This request supports paging and sorting.
POST https://cinema8.com/api/v1/scene/list
Response:
{
  "totalRecords": 62,
  "resultSet": [
    {
      "id": 1800,
      "hashId": "YVX3ZZD4",
      "name": "Demo-01",
      "description": "Demo-01 Description",
      "mediaContent": {
        "id": 1352,
        "mediaPlatform": "STREAMX",
        "name": "SampleVideo_1280x720_5mb.mp4",
        "entryStatus": null,
        "duration": null,
        "url": null,
        "thumbnail": null,
        "entryId": "0_xqsmyhxo",
        "mediaType": null,
        "mediaSourceType": null,
        "hashId": null
      },
      "remoteRef": null,
      "autoplay": true,
      "tracks": null,
      "uuid": "097d2201-6b5f-42d8-9080-f8fea6c712a0",
      "image": {
        "id": 2452,
        "version": null,
        "status": "ACTIVE",
        "selected": false,
        "organisation": null,
        "name": null,
        "fileHash": null,
        "folder": false,
        "fileSize": null,
        "url": "https://ivideo-streamx-io.akamaized.net/gallery/50/155aa3d8-e0c2-494f-ada7-7826c2219741/16",
        "createdBy": null,
        "createdAt": null,
        "mimeType": null,
        "hasChild": false,
        "uuid": null,
        "imageTagList": null
      },
      "showTrackMark": true,
      "showShareIcon": true,
      "retakeable": true,
      "anonymousAllowed": true,
      "layers": null,
      "subtitles": null,
      "scenePlayer": {
        "id": 1800,
        "hideSeekBar": false,
        "hideTimer": false,
        "hidePlayPauseButton": false,
        "hideVolume": false,
        "hideFullScreen": false
      },
      "tags": [
        {
          "id": 601,
          "value": "cinema8"
        },
        {
          "id": 552,
          "value": "demo"
        }
      ],
      "createdAt": 1484203906915,
      "duration": 30
    }
  ]
}
Project:get
Returns project for given project id
GET https://cinema8.com/api/v1/scene/<id>
Response:
{
  "id": 1800,
  "hashId": "YVX3ZZD4",
  "name": "Demo-01",
  "description": "Demo-01 Description",
  "mediaContent": {
    "id": 1352,
    "mediaPlatform": "STREAMX",
    "name": "SampleVideo_1280x720_5mb.mp4",
    "entryStatus": null,
    "duration": null,
    "url": "http://s1.fexcdn.streamx.io/p/101/sp/10100/serveFlavor/entryId/0_xqsmyhxo/v/2/flavorId/0_mpmcf8x1/fileName/SampleVideo_1280x720_5mb_(HD_720_-_WEB_(H264_2500)).mp4/name/a.mp4",
    "thumbnail": null,
    "entryId": "0_xqsmyhxo",
    "mediaType": null,
    "mediaSourceType": null,
    "hashId": null
  },
  "remoteRef": null,
  "autoplay": true,
  "tracks": [
    {
      "id": 2850,
      "sceneId": null,
      "name": null,
      "start": 650,
      "end": 6990,
      "trackType": "IMAGE",
      "skippable": true,
      "dataProp": "{\"id\":\"2850\",\"left\":\"68.5%\",\"top\":\"10.625965996908809%\",\"height\":\"28.90262751159196%\",\"width\":\"19.93913043478261%\",\"bottom\":\"auto\",\"zIndex\":1000,\"background\":\"\"}",
      "layerId": 2600,
      "layerIndex": 0,
      "trackActions": [

      ],
      "image": {
        "id": 2453,
        "version": null,
        "status": "ACTIVE",
        "selected": false,
        "organisation": null,
        "name": null,
        "fileHash": null,
        "folder": false,
        "fileSize": null,
        "url": "https://ivideo-streamx-io.akamaized.net/gallery/50/58d6748b-e4bc-4753-899a-ddd1c564efdf/user.png",
        "createdBy": null,
        "createdAt": null,
        "mimeType": null,
        "hasChild": false,
        "uuid": null,
        "imageTagList": null
      },
      "inEffect": "SPLASH_IN",
      "outEffect": "SPLASH_OUT"
    },
    {
      "id": 2851,
      "sceneId": null,
      "name": null,
      "start": 1430,
      "end": 8470,
      "trackType": "IMAGE",
      "skippable": true,
      "dataProp": "{\"id\":\"2851\",\"left\":\"13.355978260869566%\",\"top\":\"80.17774343122102%\",\"height\":\"19.165378670788254%\",\"width\":\"67.15652173913044%\",\"bottom\":\"auto\",\"zIndex\":999,\"background\":\"\"}",
      "layerId": 2601,
      "layerIndex": 1,
      "trackActions": [

      ],
      "image": {
        "id": 2454,
        "version": null,
        "status": "ACTIVE",
        "selected": false,
        "organisation": null,
        "name": null,
        "fileHash": null,
        "folder": false,
        "fileSize": null,
        "url": "https://ivideo-streamx-io.akamaized.net/gallery/50/3a222efe-8d12-4b53-a748-927c382f1d84/bn.png",
        "createdBy": null,
        "createdAt": null,
        "mimeType": null,
        "hasChild": false,
        "uuid": null,
        "imageTagList": null
      },
      "inEffect": "SLIDE_LEFT_IN",
      "outEffect": "SLIDE_RIGHT_OUT"
    }
  ],
  "uuid": "097d2201-6b5f-42d8-9080-f8fea6c712a0",
  "image": {
    "id": 2452,
    "version": null,
    "status": "ACTIVE",
    "selected": false,
    "organisation": null,
    "name": null,
    "fileHash": null,
    "folder": false,
    "fileSize": null,
    "url": "https://ivideo-streamx-io.akamaized.net/gallery/50/155aa3d8-e0c2-494f-ada7-7826c2219741/16",
    "createdBy": null,
    "createdAt": null,
    "mimeType": null,
    "hasChild": false,
    "uuid": null,
    "imageTagList": null
  },
  "showTrackMark": true,
  "showShareIcon": true,
  "retakeable": true,
  "anonymousAllowed": true,
  "layers": [
    {
      "layerId": 2600,
      "layerIndex": 0,
      "layerName": "Layer 0"
    },
    {
      "layerId": 2601,
      "layerIndex": 1,
      "layerName": "Layer 1"
    }
  ],
  "subtitles": [
    {
      "id": null,
      "data": null,
      "isoLang": "en",
      "lang": "English",
      "dataProp": null,
      "subtitle": null
    },
    {
      "id": null,
      "data": null,
      "isoLang": "tr",
      "lang": "Turkish",
      "dataProp": null,
      "subtitle": null
    }
  ],
  "scenePlayer": {
    "id": 1800,
    "hideSeekBar": false,
    "hideTimer": false,
    "hidePlayPauseButton": false,
    "hideVolume": false,
    "hideFullScreen": false
  },
  "tags": null,
  "createdAt": 1484203906915,
  "duration": 30
}
Project:getWithoutTracks
Returns simple project object for given project id
GET https://cinema8.com/apiv1/scene/simple/<id>
Response:
{
  "id": 1800,
  "hashId": "YVX3ZZD4",
  "name": "Demo-01",
  "description": "Demo-01 Description",
  "mediaContent": {
    "id": 1352,
    "mediaPlatform": "STREAMX",
    "name": "SampleVideo_1280x720_5mb.mp4",
    "entryStatus": null,
    "duration": null,
    "url": "http://s1.fexcdn.streamx.io/p/101/sp/10100/serveFlavor/entryId/0_xqsmyhxo/v/2/flavorId/0_mpmcf8x1/fileName/SampleVideo_1280x720_5mb_(HD_720_-_WEB_(H264_2500)).mp4/name/a.mp4",
    "thumbnail": null,
    "entryId": "0_xqsmyhxo",
    "mediaType": null,
    "mediaSourceType": null,
    "hashId": null
  },
  "remoteRef": null,
  "autoplay": true,
  "tracks": null,
  "uuid": "097d2201-6b5f-42d8-9080-f8fea6c712a0",
  "image": {
    "id": 2452,
    "version": null,
    "status": "ACTIVE",
    "selected": false,
    "organisation": null,
    "name": null,
    "fileHash": null,
    "folder": false,
    "fileSize": null,
    "url": "https://ivideo-streamx-io.akamaized.net/gallery/50/155aa3d8-e0c2-494f-ada7-7826c2219741/16",
    "createdBy": null,
    "createdAt": null,
    "mimeType": null,
    "hasChild": false,
    "uuid": null,
    "imageTagList": null
  },
  "showTrackMark": true,
  "showShareIcon": true,
  "retakeable": true,
  "anonymousAllowed": true,
  "layers": [
    {
      "layerId": 2600,
      "layerIndex": 0,
      "layerName": "Layer 0"
    },
    {
      "layerId": 2601,
      "layerIndex": 1,
      "layerName": "Layer 1"
    }
  ],
  "subtitles": [
    {
      "id": null,
      "data": null,
      "isoLang": "en",
      "lang": "English",
      "dataProp": null,
      "subtitle": null
    },
    {
      "id": null,
      "data": null,
      "isoLang": "tr",
      "lang": "Turkish",
      "dataProp": null,
      "subtitle": null
    }
  ],
  "scenePlayer": {
    "id": 1800,
    "hideSeekBar": false,
    "hideTimer": false,
    "hidePlayPauseButton": false,
    "hideVolume": false,
    "hideFullScreen": false
  },
  "tags": null,
  "createdAt": 1484203906915,
  "duration": 30
}

Media

Media:upload
This method allows you to upload a media content file
GET https://cinema8.com/api/v1/media/upload/<mediaPlatform>/<mediaType>
Response:
{
  "id": 6000,
  "mediaPlatform": "STREAMX",
  "name": "testx.mp4",
  "entryStatus": "IMPORT",
  "duration": null,
  "url": null,
  "thumbnail": null,
  "entryId": null,
  "mediaType": null,
  "mediaSourceType": null,
  "hashId": null
}
Media:list
Returns list of media content. This request supports paging and sorting.
GET https://cinema8.com/apiv1/media/list/<mediaType>
Response:
{
  "totalRecords": 42,
  "resultSet": [
    {
      "id": 2350,
      "mediaPlatform": "STREAMX",
      "name": "Quick Charge 3.mp4",
      "entryStatus": "READY",
      "duration": 65,
      "url": null,
      "thumbnail": null,
      "entryId": "0_br8qibbl",
      "mediaType": "VIDEO",
      "mediaSourceType": null,
      "hashId": "rJV61nJg"
    },
    {
      "id": 2310,
      "mediaPlatform": "STREAMX",
      "name": "Qualcomm_03012017_V4.mp4",
      "entryStatus": "READY",
      "duration": 268,
      "url": null,
      "thumbnail": null,
      "entryId": "0_gfk1k0sf",
      "mediaType": "VIDEO",
      "mediaSourceType": null,
      "hashId": "zOwMNaXl"
    }
  ]
}