In our remote backend we on occasion need the Confluence site’s baseUrl to construct full page links.
Unlike Connect, the Forge installation event payload does not contain a baseUrl field, so we have to fetch it via alternative means. We’ve found two strategies:
- Using
siteUrlin thecontextof the decoded FIT, added to incoming requests by ACE’sauthenticateForge - Using the
/systemInfoendpoint
In the first siteUrl case, that field is only available on requests from a frontend function / UI module. It’s therefore not easy to write remote code that can be invoked either from a frontend request or from a Forge function, as siteUrl is only available in one of those cases.
In the /systemInfo case, the API documentation states that the response’s baseUrl field is nullable/optional. This again means it is not presumably guaranteed it will be always available.
I am aware that we can piggyback off of other requests made to the Confluence API (e.g get pages) and find the baseUrl under _links.base. However, it’s not always the case that we are making such requests out to Confluence when we need the baseUrl.
From this, I have a few questions:
- Are there any other strategies to acquire a site’s
baseUrlin a remote backend? - Under what circumstances is the
baseUrlnot provided in the/systemInforesponse? - Is the documentation just wrong – is it always available from
/systemInfo?
Thanks in advance.