Dynamic Ingest with Media Sharing

To share videos created with Dynamic Ingest, the CMS API is used. The sharing account must have media sharing enabled - contact Brightcove Support to verify this. The video share CMS API request can be made before transcoding has completed.

Introduction

The Dynamic Ingest portion of this guide is no different from the process discussed in other documents and samples, and ingesting the video using the Upload module in Studio can be used as well. However, in the interest of completeness, curl examples are given for all three steps here:

  1. Create video
  2. Create the ingest request
  3. Share video with CMS API

Authentication

All the requests described in this topic require authentication through the Brightcove OAuth system.

Create video

The video object in the Video Cloud system is created using the CMS API. Here is a curl example:

    curl --request POST \
      --url https://ingest.api.brightcove.com/v1/accounts/MASTER_ACCOUNT_ID/videos \
      --header 'authorization: Bearer OAUTH_TOKEN' \
      --header 'content-type: application/json' \
      --data '{"name": "Video to be shared"}'

The JSON returned will include the new video id:

    {
      "id": "VIDEO_ID",
      "account_id": "ACCOUNT_ID",
      ...
    }

Create the ingest request

The video can then be ingested using the Dynamic Ingest API with the video id returned from the CMS API request. Here is a curl example of the request:

    curl --request POST \
      --url https://ingest.api.brightcove.com/v1/accounts/MASTER_ACCOUNT_ID/videos/VIDEO_ID/ingest-requests \
      --header 'authorization: Bearer OAUTH_TOKEN' \
      --header 'content-type: application/json' \
      --data '{"master": {"url": "https://example.com/video.mp4"}}'

Share video with CMS API

Once the video has been ingested, you can share it to another account using the CMS API.

Note that before you can share a video with another account, you must first set up the sharing relationship - see Media Sharing with the CMS API for more details.

Here is a curl example of the request:

    curl --request POST \
    --url 'https://cms.api.brightcove.com/v1/accounts/MASTER_ACCOUNT_ID/videos/VIDEO_ID/shares?=' \
    --header 'authorization: Bearer ACCESS_TOKEN' \
    --header 'content-type: application/json' \
    --data '[
      {
        "id":"AFFILIATE_ACCOUNT_ID"
      }
    ]'

The response includes the id of the new video in the sharee account:

    [ {
      "video_id" : "5555086013001",
      "affiliate_id" : "1752604059001",
      "affiliate_video_id" : null,
      "status" : "PROCESSING",
      "shared_at" : "2017-09-01T12:04:39.911Z",
      "updated_at" : "2017-09-01T12:04:39.911Z"
    } ]