function fetchEmbedUrl() {
var containerDiv = document.getElementById("embeddingContainer");
// Retrieve the token from the hidden div into javascript
let token = $("#token").attr("data-token");
url: "https://<your-server-url>/get-embed-url",
contentType: 'application/json; charset=utf-8',
// Pass the token in the Authorization header Bearer field
// with an empty ' ' space inbetween:
beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', 'Bearer ' + token);
xhr.withCredentials = true;
console.log("Response:", data);
// replace this dummy url with the one generated via embedding API
footerPaddingEnabled: true,
sheetId: '<sheet-id>', // use this option to specify initial sheet id to load for the embedded dashboard
sheetTabsDisabled: false, // use this option to enable or disable sheet tab controls
undoRedoDisabled: false, // use this option to disable undo and redo buttons
resetDisabled: false // use this option to disable reset button
session = QuickSightEmbedding.embedSession(options);
$(document).ready (function(){