Use the /sapi/embedcode endpoint to programmatically retrieve the embed code for a content object from the Online Video Platform (mediaclip, project, and channel). Learn more about embedding content.
Available embed type options:
- JavaScript: Embed code that delivers players and content on websites or in apps.
- iFrame: Standalone HTML embed code wrapped around the JavaScript embed code.
- URL: URL to use when constructing an iframe manually.
- AMP: Embed code formatted for Accelerated Mobile Pages (AMP), using an
<amp-iframe>element. - oEmbed: Returns an oEmbed URL which can be used to embed a video using oEmbed code. Learn more about oEmbed Service.
1.0 | Embedcode Object
1.1 | Example Embedcode Objects
Example Mediaclip Embedcode Object
{
"type": "embedcode",
"usetype": "javascript",
"body": "<script type=\"text/javascript\" src=\"https://yourcompanyname.bbvms.com/p/default/c/4354721.js\" async=\"true\"></script>"
}Example Project Embedcode Object
{
"type": "embedcode",
"usetype": "javascript",
"body": "<script type=\"text/javascript\" src=\"https://yourcompanyname.bbvms.com/p/default/p/7876.js\" async=\"true\"></script>"
}Example Channel Embedcode Object
{
"type": "embedcode",
"usetype": "javascript",
"body": "<script type=\"text/javascript\" src=\"https://yourcompanyname.bbvms.com/ch/220.js\" async=\"true\"></script>"
}Although usage for projects and channels is supported, the /sapi/embedcode endpoint is mainly used for mediaclips.
1.2 | Attributes
| Parameter | Description |
|---|---|
type | (string) “embedcode”. Read-only. |
usetype | (string) One of the supported embed types: JavaScript, iFrame, URL, AMP, oEmbed. Read-only. |
body | (string) HTML snippet to embed. Read-only. |
2.0 | Retrieve
GET /sapi/embedcode/{id}/{playout_name}/{embedtype}/{action}
2.1 | Parameters
| Parameter | Description |
|---|---|
id | (Required) Unique identifier of entity (mediaclip, project, or channel). |
playout_name | (Required) Name of playout to be used in embedded content. |
embedtype | (Required) One of the supported embed types: “javascript”, “iframe”, “url”, “amp”, “oembed”. |
action | (Optional) Use “view” to return a preview of the embed code. Use “get” to return a JSON-encoded string (default output if {action} is omitted). |
query_string | (Optional) Several options, e.g.: width, height, deep link, thumbWidth, thumbHeight (only for the oEmbed URL). |