I’m stuck in a situation where the Content Delivery Api works great (/umbraco/delivery/api/v2/content/item) but the Media Delivery Api (/umbraco/delivery/api/v2/media/item) does not. I receive 401 Unauthorized no matter what I attempt, and it’s clearly some kind of validation failure on the backend. Neither Umbraco Swagger, Postman nor Insomnia can get a success. I’ve checked configurations, order of services in Program.cs, appsettings.json configurations, Cors, etc. Everything appears to be configured correctly, Content Delivery Api is working superbly. No media. The reason I wanted to hit this API was because I figured it would get me custom properties from the media items (like Caption or Alt Text), etc.
Has anyone run into this and managed to solve it?
My current path forward is to create a custom API endpoint that provides the details that I need and that does seem to be working and needs to be further configured, but I feel like maybe I’m going in the wrong direction and could really use some guidance.
Hey Paul, thank you very much. My apologies for the late response, I have been ill.
I ran through Clean and was able to see that it works, I’ll have to restructure my project to see if I can base it off of Clean Headless. I have already done so much to get things where they are and I’m worried about losing progress on it. I think this points me in the right direction though, thank you for the help. - Cheers
You need to enable the media API seperately as described in @prjseal example config.
The Media configuration can only be more restrictive! This is a very important caveat. This is what the docs say about it:
The Media configuration can only become more restrictive than the DeliveryApi configuration:
If DeliveryApi:Enabled is false, the DeliveryApi:Media:Enabled configuration option has no effect. The Media Delivery API cannot be enabled on its own.
If DeliveryApi:PublicAccess is false, the DeliveryApi:Media:PublicAccess configuration option has no effect. The Media Delivery API cannot be publicly available if the Content Delivery API is not.