I am consuming the Confluence v2 rest api more specifically searching for the content of a page by id and displaying it.
When I make the call to the api as in the example below, the text content is loaded, but the images are not displayed unless I am logged into Confluence. Otherwise, the images are not displayed, probably due to a CORS problem.
Link to the documentation I used as a basis:
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-get
Example of the call:
http://{host}/wiki/api/v2/pages/{pageID}?body-format=view
Example of how the tag is returned within body.view:
<img class=\"confluence-embedded-image image-center\" alt=\"image-20240405-220049.png\" width=\"1002\" loading=\"lazy\" src=\"https:/ /assesso.atlassian.net/wiki/download/thumbnails/5808343/image-20240405-220049.png?version=1&modificationDate=1712354451852&cacheVersion=1&api=v2&width=1002&height=663\" data- image-src=\"https://assesso.atlassian.net/wiki/download/attachments/5808343/image-20240405-220049.png?version=1&modificationDate=1712354451852&cacheVersion=1&api=v2\" data -height=\"894\" data-width=\"1349\" data-unresolved-comment-count=\"0\" data-linked-resource-id=\"49577999\" data-linked-resource-version =\"1\" data-linked-resource-type=\"attachment\" data-linked-resource-default-alias=\"image-20240405-220049.png\" data-base-url=\"https: //assesso.atlassian.net/wiki\" data-linked-resource-content-type=\"image/png\" data-linked-resource-container-id=\"5808343\" data-linked-resource-container -version=\"7\" data-media-id=\"90acea8e-2582-494f-bee9-e7d92c40c664\" data-media-type=\"file\" srcset=\"https://assesso.atlassian. net/wiki/download/thumbnails/5808343/image-20240405-220049.png?version=1&modificationDate=1712354451852&cacheVersion=1&api=v2&width=1280&height=848 2x, https://assesso.atlassian .net/wiki/download/thumbnails/5808343/image-20240405-220049.png?version=1&modificationDate=1712354451852&cacheVersion=1&api=v2&width=1002&height=663 1x\">
Is there any way to authenticate to the media server, or pass some parameter that allows images to be displayed?
Details:
I’m using the Rest API V2, consuming with Java, authenticated via JWT token and the user who is authenticating to consume the content has admin permission.