API: Add endpoint to fetch image data (needed for when secure options are active) #5210

Closed
opened 2026-02-05 09:48:36 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @renanredel on GitHub (Mar 6, 2025).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hello,

I trying to consume the data from my bookstack using API requests. I already able to get the image URL, but I'm still struggling to get the image data.
My environment is using the local_secure option to store the images, and has the OIDC with Azure enabled.
This is even possible? Thanks!

Exact BookStack Version

25.02

Log Content

No response

Hosting Environment

Kubernetes environement with linuxserver/bookstack as docker image;
OIDC with Azure (Entra ID);
File upload setup with local_secure option enabled.

Originally created by @renanredel on GitHub (Mar 6, 2025). ### Attempted Debugging - [x] I have read the debugging page ### Searched GitHub Issues - [x] I have searched GitHub for the issue. ### Describe the Scenario Hello, I trying to consume the data from my bookstack using API requests. I already able to get the image URL, but I'm still struggling to get the image data. My environment is using the local_secure option to store the images, and has the OIDC with Azure enabled. This is even possible? Thanks! ### Exact BookStack Version 25.02 ### Log Content _No response_ ### Hosting Environment Kubernetes environement with linuxserver/bookstack as docker image; OIDC with Azure (Entra ID); File upload setup with local_secure option enabled.
OVERLORD added the 🔩 API Request label 2026-02-05 09:48:36 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 6, 2025):

Hi @renanredel,

I think you have found a hole in our API, I don't think you can access the image data directly right now (without complex parsing of export formats) with a secure image option active. The auth applied to image fetches does not use api auth.

To help with the implementation and options, What is the wider goal? Are you trying to re-create whole pages, with images, externally? Or just need the image data itself.
Also, within your current logic, what do you have to hand? The image ID, or the original image URL?

@ssddanbrown commented on GitHub (Mar 6, 2025): Hi @renanredel, I think you have found a hole in our API, I don't think you can access the image data directly right now (without complex parsing of export formats) with a secure image option active. The auth applied to image fetches does not use api auth. To help with the implementation and options, What is the wider goal? Are you trying to re-create whole pages, with images, externally? Or just need the image data itself. Also, within your current logic, what do you have to hand? The image ID, or the original image URL?
Author
Owner

@renanredel commented on GitHub (Mar 6, 2025):

hi @ssddanbrown,

I'm trying to build a chatbot, that's have the knowledge from the bookstack. So, I need to retrieve all the content from the pages and use images for the context as well.
My logic uses the image URL after getting the page content (using the export by markdown). But I can change it if needed (I'm not in production yet).
By now, I can switch back to "local" in the file upload settings, I think the migrating way is just to copy back the content to the public folder, right?

@renanredel commented on GitHub (Mar 6, 2025): hi @ssddanbrown, I'm trying to build a chatbot, that's have the knowledge from the bookstack. So, I need to retrieve all the content from the pages and use images for the context as well. My logic uses the image URL after getting the page content (using the export by markdown). But I can change it if needed (I'm not in production yet). By now, I can switch back to "local" in the file upload settings, I think the migrating way is just to copy back the content to the public folder, right?
Author
Owner

@ssddanbrown commented on GitHub (Sep 3, 2025):

Hi @renanredel,
Sorry, forgot to come back to this one.

By now, I can switch back to "local" in the file upload settings, I think the migrating way is just to copy back the content to the public folder, right?

Yeah, that and the .env setting. Backup all files first before making changes for safety!

I've recategorised this as an API request (to provide a proper way to get image data over the API), and assigned it to the next feature release.

@ssddanbrown commented on GitHub (Sep 3, 2025): Hi @renanredel, Sorry, forgot to come back to this one. > By now, I can switch back to "local" in the file upload settings, I think the migrating way is just to copy back the content to the public folder, right? Yeah, that and the `.env` setting. Backup all files first before making changes for safety! I've recategorised this as an API request (to provide a proper way to get image data over the API), and assigned it to the next feature release.
Author
Owner

@renanredel commented on GitHub (Oct 1, 2025):

Hi @ssddanbrown
Great news. Thank you!

@renanredel commented on GitHub (Oct 1, 2025): Hi @ssddanbrown Great news. Thank you!
Author
Owner

@ssddanbrown commented on GitHub (Oct 31, 2025):

An implementation has now been merged via #5860.
There are two added endpoints for getting data, either via Image ID, or via providing an image URL.
These will be part of the next feature release.

Thanks again @renanredel for raising!

@ssddanbrown commented on GitHub (Oct 31, 2025): An implementation has now been merged via #5860. There are two added endpoints for getting data, either via Image ID, or via providing an image URL. These will be part of the next feature release. Thanks again @renanredel for raising!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5210