Dataset Switching

Alka
Alka Member

Hi,

Does DOMO offer API to embed Dashboard? Is there any API like below?
https://api.domo.com/v1/dashboards/{dashboardId}/embed
I could not find any details about this API in documentation. So, if this API exists can you please share the URL of Documentation?

GPT suggested below code to switch dataset and load Dashboard with Dataset Switching. Can you please confirm if this is possible?

public async Task<string> GetEmbedUrl(string accessToken, string dashboardId, string datasetId)
{
using var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"https://api.domo.com/v1/dashboards/{dashboardId}/embed"); request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken);
var payload = new { datasetId = datasetId }; // Pass dynamic dataset ID
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(payload), Encoding.UTF8, "application/json");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
var json = Newtonsoft.Json.Linq.JObject.Parse(result);
return json["url"].ToString(); // Embedded URL }

Tagged:

Comments

  • Domo supports embedding dashboards, but it is done through Publish Dashboard or Domo Everywhere. (I'm not familiar with any API endpoint.)

    The Domo API does not provide functionality to dynamically switch datasets within an embedded dashboard. Dashboard views in Domo are tied to specific datasets as defined during dashboard creation.

    No, the code you show does not work with Domo's API. There's no POST endpoint.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **