Hi Maciej,
Sorry for my late response.
1. If the site installs both cms and search packages, and does not use any kind of service API, one of two lines below should be added to appSettings. This prevents (HttpConfiguration)config.MapHttpAttributeRoutes() from being called twice, which otherwise causes an exception (404).
Disable settings from ContentDeliverApi.Cms:
<add key="episerver:contentdelivery:maphttpattributeroutes" value="false" />
Disable settings from ContentDeliverApi.Search:
<add key="episerver:contentdeliverysearch:maphttpattributeroutes" value="false" />
2. In order to enable SiteDefinition API, you should override the default configuration
[ModuleDependency(typeof(ContentApiCmsInitialization))] public class ExtendedContentApiCmsInitialization : IConfigurableModule { public void Initialize(InitializationEngine context) { } public void Uninitialize(InitializationEngine context) { } public void ConfigureContainer(ServiceConfigurationContext context) { context.Services.Configure<ContentApiConfiguration>(config => { config.Default() .SetSiteDefinitionApiEnabled(true); }); } }
For more information about how to configure content delivery api, go Content Delivery Configuration
Hop this help.
Questions or discusstions related to ContentDeliveryApi or addons, you can post it here https://world.episerver.com/forum/developer-forum/Addons/ so that we can quickly reply.
Thx for the response. Unfortunately I already have an appSetting key and I also have an initialization class that you have mentioned but I still get 404 for search or cms api.
I should mentioned about it in my question.
Regards,
Maciek
Thx for the response. Unfortunately I already have an appSetting key and I also have an initialization class that you have mentioned but I still get 404 for search or cms api.
I should mentioned about it in my question.
Best,
Maciek
Have you had such a think like <episerver.find serviceUrl="https://...." defaultIndex="index name" />. To be able to run EPiServer.Find, you need it.
Yes it's there.
As I mentioned it's working just for one API (search or cms api) depending which was installed as a first via nuget manager, what is super odd.
Do you have any other kind of webapi services ?
Try disabling settings from ContentDeliverApi.Cms and ContentDeliverApi.Search:
<add key="episerver:contentdelivery:maphttpattributeroutes" value="false" />
<add key="episerver:contentdeliverysearch:maphttpattributeroutes" value="false" />
Also under <system.web> set optimizeCompilations to false to prevent site/IIS from caching.
<compilation debug="true" targetFramework="4.6.1" optimizeCompilations="false" />
After that you can revert optimizeCompilations settings (set it to true as default)
Ahhh!
<compilationdebug="true"targetFramework="4.6.1"optimizeCompilations="false">
Solved the problem!
Thx Quan! :)
Regards,
Maciek
I wanted to play around with content API unfortunatelly I stucked with a bit weird issue. I'm getting 404 error on search api (/api/episerver/v2.0/search/content) or cms api (ie. /api/episerver/v2.0/site) depending on which dependency was installed first. So if I install cms api as the first one, I'm getting 404 on search API and in the opposite. It seems like the second one is not registerd. Do you have any idea why it might be like this? Is it possible that it really depeneds on installation order?
Regards,
Maciek