Issue Accessing Image Resources via API – URL Path No Longer Working

Dear KoboToolbox Support Team,

Through your API, I have been sending data to generate a PDF that includes images. Until last week, everything was working correctly — the images were loading as expected. However, starting this week, the images no longer appear, and when checking the image URLs, they no longer load.

Previously, I was able to access the images using a URL structured as follows:

https://kc-eu.kobotoolbox.org/media/small?media_file=(Username)%2Fattachments%2Fafc4d905293d42f994b1c76b0521f41a%2F403b9825-1183-4b60-bcfa-7ff04d868cf6%2F1755702278732.jpg

This URL was formed by concatenating four parts:

  1. The base path where images are stored:
    https://kc-eu.kobotoolbox.org/media/small?media_file=(username)%2Fattachments%2F

  2. The value of the field formhub/uuid

  3. The value of the field _uuid

  4. The value of the field media_file_basename

All these values are obtained from your API in JSON format.

Could you please confirm how image resource URLs should now be formed or accessed? It seems there has been a recent change in how media resources are served. We rely on these image URLs as part of an internal system used to manage our records, so this functionality is quite important for us.

Thank you very much for your time and assistance.

Welcome to the community, @HubertPeri! Yes, we made this change for security reasons.

Thank you very much for confirming that something changed. Could you please help me understand how I should create the URL now, while keeping the file name in .jpg?