1

Trying to embed a question using iframe in my application. I've followed the instructions here: https://www.metabase.com/docs/latest/administration-guide/13-embedding.html

Code (PHP):

 $payload = (object) [
            'resource' => ['question' => 20],
            'params'=> [

            ]
        ];

        $token = JWT::encode($payload, env('METABASE_SECRET_KEY'));

        $iframeUrl = env('METABASE_SITE_URL') . "/embed/question/{$token}/#bordered=true&titled=true";

HTML:

 <iframe
    src="{{$iframeUrl}}"
    frameborder="0"
    width="800"
    height="600"
    allowtransparency
></iframe>

Error:

error message

It seems like it's trying to authenticate the user and fails:

failed requests

Matanya
  • 6,233
  • 9
  • 47
  • 80

1 Answers1

1

As the error suggests question id should be an integer. Solved by casting to int

Matanya
  • 6,233
  • 9
  • 47
  • 80