15
votes
Accepted
Web API 2 Attribute Routing with Sitecore 8.2+
This should actually now work out of the box on Sitecore 8.2+ including Sitecore 9 and 10 with no additional code or configuration required.
Among the resolved issues from the 8.2 release notes:
...
15
votes
Accepted
WebAPI Controllers not being found
Web API is apparently really aggressive when it caches API Controller types. I was able to fix my issue by doing the following:
stop IIS
kill the w3wps
navigate to C:\Windows\Microsoft.NET\...
14
votes
Accepted
Exposing ServiceApiController in Sitecore 9.2
You have most of the pieces you need, but not all.
You need a patch config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<initialize>
...
10
votes
Accepted
How can I utilise MongoDB for non-xDB related things in my Sitecore solution?
Utilizing data extension points
The first thing I would consider is whether your data can be stored as part of the standard Sitecore entities.
Contact
The xDB contact has the following fields where ...
9
votes
Accepted
JWT tokens for authentication for 9.0 UPDATE 1
You can implement custom DelegatingHandler base on Sitecore.Services behavior:
using System.Linq;
using System.Net.Http;
using System.Security.Claims;
using System.Threading;
using System.Threading....
8
votes
Accepted
WebApi failing to resolve dependencies
The issue is where you're initializing the Web API DependencyResolver in the Sitecore initialize pipeline. In Sitecore 8.2, the part of the initialize pipeline where the MVC and Web API ...
8
votes
Accepted
Migrating content from sitecore 7.2
There are a number of approaches people have taken to accomplish such a task. One of my preferences is to use the Sitecore PowerShell Extensions (SPE) module. With some knowledge of PowerShell, you ...
7
votes
Accepted
Best way to expose sitecore data to external system as web api
You can use Sitecore Client Services to expose data from Sitecore
Sitecore.Services.Client provides a service layer on both the server and the client side of Sitecore applications that you use to ...
5
votes
Sitecore 8.2 with Web API 2
I think you need to move the stuff in your WebApiApplication.Application_Start method to the initialize pipeline like you are doing with the RegisterRoutes class.
In Sitecore 8.2 (or somewhere around ...
5
votes
Executing Sitecore logic from a Windows Scheduled Task
Here is a low complexity example using Sitecore PowerShell Extensions.
Make sure that the SPE Remoting Module files are saved to a path configured in $env:PSModulePath.
Save script to desired path:
...
5
votes
"String was not recognized as a valid DateTime" error
The issue may be related to your other question where it appears that you have some invalid date formats. From the StackTrace it looks like the issue is related to one of the Media facets. I would try ...
5
votes
Do we have an API for sitecore 6.6
https://sdn.sitecore.net/Products/Sitecore%20Item%20Web%20API/SitecoreItemWebApi12.aspx
Sitecore Item Web API 1.2.
This version of the module only runs on Sitecore CMS 6.6.0 rev. 131211 (6.6.0 ...
5
votes
Accepted
/api/sitecore is not working in CD server
It was moved to SPEAK routes in Sitecore 9 and unavailable on CD server. You can resolve it by adding this snippet to your routing configuration (if you really need this API route - best practice is ...
5
votes
/api/sitecore is not working in CD server
The /sitecore/api route is a default route added by Sitecore in configs that are specific to the content management aspects of the platform. These configs are not enabled for content delivery. As ...
4
votes
Accepted
Web API 404 on content delivery server
One option is to enable Sitecore.Speak.Mvc.Config file .
In the Sitecore.Speak.Mvc.config file, the InitializeCommandRoute processor maps the /api/sitecore/{controller}/{action} route for SPEAK UI ...
4
votes
WebApi failing to resolve dependencies
Ran into this exact same issue but with Ninject instead. From what I could tell it was a conflict of resolution between WebAPI and MVC. Ultimately I was able to resolve the issue by implementing my ...
4
votes
Accepted
Executing Sitecore logic from a Windows Scheduled Task
The built-in Sitecore scheduler can certainly be frustrating in its limitations.
So using a WebApi endpoint that the task can call is certainly one way of doing things. You should keep security in ...
4
votes
Accepted
Get user privileges on item via Sitecore RESTful API
Sitecore security model does provide API for determining user access rights (see Sitecore.Security.AccessControl.ItemAccess class). AFAIK there is no any web service exposing it but you can easily ...
4
votes
Exposing ServiceApiController in Sitecore 9.2
MapRoute is meant for MVC controllers whereas MapHttpRoute is meant for Web API controllers.
ServiceApiController is ApiController, and you should register your route with MapHttpRoute instead of ...
3
votes
Accepted
publish item remotely using c#
An easy option would be to create your own webapi controller and create an action that does the publish, using the Sitecore API: Sitecore.Publishing.PublishManager.PublishItem(...) You can pass the ...
3
votes
Run serialize command from outside the Sitecore as a service
Sitecore PowerShell Extensions - Web API
As pointed out by Richard, SPE comes with some ways to do this.
You can find more details about the latest version of SPE Remoting here.
For now we will stick ...
3
votes
Accepted
Run serialize command from outside the Sitecore as a service
There isn't anything OOTB that will allow you to hit a rest service. You have a couple of options:
Sitecore PowerShell Extensions
You could use Sitecore PowerShell Extensions remoting to do that ...
3
votes
Sitecore 8.2 How to sort items based on a specific parameter within a content item
If the WEB Api returns the same order as items sorted in the content tree you can change it by:
Select an item folder where all sub-items required to be sorted by some criteria.
On the Home Ribbon ...
3
votes
Sitecore 8.2 How to sort items based on a specific parameter within a content item
It's possible to extend although not entirely that easy because Sitecore uses a lot of dynamics instead of actually typing things when it comes to ItemWebApi.
A small example (note that this kinda ...
3
votes
How do I control access to Custom Item Web API controllers?
There should be nothing related to debug mode, can you please check it again? If still same problem do below settings:
Make a Log for security related stuffs or other variables in a processor before/...
3
votes
Accepted
How do I control access to Custom Item Web API controllers?
So I had an issue with this custom Web API hosted inside my Sitecore solution, that will be used by a third party to call upon some Authentication and Authorization functionality. I did the following ...
3
votes
Accepted
Sitecore JSS integrated mode with subsites
Could you please try the following solution?
Add the following after line 10 in advanced-sample-react\src\dataProvider\DataProvider.prod.js: params.sc_site = 'jssadvancedapp';
For context:
const ...
3
votes
Accepted
Sitecore WebApi custom route not working controller not found
Your route pipeline definition should be changed to this one:
public class RegisterTestApiRoute
{
public virtual void Process(PipelineArgs args)
{
RouteTable.Routes.MapRoute(
...
2
votes
How do I control access to Custom Item Web API controllers?
By enabling CORS you are enabling Cross Origin Resource Sharing. You would need to supply the domains that would be allowed to call your endpoint. As you are not making a call from an external domain, ...
2
votes
WebAPI Attribute Routing Not Picking Up Routes
I think since you have a DI configured that will be resetting any routes registered after you've added them so you need to do this afterwards in the initialize Pipeline like so:
Create a pipeline to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
webapi × 58sitecore-api × 12
sitecore-services-client × 4
sitecore-client × 3
security × 3
authentication × 3
routing × 3
api × 3
sxa × 2
jss × 2
sitecore-forms × 2
upgrade × 2
mongodb × 2
javascript × 2
migration × 2
serialization × 2
xdb × 1
experience-editor × 1
azure × 1
powershell-extensions × 1
mvc × 1
pipelines × 1
contact-facets × 1
login × 1
dependency-injection × 1