Hi Mounir
If you miss the "Accept-Language" header from your request, it would cause 404 error.
Check my blog post to see if anything can help https://javafun.github.io/episerver-headlessjs-getting-start-part-1-setup/
Hi Mounir
Are you able to get resonpose from /api/episerver/v2.0/site API?
Yes, both local and server return that data.
On local, I can get content via
/API/episerver/v2.0/content/5
But not via friendly url.
Another issue started occuring on the server when code is deployed, none of the cd API functionality works and I get access denied. But sites works.
Hi Mounir
I just had a very similar problem, after upgrading our episerver + addons to the newest version the Content delivery api returned 404 for friendly URLs but in our case only when hosted on IIS, when using IIS express it worked just fine.
after a long debug session i solved it by adding the ExtensionlessUrlHandler-Integrated-4.0 to our web.config and it started working on IIS again:
<system.webServer><handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<!-- this is a workaround for an bug with episerver Content Api returning 404 after epi release 310 -->
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
I have no idea why this is needed now but perhaps someone from episerver can shred some light on this?
anyways I hope this can help with your problem :)
/Alex
Hi Mounir,
I was having the same issue with the Quicksilver sample Commerce site. What worked for me was originally posted by Quan Tran in one of the threads you linked;
"If you have configuration handlers in web.config like below, ContentApi friendly url will throw 404. The order of handlers should be reversed (or you can try removing StaticFileHandler)"
Just in case you missed that possible fix, I figured I'd post it since it worked for me. Plus, if anyone knows why that works I'd love to know as well.
-Bruce
Hi
I currently have an issue whereby when trying to call CD-Api with a friendly URL as shows below i get the error resource not found.
I have installed the core modules for CD-API, the client does not use find and no authentication required.
I have followed the blog posts several times to see if they work, but no luck
https://world.episerver.com/forum/developer-forum/Addons/Thread-Container/2019/5/headless-api---404-not-found/
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
log4net.Config.XmlConfigurator.Configure();
MvcHandler.DisableMvcResponseHeader = true;
ServiceLocator.Current.GetInstance<RoutingOptions>().UseTrailingSlash = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;
}
The strange thing is this worked perfectly in Alloy Site
Any help would be much appreciated.