We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [webapi]

For questions related to the ASP.NET Web API framework, whether writing APIs to manage content or functionality in Sitecore, or consuming data from APIs written using Web API (e.g., the Sitecore ItemService).

Filter by
Sorted by
Tagged with
0
votes
1answer
26 views

Using .net core web api from sitecore root

We are building JSS application in SSR mode. We need to build an api which will be running from sitecore root. Can I build API using .net core or only .net framework is supported when running it from ...
6
votes
3answers
189 views

Exposing ServiceApiController in Sitecore 9.2

I am trying to expose a MVC route in Sitecore 9.2 for a web api I am creating. I followed the steps describe here but it only works when my controller inherits from controller. If I inherit it to ...
0
votes
1answer
46 views

Sitecore JSS component invoking a web api

I had a react js application (http://localhost:3000) that invoked a web api (http://xyz) POST method. The way i accomplished that is - through the "proxy":"http://xyz" setting in the package.json of ...
1
vote
3answers
348 views

/api/sitecore is not working in CD server

Sitecore Version: 9.0.2 Environment: Azure PaaS CD We are trying to call /api/sitecore/controller/actionname with AJAX. It's working on the CM server but not on the CD server. I disabled custom ...
0
votes
1answer
64 views

Prevent Login Redirect on 403 When an Ajax Call

Using Sitecore 9.1 and SXA 1.8 Does anyone know the best way to force Sitecore to return a legit 403 error when an Ajax call is hitting an API method? Currently when the following code is thrown ...
1
vote
1answer
196 views

Sitecore custom api routing is not working

We have a multi-site environment. In one of the module, we are calling the same controller/action from all the sites. Perhaps, the same Javascript file which calls this controller/action is ...
0
votes
0answers
44 views

Web Api on Content Delivery server returns unexpected JSON response with __interceptors

In the image below we see on the right side the expected Web API response as it happens on standalone servers and the Content Management server. On the left side however, we are faced with a ...
1
vote
1answer
314 views

JWT tokens for authentication for 9.0 UPDATE 1

I have an instance running SxC 9.0 update 1. I was working on an API which had to be consumed by a 3rd party application. Can you provide some input for using token bear mechanism to protect my API. ...
1
vote
3answers
726 views

How to Return 401 Response from OnAuthorization Method - ServicesApiController

I am exposing web API through ServicesApiController and want to authorize user through [AuthorizedUser(@"sitecore\ServicesAPI")] attribute of the function, everything is working fine, but instead of ...
0
votes
1answer
135 views

Yet another “The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called” question

I am on Sitecore 9.1. I have read this question and this other one; my configuration is as follows. In order to execute my code on startup, I hijack the initialize pipeline: <pipelines> <...
1
vote
0answers
266 views

jQuery AJAX GET request returning “parsererror” error response message

In a scope of Sitecore Web project an API Contoller is used. Got the following response error message during jQuery AJAX GET API request: On a back-end side I use IHttpActionResult action method that ...
1
vote
2answers
134 views

RESTful API for getting incremental changes?

I would like to call an API to Sitecore to get changes of Media Library files stored in Sitecore. So given a Media Library, I would like to list the New Files, Updated Files and Deleted files since a ...
2
votes
2answers
116 views

Custom facet data not being updated after initial flush to xDB

What i want to do: Save and update facet data repeatedly through WebApi Read the facet data through WebApi Everything works fine, until the contact stops being updated. It seems as if, once the ...
1
vote
1answer
162 views

ServicesApiController in referenced project/DLL

I'm trying to create some web APIs in a new class library outside of my main website project (still in the same solution). In this library I've added the following API Controller: namespace My.Custom....
1
vote
1answer
828 views

How to use Authenticated request with the Sitecore RESTful API

As explained in the official Sitecore documentation, I'm using the following block of code to login into the Sitecore. module.exports = function (context, req) { var XMLHttpRequest = require("...
0
votes
1answer
3k views

Sitecore WebApi custom route not working controller not found

Controller: public class ExampleController : Controller { private readonly ISitecoreContext _sitecoreContext; public ExampleController () { } [System.Web.Http.HttpGet] ...
1
vote
2answers
711 views

loading partial view from jquery

I am trying to swap partial views on my home page layout via jquery. I have 3 tabs which when clicked, would load their respective partial view into a placeholder on the main layout. In my ...
0
votes
1answer
122 views

'Unable to connect to SQL Server database.' - webAPI

using: VS-2017(as admin), sitecore-8.1.2 and SQL - 2012. I created a ASP.Net web application - WebAPI to read content from my local sitecore instance. In the "ValuesController.cs" I am using the ...
2
votes
1answer
480 views

Sitecore JSS integrated mode with subsites

I have created separate bindings for the basic and advanced sample JSS apps as outlined in https://jss.sitecore.net/#/setup/sitecore-config?id=sitecore-configuration 127.0.0.1 JssBasicApp 127.0....
6
votes
2answers
2k views

WebAPI Controllers not being found in Sitecore 8.2

I'm working in a Helix-ish solution on Sitecore 8.2. I can't seem to register any WebAPI controllers. The routes are fine. I've dug pretty far into the GlobalConfiguration and determined that it's ...
3
votes
1answer
460 views

Get user privileges on item via Sitecore RESTful API

I am looking for a good way to figure out what privileges a user has via the Sitecore RESTful API. For example, I can use the RESTful API for ItemService: /sitecore/api/ssc/item/{itemId}?fields=...
0
votes
2answers
188 views

Migrating content from sitecore 7.2

So we need to migrate content from sitecore 7.2 to sitecore 8. But it's not only migrating, we also need to modify the content in order to have updated content in the new instance. Our original ...
0
votes
1answer
567 views

Can I use Sitecore Item Web API to insert items into bucket list from different application

I am in the need to expose a restful api which eventually will insert items to bucket list available in sitecore. This api will be cosnumed by another MVC application to push records into sitecore ...
2
votes
1answer
2k views

Sitecore webapi No HTTP resource was found that matches the request URI (404)

I would like to add some web api to my project but I am getting error that No HTTP resource was found that matches the request URI What I could miss in settings or how I can see all sitecore routs ...
1
vote
5answers
5k views

Web Api controller returning 404 despite returning payload

I have created a WebApi controller, and it's returning the payload OK (i.e. I see the correct response in the browser), however the status of the request is a 404, which obviously causes problems with ...
0
votes
1answer
91 views

Custom web api returns dynamic links for rich text field if logged in to sitecore

I have created a custom web api which converts glass object to json string. The glass object involves rich text field where internal links can be used. The link is fully rendered to absolute path in ...
4
votes
3answers
2k views

ServiceApiController Method not found when using HttpPost and ComplexType (Sitecore 8.1.3)

I am working on refactoring some code and want to create WebApi services to do so. I have created an initialization pipeline that registers custom routes. I am still able to follow base sitecore ssc ...
6
votes
1answer
113 views

Do we have an API for sitecore 6.6

I want to acess the sitecore items from outside context . Do we have an API to acess Sitecore Items in Sitecore 6.6?
3
votes
2answers
1k views

Web API 404 on content delivery server

I am using Sitecore on azure and have a CD and a CM server. The Web API works fine on CM but throws a 404 error (and no more information in logs). I have deleted the following dll files from server ...
0
votes
1answer
391 views

Create users from API

We are trying to build a stand-alone API, which has to meet this requirement. The API gets inputs for "Name" & "Email" and should then create user in any chosen Sitecore instance. As this is a ...
4
votes
1answer
2k views

Sitecore 8.2 - Best way to expose sitecore data to external system as web api

In sitecore 7.2 I had customized sitecore web api to expose data from sitecore to external system as API. I am just wondering if something new/enhanced has been added in sitecore 8.2 to expose data ...
2
votes
1answer
669 views

Does implementing a WebApi service using ServicesApiController expose a significant security risk?

I have been following Anders Laub's tutorials on implementing some WebAPI controllers using ServicesApiController and just like at the bottom of this page I received the 403 Forbidden error when ...
1
vote
2answers
311 views

Run serialize command from outside the Sitecore as a service

So I am faced with a challenge. I need to create a REST Services that will allow me to serialize Sitecore tree from outside the Sitecore. Is there some kind of service like this in place? Or this need ...
0
votes
2answers
635 views

Sitecore 8.2 How to sort items based on a specific parameter within a content item

So I have a list of items (e.g. FAQs). and I am calling them through the WEB Api. I want to be able to do a get from Sitecore and be able to sort based on the date created and sort it either ascending ...
8
votes
1answer
2k views

WebAPI Attribute Routing Not Picking Up Routes

Sitecore 8.2 rev 160729 My understanding is that, as of Sitecore 8.2, you no longer need to call .MapHttpAttributeRoutes() because it's now included (in fact, it'll throw an error if you do). However,...
5
votes
2answers
3k views

Sitecore 8.2 with Web API 2

Does anybody have any experience with Web API and Sitecore? I've got a custom database for data not managed by Sitecore, but will be presented alongside Sitecore data. The API calls work fine when ...
3
votes
1answer
851 views

publish item remotely using c#

For testing purposes we would like to create publish and remove some items in Sitecore using a remote testing- client in C#. Sitecore.Services.Client api seems the most logical way to create and ...
4
votes
0answers
478 views

UseTaskFriendlySynchronizationContext in WebApi calls

I'm trying to use Async tasks in my custom web api calls in Sitecore. I've successfully followed this article http://www.agehrke.com/2015/08/web-api-controller-in-sitecore-8/#comment-18861. However I'...
4
votes
4answers
517 views

Executing Sitecore logic from a Windows Scheduled Task

One of the frequent problems that I have seen with Sitecore is the inability to control the exact time that a scheduled task should run. Since the machine's clock will be far more accurate, what I ...
10
votes
4answers
12k views

WebApi failing to resolve dependencies

I am trying to resolve an implementation via constructor injection, however keep getting the following: An error occurred when trying to create a controller of type 'ApiController'. Make sure that ...
7
votes
2answers
587 views

How can I utilise MongoDB for non-xDB related things in my Sitecore solution?

Assuming we have a sparking new Sitecore installation running, and have already invested in the relevant MongoDB infrastructure to keep the solution running 24x7 and so on - how can I make further use ...
11
votes
1answer
2k views

Web API 2 Attribute Routing with Sitecore 8.2 Initial Release

Has anybody setup web api 2 attribute routing with 8.2 initial release? I tried the 'official' route, which is to create a custom pipeline handler to the initialize pipeline that does the registration....
3
votes
1answer
610 views

“String was not recognized as a valid DateTime” error

Images do not appear in Select Media dialog when I click Browse button in Image field. HTTP response from ItemWeb API that expected to return Images contains this error: String was not recognized ...
7
votes
3answers
2k views

How do I control access to Custom Item Web API controllers?

I am creating a Web API (Controller) inside my Sitecore solution by inheriting ServicesApiController and EnableCors attribute. This service will be called from any IPhone/Android Application (...