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:
And then placing the HTML div where you want the embedded content to show on the page:
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.