/sapi/embedcode


Use the /sapi/embedcode endpoint (read-only) 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
    Standalone HTML embed code wrapped around the Javascript embed code.
  • 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 | Examples Embedcode Object

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/embed endpoint is mainly used for media clips. 

1.2 | Attributes

ParameterDescription
type(string) “embedcode”. Read-only.
usetype(string) One of the supported embedtypes: JavaScript, iFrame, URL, AMP, oEmbed. Read-only.
body(string) HTML snippet to embed. Read-only.

2.0 | Retrieve

GET /sapi/embedtype/{id}/{playout_name}/{embedtype}/{action}

2.1 | Parameters

ParametersDescription
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 embedtypes: “javascript”, “iframe”, “url”, “amp”, “oembed”.
action(Optional) Use “view” to return a preview of the embedcode. 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).

 

Was this article helpful?

Related Articles

Contact Support
Can't find the answer you're looking for?
Contact Support