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
1 vote
2 answers
102 views

How to get data from an API using XM Cloud

I am new to Sitecore products and my company has just purchased XM Cloud. I have gone through tutorials and classes about how to create and edit a site but I still do not understand how I can get ...
Pete's user avatar
  • 113
0 votes
1 answer
49 views

Set Sitecore dropdown filed value based on email field value

I have a Sitecore form with an email field and dropdown fields. I want to populate the dropdown field values as soon as the user enters an email. An ajax call will be made to check the email against a ...
kartik's user avatar
  • 1
0 votes
3 answers
134 views

Handling ajax response on page load

In JS file, we're collecting some data on home page and sending to JS function called sendPageData() as an input parameter. In this sendPageData() function, we're calling $.ajax call and merging this ...
Sukhjeevan's user avatar
1 vote
2 answers
463 views

Sitecore api- create item with multilist and Media item

I am using sitecore rest api, I am able to create item, also populate Content item values (for Field type Single-line) with PoSt method. Content field values are being in passed in body of rest client ...
Akshay D's user avatar
2 votes
1 answer
52 views

ICollection<ID> property not populating correctly in API controller method when using FromUri + Model

I have an API route that uses [FromUri] in combination with a custom class that defines the values that can be passed in via query string params: [HttpGet] [Route("sitecore/api/search")] ...
Marcel Gruber's user avatar
1 vote
1 answer
449 views

Sitecore services client 403 when login called from different web application

TL;DR: Sitecore services client 403 when login called from a different web application (IIS process), but not when called from Postman PROBLEM: RESTful Web API (web service) written in C# running on ...
T H's user avatar
  • 123
0 votes
1 answer
66 views

Post an XML to a webservice with the sitecore form fields

I am working on an application where I created a form using sitecore forms. When the user submits the form, It should read all the fields from the forms and add it to XML element and post the XML ...
Raj's user avatar
  • 1
0 votes
0 answers
18 views

Sitecore And Web Service on Same Hostname not working [duplicate]

We have a Sitecore instance with a domain - abc.com and a Custom WebService is created which is also using the same domain as abc.com/internalservice.asmx, upon calling this service from Sitecore ...
Rohan Bhateja's user avatar
0 votes
0 answers
19 views

Path-analyzer showing the Web API request [duplicate]

Sitecore : 9.1 + JSS 11.0 Integrated mode What we have: We have written certain APIs in our Sitecore solution. The front-end code access those APIs on the page-load. In the Path-analyzer, we see the ...
NutsAndBolts's user avatar
  • 1,310
0 votes
0 answers
137 views

Connect Sitecore to External source for data authoring

We have an external data source (SQL or via API). That data needs to be managed by our content authors. i am looking at something this can be done by tool or minimal customization. I tried to create ...
Night Monger's user avatar
0 votes
1 answer
245 views

Can I start PowerShell background job through PowerShell Web API endpoint?

I have a PowerShell Web API endpoint running on Azure that takes more than the maximum duration of 230 seconds on an Azure Web App. Is it possible to start a background job consisting of PowerShell ...
Serge van den Oever's user avatar
-1 votes
2 answers
528 views

How to get the Item referrers using Item Web API / Sitecore Services Client in C#? [duplicate]

I have created Items using Item Web API. Now I want to get the unused items on my site. So I'm trying to get the item references using Item Web API. var referrers = Globals.LinkDatabase.GetReferrers(...
Rajasekar's user avatar
  • 692
2 votes
1 answer
1k views

Sitecore 9.2 Dependency Injection in ApiController

I have a standard .net ApiController with the following code: public class LibraryApiController : ApiController { private readonly ILibraryAssetRepository _repository; public ...
Hos's user avatar
  • 884
1 vote
1 answer
831 views

Html.Sitecore().Rendering() causes: Attempt to retrieve context object of type 'System.Web.Mvc.ViewContext' from empty stack

We have a web controller inside our Sitecore 8.2 Site that returns a search box view. The controller is exposed as an API endpoint like so: {url}/api/search/large/ When making an http web request to ...
Adam Seabridge's user avatar
1 vote
3 answers
1k views

Getting 404 error with custom Web API [duplicate]

We have Sitecore 9.0 update 2 site running on Windows Server 2016. We've added a custom web api controller. We are able to successfully request the custom web api methods on our local environment ...
Brian L's user avatar
  • 71
0 votes
1 answer
190 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 ...
Akanksha's user avatar
9 votes
3 answers
2k 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 ...
Pinoy2015's user avatar
  • 185
1 vote
0 answers
329 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 ...
navan's user avatar
  • 11
1 vote
3 answers
2k 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 ...
Siva Kumar's user avatar
0 votes
1 answer
499 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 ...
Colema18's user avatar
  • 321
1 vote
1 answer
1k 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 ...
PaRsH's user avatar
  • 159
1 vote
1 answer
1k 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. ...
Jijo Viswanathan's user avatar
1 vote
3 answers
12k 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 ...
Ashish Bansal's user avatar
0 votes
1 answer
1k 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> <...
Emanuele Ciriachi's user avatar
1 vote
0 answers
2k 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 ...
Vadzim Papko's user avatar
1 vote
2 answers
238 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 ...
Nicholas DiPiazza's user avatar
2 votes
2 answers
221 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 ...
Kristian Nissen's user avatar
1 vote
1 answer
306 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....
TheHvidsten's user avatar
1 vote
1 answer
2k 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("...
Slrg's user avatar
  • 289
1 vote
1 answer
6k views

Sitecore WebApi custom route not working controller not found

Controller: public class ExampleController : Controller { private readonly ISitecoreContext _sitecoreContext; public ExampleController () { } [System.Web.Http....
nari447's user avatar
  • 407
1 vote
2 answers
2k 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 ...
Nick's user avatar
  • 159
0 votes
1 answer
266 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 ...
Sunil's user avatar
  • 77
2 votes
1 answer
1k 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....
staccata's user avatar
  • 553
7 votes
4 answers
7k views

WebAPI Controllers not being found

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 ...
Ben Lipson's user avatar
  • 1,362
4 votes
1 answer
739 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=...
jeremyr's user avatar
  • 165
0 votes
2 answers
291 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 ...
Joel Alvarez Myrrie's user avatar
0 votes
1 answer
731 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 ...
Umar D's user avatar
  • 169
2 votes
1 answer
3k 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 ...
Arbejdsglæde's user avatar
1 vote
5 answers
9k 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 ...
David Masters's user avatar
0 votes
1 answer
198 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 ...
Bevin's user avatar
  • 91
4 votes
3 answers
3k 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 ...
Derek Port's user avatar
6 votes
1 answer
115 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?
Prakash's user avatar
  • 1,059
3 votes
2 answers
2k 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 ...
Aloïs de La Comble's user avatar
0 votes
1 answer
611 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 ...
sukesh's user avatar
  • 3,033
6 votes
1 answer
2k views

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 ...
Tanzil Khan's user avatar
2 votes
1 answer
785 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 ...
Iceape's user avatar
  • 617
2 votes
2 answers
571 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 ...
Tony's user avatar
  • 569
0 votes
2 answers
862 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 ...
Tony's user avatar
  • 569
8 votes
1 answer
3k 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, ...
Ben Lipson's user avatar
  • 1,362
7 votes
2 answers
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 ...
Iceape's user avatar
  • 617