How to get the URL of an embedded Lucidchart on a Confluence page using Confluence API

toso
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 4, 2024

I am using lucid charts macro to embed a lucid chart on a Confluence page. How can I get the lucid chart url using the Confluence API?
I tried getting the html of the Confluence page but it only give the lucid chart macro details like macroID, lcId, etc. I also tried the macro API to get the macro details but even that does not seem to contain the url

Here is the html i receive for the lucid chart embed


<div
class="ap-container conf-macro output-block"
data-hasbody="false"
data-layout="default"
data-local-id="987e39eb-15d8-4433-9a9a-1b1b20bb20c8"
data-macro-id="4656a7de-f219-4dd9-8a67-92450c41f256"
data-macro-name="lucidchart"
id="ap-com.lucidchart.confluence.plugins.lucid-confluence__lucidchart2918639027826206415"
>
<div
class="ap-content"
id="embedded-com.lucidchart.confluence.plugins.lucid-confluence__lucidchart2918639027826206415"
></div>
<script
nonce="c364483fa092405a966f225ca11e095b"
class="ap-iframe-body-script"
>
//<![CDATA[
(function () {
var data = {
addon_key: "com.lucidchart.confluence.plugins.lucid-confluence",
uniqueKey:
"com.lucidchart.confluence.plugins.lucid-confluence__lucidchart2918639027826206415",
key: "lucidchart",
moduleType: "dynamicContentMacros",
moduleLocation: "content",
cp: "/wiki",
general: "",
w: "",
h: "",
contextJwt:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI3MTIwMjA6MzBjZjJhN2ItOTNlNi00MDllLWIzMjktNzcxNWQ1MTNjYTg0IiwicXNoIjoiY29udGV4dC1xc2giLCJpc3MiOiI0NWJmNDM3NC05NzQ5LTMzOWUtOWEwMi03YjgxYTNlYTY2NTkiLCJjb250ZXh0Ijp7InVybCI6eyJkaXNwbGF5VXJsIjoiaHR0cHM6XC9cL3Rvc29kaWgyNjIuYXRsYXNzaWFuLm5ldFwvd2lraSJ9LCJjb25mbHVlbmNlIjp7ImVkaXRvciI6eyJ2ZXJzaW9uIjoiXCJ2MlwiIn0sIm1hY3JvIjp7Im91dHB1dFR5cGUiOiJkaXNwbGF5IiwiaGFzaCI6IjQ2NTZhN2RlLWYyMTktNGRkOS04YTY3LTkyNDUwYzQxZjI1NiIsImlkIjoiNDY1NmE3ZGUtZjIxOS00ZGQ5LThhNjctOTI0NTBjNDFmMjU2In0sImNvbnRlbnQiOnsidHlwZSI6InBhZ2UiLCJ2ZXJzaW9uIjoiNCIsImlkIjoiNDIyMDUxODgifSwic3BhY2UiOnsia2V5IjoifjcxMjAyMDMwY2YyYTdiOTNlNjQwOWViMzI5NzcxNWQ1MTNjYTg0IiwiaWQiOiIzMzEyNyJ9fX0sImV4cCI6MTcyMDAwNjg2NCwiaWF0IjoxNzIwMDA1OTY0fQ.I0KP6a-csd9F5XgxQvBdS7H-stClm2-FkoLsQXHN-Ak",
structuredContext:
'{"confluence":{"editor":{"version":"\\"v2\\""},"macro":{"outputType":"display","hash":"4656a7de-f219-4dd9-8a67-92450c41f256","id":"4656a7de-f219-4dd9-8a67-92450c41f256"},"content":{"type":"page","version":"4","id":"42205188"},"space":{"key":"~71202030cf2a7b93e6409eb3297715d513ca84","id":"33127"}},"url":{"displayUrl":"https://tosodih262.atlassian.net/wiki"}}',
contentClassifier: "content",
productCtx:
'{"page.id":"42205188","macro.hash":"4656a7de-f219-4dd9-8a67-92450c41f256","autoUpdate":"false","page.type":"page","macro.localId":"987e39eb-15d8-4433-9a9a-1b1b20bb20c8",": = | RAW | = :":"pageCount=1|autoUpdate=false|align=left|type=rich|autoSize=1|macroId=929198f8-c388-41e5-87e2-b8ce136ce7e7|instanceId=45bf4374-9749-339e-9a02-7b81a3ea6659|pages=|width=700|documentToken=v2_1206832ac132d7de2141dfd4e0fa24d8a7f23d403108fb212c36ddc76fc3cead-a=175690899&c=45bf4374-9749-339e-9a02-7b81a3ea6659&d=e223ec4a-e1ff-4c75-b8fc-54f9d1774b9a&p=42205188|documentId=e223ec4a-e1ff-4c75-b8fc-54f9d1774b9a|updated=1719984187918|height=500","space.id":"33127","align":"left","type":"rich","autoSize":"1","instanceId":"45bf4374-9749-339e-9a02-7b81a3ea6659","pages":"","user.isExternalCollaborator":"false","height":"500","pageCount":"1","space.key":"~71202030cf2a7b93e6409eb3297715d513ca84","content.version":"4","page.title":"lucid chart","macro.body":"","macro.truncated":"false","content.type":"page","output.type":"display","page.version":"4","macroId":"929198f8-c388-41e5-87e2-b8ce136ce7e7","macro.fragmentLocalId":"","content.id":"42205188","width":"700","macro.id":"4656a7de-f219-4dd9-8a67-92450c41f256","documentToken":"v2_1206832ac132d7de2141dfd4e0fa24d8a7f23d403108fb212c36ddc76fc3cead-a=175690899&c=45bf4374-9749-339e-9a02-7b81a3ea6659&d=e223ec4a-e1ff-4c75-b8fc-54f9d1774b9a&p=42205188","documentId":"e223ec4a-e1ff-4c75-b8fc-54f9d1774b9a","updated":"1719984187918","editor.version":"\\"v2\\""}',
timeZone: "Asia/Calcutta",
sandbox:
"allow-downloads allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-scripts allow-same-origin allow-top-navigation-by-user-activation allow-storage-access-by-user-activation",
apiMigrations: {
gdpr: true,
},
};
if (window.AP && window.AP.subCreate) {
window._AP.appendConnectAddon(data);
} else {
require(["ac/create"], function (create) {
create.appendConnectAddon(data);
});
}

// For Confluence App Analytics. This code works in conjunction with CFE's ConnectSupport.js.
// Here, we add a listener to the initial HTML page that stores events if the ConnectSupport component
// has not mounted yet. In CFE, we process the missed event data and disable this initial listener.
const __MAX_EVENT_ARRAY_SIZE__ = 20;
const connectAppAnalytics = "ecosystem.confluence.connect.analytics";
window.connectHost &&
window.connectHost.onIframeEstablished((eventData) => {
if (!window.__CONFLUENCE_CONNECT_SUPPORT_LOADED__) {
let events =
JSON.parse(window.localStorage.getItem(connectAppAnalytics)) ||
[];
if (events.length >= __MAX_EVENT_ARRAY_SIZE__) {
events.shift();
}
events.push(eventData);
window.localStorage.setItem(
connectAppAnalytics,
JSON.stringify(events)
);
}
});
})();

//]]>
</script>
</div>

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events