Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a guest token for embedding a chart in Apache Superset

The Apache-Superset swagger doc for the guest_token API shows the following payload for the POST request:

enter image description here

I used it successfully from the following Python code snippet from their example included in the source:

body = {
    "resources": [
        {
            "id": "1",
            "type": "dashboard"
        }
    ],
    "rls": [
    ],
    "user": {
        "first_name": "John",
        "last_name": "Doe",
        "username": "johnd"
    }
}

However, the documentation does not give any details on what other resource types besides "dashboard" are available. Can I directly embed a chart? I could have tried the "chart" but there is no documented way to obtain an embedded-id for a chart similar to the procedure that they describe for a dashboard.

To summarize, can I directly embed a chart too similar to a dashboard by this API and embedded sdk?

like image 411
user173399 Avatar asked Dec 06 '25 07:12

user173399


1 Answers

According to the source, the only accepted resource-type for guest tokens is dashboard:

class GuestTokenResourceType(Enum):
  DASHBOARD = "dashboard"
like image 161
Balazs Jakab Avatar answered Dec 08 '25 22:12

Balazs Jakab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!