We are looking to do just that in the near future. Currently, we are embedding SSO dashboards, creating users, setting up access filters. We will be working on creating and running queries and downloading data.

I'm implementing a .NET SDK for the Looker API. We have successfully generated the code using Swagger Codegen. You can see my post on Generating .NET Clients

Broadcasting Embedded Dashboard Events to the Parent Page

Looker provides a way to allow an embedded dashboard to broadcast events to the parent page using the embedded dashboard API. This works when the dashboard is embedded using the <iframe /> tag in HTML.

Getting set up

Get the embedded dashboard URL

First, we need to get the embed URL for the dashboard.

Navigate to a dashboard you want to embed.

Copy the URL from the browser navigation bar.

Add /embed to the URL just before /dashboards/. For instance, if the original URL was: https://mydomain.com/dashboards/...then change the URL to:https://mydomain.com/embed/dashboards/...Make sure to leave the rest of the domain as it is.

You must add the URL parameter embed_domain with the domain of the parent page, for instance:

Listen to message events on the window

The <iframe> embedded page will use JavaScript's postMessage method to send event data which can be captured by listening to those events. To receive these events, add an event listener to the parent window like this:

NOTE: Other iframes could also be sending data to your page's window. As shown above, make sure to confirm that the source of the message was the iframe with the embedded Looker dashboard before you parse the data.

Explore the data sent from the dashboard

The callback function will receive the event object. To get to the data you want, you will need to parse event.data which has all of the data of interest to you. As shown earlier, you use JSON.parse(event.data) to get a standard JavaScript object with the data.

Data: fileFormat

I am unable to make this work. Also, the example shows embed_domain in a querystring that is not encoded which seems odd. I tried both encoded and unencoded and neither worked for me. I wired up an event listener, removed the safety check to debug, and no events are raised against my window.

I'm able to see events come through if I manually fire them from the looker iframe, so I know the event is wired correctly. To do this, simply switch chrome to the looker iframe and do something like this: