The following is example code for generating an embeddable URL for a report. Your account manager can assist with the dashboard, necessary filters, and the reporting API key. Custom reporting dashboards can be tailored to client specifications.
const {createHmac} = require("crypto");
const key = 'Your ChangeUp Reporting Secret API Key';
// the dashboard you want to embed
const dashboard = 'dsh_01GRS8C4BVZ8X9N7E86Z82DQG9'
// compose the data object with filters and dashboard
const data = encodeURIComponent(
JSON.stringify({
dashboard,
filters: {
"Date Range": "last_month",
"Aggregation": "day",
"ClientId": "YourClientId",
// more filters can be added based on dashboard design
}
})
);
// create the encrypted signature
const signature = createHmac("sha256", key).update(data).digest("hex");
// compose the embed url
const embedUrl = `https://reporting.changeup.com/embed/dashboard/${dashboard}?data=${data}&signature=${signature}`
java