在本文件中
相關文件
簡介
Brightcove聯合組織配置API是一個公共可訪問的API,允許創建,管理聯合,並從中生成動態供稿(例如MRSS供稿)。 Video Cloud 帳戶的視頻目錄。
還有一個關聯 聯合供稿API 可用於檢索與聯合發布相關聯的供稿。
產品狀況
聯合API可供所有人使用 Video Cloud 有權訪問平台API的客戶。
API參考/基本URL /標頭
配置API參考 包含有關可用操作,字段和參數的所有詳細信息。
基本網址是:
https://social.api.brightcove.com/v1
所有請求都必須通過Authorization標頭進行身份驗證:
Authorization: Bearer {your_access_token}
有關訪問令牌的信息,請參見下一節中的身份驗證。
對於發送請求正文的任何請求,您還必須包含一個 Content-Type: application/json
頭。
認證
要訪問Configuration API,需要指定一個 bearer
來自的令牌 Brightcove OAuth服務 在請求的 Authorization
標頭。 各種API方法還需要為相關憑據指定以下操作之一(取決於所訪問的方法):
video-cloud/social/mrss/read
video-cloud/social/mrss/write
這些操作可以通過 Studio管理模塊的“ API身份驗證”部分:

如果您願意,也可以通過 OAuth API:
聯合資源
聯合資源是定義如何創建聯合的對象。 這是用於創建聯合資源的示例請求正文:
{
"name": "80s music videos syndication",
"type": "advanced",
"include_all_content": false,
"include_filter": "tags:mytag",
"title": "80s Music Videos",
"description": "Amateur Tokyo drift!",
"destination_url": "http://mywebsite.com",
"keywords": "80s, rock",
"author": "Rick Astley",
"category": "Music",
"album_art_url": "http://my_album_art.jpg",
"explicit": "no",
"owner_name": "http://my_album_art.jpg",
"owner_email": "rick@astley.com",
"language": "en-us",
"fetch_sources": true,
"fetch_digital_master": false,
"fetch_dynamic_renditions": true,
"sort": "-created_at",
"content_type_header": "application/xml"
}
該響應將添加一些只讀字段:
{
"id": "7f594cd3-4853-4174-aff3-203c3e99e9c2",
"name": "80s music videos syndication",
"type": "advanced",
"include_all_content": false,
"include_filter": "tags:mytag",
"title": "80s Music Videos",
"description": "Amateur Tokyo drift!",
"syndication_url": "https://social.feeds.brightcove.com/v1/accounts/9999999999999/mrss/accounts/{account_id}/mrss/syndications/7f594cd3-4853-4174-aff3-203c3e99e9c2/feed",
"destination_url": "http://mywebsite.com",
"keywords": "80s, rock",
"author": "Rick Astley",
"category": "Music",
"album_art_url": "http://my_album_art.jpg",
"explicit": "no",
"owner_name": "http://my_album_art.jpg",
"owner_email": "rick@astley.com",
"language": "en-us",
"fetch_sources": true,
"fetch_digital_master": false,
"fetch_dynamic_renditions": true,
"sort": "-created_at",
"content_type_header": "application/xml"
}
場 | 類型 | 只讀 | 產品描述 |
---|---|---|---|
id |
串 | 是 | 創建聯合組織時生成 |
name |
串 | 沒有 | 該聯合組織的內部名稱-POST請求所需 |
content_type_header |
串 | 沒有 | 如果設置,則覆蓋此聯合供稿的供稿服務器返回的Content-Type標頭。 否則,提要默認為特定於聯合類型的標頭值 |
include_all_content |
布爾 | 沒有 | 如果為true,則所有目錄視頻都包含在此聯合中 |
include_filter |
串 | 沒有 | 如果include_all_content為false,則必須指定。 值是一個 CMS API 使用搜索字符串 CMS API 視頻搜索語法v2。 所有語法規則都適用-唯一的區別是,搜索字符串作為 include_filter 價值而不是 ?query= 參數。
|
type |
串 | 沒有 | 將要生成的提要的類型。 通用類型允許通過上傳的供稿模板生成自定義供稿。 有效值: advanced , google , iphone , ipad , mp4 , itunes , roku , source , universal 。 POST請求所必需 |
title |
串 | 沒有 | 此供稿的標題。 這包括在適用飼料類型的標籤 |
description |
串 | 沒有 | 此供稿的說明。 這包括在適用飼料類型的標籤 |
syndication_url |
串 | 是 | 該聯合組織的MRSS Feed的URL |
destination_url |
串 | 沒有 | 包含在適用飼料類型的標籤 |
keywords |
串 | 沒有 | 以逗號分隔的列表,僅用於iTunes和(可能)通用供稿 |
author |
串 | 沒有 | 僅用於iTunes和(可能)通用供稿 |
owner_name |
串 | 沒有 | 僅用於iTunes和(可能)通用供稿 |
language |
串 | 沒有 | 僅用於iTunes和(可能)通用供稿-小寫的兩個字母的語言代碼,例如 "en" |
owner_email |
串 | 沒有 | 僅用於iTunes和(可能)通用供稿 |
category |
串 | 沒有 | 僅用於iTunes和(可能)通用供稿。 要指定帶有子類別的類別,請用冒號(:)分隔它們-例如: "Business:Business News". "category": "Music" |
album_art_url |
串 | 沒有 | 圖片的網址,僅用於iTunes和(可能)通用供稿 |
fetch_sources |
布爾 | 沒有 | 對於通用模板,是否獲取視頻源元數據-如果模板不需要此元數據,則可以通過指定以下內容來提高性能 false ; 如果不存在可用源,則可以為空 |
fetch_digital_master |
布爾 | 沒有 | 對於通用模板,是否獲取視頻數字主數據-如果模板不需要此元數據,則可以通過指定 false ; 如果不存在數字主機,則可以為空 |
fetch_dynamic_renditions |
布爾 | 沒有 | 對於通用模板,是否獲取視頻動態再現元數據-如果模板不需要此元數據,則可以通過指定 false |
sort |
串 | 沒有 | CMS視頻排序說明符,指示所需的提要結果返回順序。 CMS支持的值,例如 name , reference_id , created_at , published_at , updated_at , schedule.starts_at , schedule.ends_at , state , plays_total 和 plays_trailing_week 可以指定。 要按降序排序,請在值前加上減號(-),即 -created_at ,指定後,供稿將按照最新的 updated_at 默認為日期。 |
看到 CMS API 視頻搜索語法v2 有關的詳細信息 include_filter
屬性。所有搜索語法規則都適用-唯一的區別是,輸入的搜索字符串為 include_filter
價值而不是 ?query=
參數。
操作
有關可用操作的完整詳細信息,請參見API參考:
支持以下操作:
錯誤消息
如果任何API請求失敗,將返回錯誤消息。 錯誤響應如下所示:
[
{
"error_code" : "Application error code 1",
"message" : "Application error message 1"
}, {
"error_code" : "Application error code 2",
"message" : "Application error message 2"
}
]
建立聯合
方法: POST
終點: /accounts/{account_id}/mrss/syndications
樣品請求正文:
{
"name": "my mp4 feed",
"type": "mp4"
}
請注意 name
以及 type
必填字段。 其他是可選的。
更新企業聯合組織
方法: PATCH
終點: /accounts/{account_id}/mrss/syndications/{syndication_id}
樣品請求正文:
{
"name": "my new name"
}
請注意,PATCH請求的請求主體必須 不 包括字段(type
, id
以及 syndication_url
).
刪除聯合組織
方法: DELETE
終點: /accounts/{account_id}/mrss/syndications/{syndication_id}
獲取帳戶的所有企業聯合組織
方法: GET
終點: /accounts/{account_id}/mrss/syndications
獲得特定的聯合組織
方法: GET
終點: /accounts/{account_id}/mrss/syndications/{syndication_id}
設置通用聯合組織的模板
方法: PUT
終點: /accounts/{account_id}/mrss/syndications/{syndication_id}/template
樣品請求正文:
<feed header>My Feed Header</feed header>
上面的模板將生成類似於以下內容的供稿:
<feed header>My Feed Header</feed header>
<item>
<title>Title for Video 1</title>
<video_info>Description for Video 1</video_info>
</item>
<item>
<title>Title for Video 2</title>
<video_info>Description for Video 2</video_info>
</item>
獲取通用聯合組織的模板
方法: GET
終點: /accounts/{account_id}/mrss/syndications/{syndication_id}/template
獲取與聯合發布相關聯的供稿
提要網址可以從聯合組織的 syndication_url
字段,或手動構建。 請注意 聯合供稿API 也可以用於在不進行身份驗證的情況下檢索供稿。
方法: GET
終點: /accounts/{account_id}/mrss/syndications/{syndication_id}/feed
通用模板語言
通用聯合組織允許將目錄數據與自定義模板合併,以生成所需的任何類型的供稿。 支持的模板語言是 液體。 默認聯合類型的供稿是使用相同類型的模板生成的,您可以看到 樣本提供的模板 幫助您構建自定義模板(如果需要)。
以下各節標識了可以使用的聯合組織,資產,源和數字主屬性,以及為方便而添加的Liquid的擴展。
看全部 Video Cloud 帶有說明的視頻元數據字段 CMS API 視頻場參考.
頂級屬性
源自聯合發布字段
album_art_url
author
category
description
destination_url
explicit
keywords
name
owner_name
owner_email
subtitle
syndication_id
syndication_url
title
Video Cloud 帳戶ID
account_id
VideoCloud默認 player 頁面網址前綴
像這樣使用:
<media:player url="//default_default/index.html?videoId=">
player_url
提要下一頁的URL
next_page
從目錄中檢索到的視頻資產的集合(有關詳細信息,請參見下文)
assets
資產屬性
資產集合中的資源來自CMS Get Videos API方法返回的視頻資源,並且支持所有相同的屬性,包括但不限於以下各項:
created_at
description
duration
id
images
images.thumbnail
images.poster
long_description
name
original_filename
published_at
schedule
state
tags
text_tracks
updated_at
資產資源還支持以下屬性:
sources
(視頻的來源集合-有關來源屬性,請參見下一部分)digital_master
(如果不存在數字主機,則為空-有關數字主機的屬性,請參見下文)best_mp4_source
(最高質量的MP4來源-如果沒有MP4來源,則可能為空。屬性將與sources
)hls_source
(返回HLS源-如果不存在則為空)best_dynamic_rendition_quality
(如果已經為視頻獲取了動態再現元數據,則返回具有最大幀大小的視頻動態再現的視頻質量。允許的值為“ SD”,“ HD”,“ FHD”和“ UHD”。)
源屬性
資產的源集合中的資源來自CMS Get Video Sources API方法返回的視頻源資源。 支持以下屬性:
app_name
asset_id
codec
container
created_at
duration
encoding_rate
height
size
src
stream_name
type
uploaded_at
width
數字主機屬性
digital_master
資產的資源源自CMS Get Digital Master Info API方法返回的數字主資源。 支持以下屬性:
duration
encoding_rate
height
size
url
width
動態再現屬性
dynamic_renditions
資產的資源是從CMS Get Digital Master Info API方法返回的動態格式中得出的。 支持以下屬性:
rendition_id
frame_height
frame_width
media_type
encoding_rate
created_at
updated_at
size
duration
audio_configuration
language
variant
液體的延伸
toUTC過濾器
我們擴展了Liquid解析器以支持toUTC過濾器,該過濾器將解析大多數標準ISO-8601日期時間字符串格式並將其轉換為標準UTC日期時間字符串。 Liquid的日期過濾器可以接受這種格式,然後可以使用該格式將時間戳重新格式化為任何所需格式的日期時間字符串。 例如:
<pubDate></pubDate>
如果asset.published_at的值為2019-08-09T13:32:52.031Z :,則會產生類似以下的輸出:
<pubDate>Fri, 09 Aug 2019 09:32:52 +0000</pubDate>
toEpoch過濾器
我們使用的Liquid解析器在日期過濾器中不支持將日期轉換為Unix紀元時間戳的“%s”令牌。 為了解決這個問題,提供了一個toEpoch定製過濾器,該過濾器可用於將有效日期規範轉換為紀元格式。 過濾器返回一個數字數據值,該值表示自適合輸入數學過濾器的時期以來的毫秒數。 例如:
<toEpochMillis>now</toEpochMillis>
<toEpochSeconds>0</toEpochSeconds>
<thirtyDaysAgo>-2592000000</thirtyDaysAgo>
產生如下輸出:
<toEpochMillis>1580917253024</toEpochMillis>
<toEpochSeconds>1580917253</toEpochSeconds>
<thirtyDaysAgo>2020-01-06T15:40:53.055Z</thirtyDaysAgo>
fromEpoch過濾器
fromEpoch過濾器將代表自紀元以來的毫秒數轉換為UTC日期字符串。 過濾器還將接受包含紀元值數字的字符串作為輸入。 如有必要,可以將輸出傳遞到日期過濾器以重新格式化。
例如:
<fromEpochMillis>now</fromEpochMillis>
<thirtyDaysAgoAltFormat>52067-04-10</thirtyDaysAgo>
產生如下輸出:
<fromEpochMillis>2020-02-05T16:09:37.809Z</fromEpochMillis>
<thirtyDaysAgoAltFormat>2020-02-05</thirtyDaysAgo>