Unable to load confluence images on an external website


We recently changed the permissions for the confluence pages, we no longer can access the pages anonymously.

We maintain specs related to our components on Confluence. Now, we want to fetch those pages and display them on our external website.

We use ajax call to get the page contents by providing the Authorization header. I was able to fetch page contents but the images are not loading as the src attribute still points to the confluence

example: img src=“https://confluence.paycomhq.com/download/attachments/embedded-page/UID/XXXXXXX?api=v2

I believe images in the page are not loading as these url’s are not authenticated.

I had a look at the authentication mechanisms but none of them seems to be applicable to my scenario as these url’s are passed to src attribute of an image.

Here is a similar post related to my issue but no one answered it yet. GET page content with images displayed in frontend

Does anyone know how to load the images within the page on an external website?