Hi,
According to these references, I have to take Metabase session id so as to use API :
- https://github.com/metabase/metabase/issues/2689
- https://github.com/metabase/metabase/wiki/Using-the-REST-API
But my problem is that I use embeded URL to access dashboard like this
(BASIC QUESTION : embeded dashboard with url are supported from Metabase?) :
var jwt = require("jsonwebtoken");
var METABASE_SITE_URL = "http://localhost:3000";
var METABASE_SECRET_KEY = "xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxx";
var payload = {
resource: { dashboard: 1 },
params: {
"from_date": null,
"from_time": null,
"to_date": null,
"to_time": null
}
};
var token = jwt.sign(payload, METABASE_SECRET_KEY);
var iframeUrl = METABASE_SITE_URL + "/embed/dashboard/" + token + "#bordered=true&titled=true";
<iframe
src="{{iframeUrl}}"
frameborder="0"
width="800"
height="600"
allowtransparency
></iframe>
The question is how to combine Session ID with iframeUrl because I get a 401 error
like :> XML Parsing Error: syntax error Location: http://10.0.0.20:3000/api/user/current
For example, is any way to pass session-id as parameter to the URL like following?
(in my example I use SESSION_ID) :
http://localhost:3000/embed/dashboard/....?SESSION_ID=37b7e253-1d1b-4249-829b-d4a6c01720a4#theme=night&bordered=false&titled=false