Inquiry about Making API Calls and Passing Credentials in Looker Platform and Custom Visualizations

Dear Looker Forum Community,

I hope this message finds you all well. I'm reaching out with a query regarding the utilization of Looker's API capabilities and the process of passing credentials during API calls within the Looker platform and custom visualization JavaScript files.

Our goal is to leverage API functionality in Looker. Specifically, we are interested in the following aspects:

  • How can we access Service account JSON file uploaded in Authentication section of Database Connnections in Looker?
  • API Calls from Looker Platform: What are the best practices, and what methods are available for accessing data through the API within Looker itself?
  • Custom Visualizations: To extend Looker's visualization capabilities, we are interested in creating custom visualizations. Could you please guide us on integrating API calls into custom visualization JavaScript files? What are the recommended approaches and any sample code or resources available for reference?
  • Credential Management: How can we securely pass credentials, such as API keys or tokens, while making API calls both within Looker and in custom visualization JavaScript files? Can we store these data within the Looker and access them using LookML?

Any documentation, tutorials, or real-world examples you can share would be immensely valuable to us.
Thank you in advance for your assistance, and we look forward to your guidance and recommendations.

0 1 194
1 REPLY 1

How can we access Service account JSON file uploaded in Authentication section of Database Connnections in Looker?

Although there is an API to get the connection details, sensitive fields like the service account JSON are write-only. It is not possible to retrieve the service account JSON file.

API Calls from Looker Platform: What are the best practices, and what methods are available for accessing data through the API within Looker itself?

The best option for this is the extension framework (EF). The EF will allow you to run javascript on a full-page sandboxed iframe with a pre-authenticated Looker API client that is able to make API call on behalf of the user who is using the extension.

Custom Visualizations: To extend Looker's visualization capabilities, we are interested in creating custom visualizations. Could you please guide us on integrating API calls into custom visualization JavaScript files? What are the recommended approaches and any sample code or resources available for reference?

Although custom visualizations can trigger new query runs, for example by updating filter values, the custom visualization API does not provide access to the full Looker REST API. Extensions do offer access to the full Looker REST API, however, they are currently only available as a "full page" experience, and not currently "as a tile" in a dashboard.

Credential Management: How can we securely pass credentials, such as API keys or tokens, while making API calls both within Looker and in custom visualization JavaScript files? Can we store these data within the Looker and access them using LookML?

The Looker Extension Framework provides convenient access to make server-side HTTP calls where tagged values can be filled in by user attribute values, as well as convenient access to OAuth flows for users to acquire tokens to third party services without storing credentials.