By default, Joomla restricts the use of copy/pasted Javascript code in pages. To use the Joomla API as described in their documentation, you would have to breakup the embed code into separate Javascript and HTML, loading the Javascript via the API in the <head> of your template index.php file like so:

Screen Shot 2017-06-20 at 12.51.46 PM

And then placing the HTML div where you want the embedded content to show on the page:

Screen Shot 2017-06-20 at 12.51.57 PM

You might want to add logic to load the script on only the target page(s), or there may be an easier way to do so using a third-party module, such as the Add Custom Javascript module.