Questions tagged [sitecore-api]

For questions related to Sitecore's API, covering questions about how to access, create, update or or delete data, as well as questions about how the Sitecore code-base is or can be used for custom or native logic, etc.

Filter by
Sorted by
Tagged with
2 votes
1 answer
32 views

Create item with branch as template using ItemService API

Good afternoon, I'm trying to create Item using REST API and branch ID as the Template ID the service returns a 400 "Template is invalid" error. Does anyone know if there is a way to create ...
  • 21
0 votes
0 answers
24 views

How to remove Server HTTP Header from Sitecore GraphQL API response?

The Sitecore GraphQL API endpoint is returning Server HTTP Header in its response which has information on the hosting web server (IIS). This is a security issue as it gives the attacker information ...
  • 101
0 votes
0 answers
22 views

Session from GetPageItemProcessor is null in Service layer

I am having a PageUnavailableProcessor, which extends GetPageItemProcessor. This Processor helps in redirecting to a user-defined Page for all 403 errors (we are tagging the pages by language and ...
0 votes
0 answers
29 views

Fatal Error Required Validator DateTime Field not working

I created a new required Field Validator for a DateTime field. Image Attached. I added the Fatal Error message so the user cannot save. I added the validation Rule to the template field. Images ...
  • 101
0 votes
1 answer
34 views

How to return IHttpActionResult while using SitecoreController

I'm not getting proper response as per below return value. Currently i'm getting response as namespace of Project as : Feature.SitecoreAPi.Platform.Controller.TestAPIController+HttpActionResult. ...
1 vote
2 answers
46 views

IServicesConfigurator not found

My Sitecore web application is a .Net Framework 4.8 Web application. I am trying to integrate Sitecore DI container. I have added Nuget packages for Microsoft.Extensions.DependencyInjection, Microsoft....
0 votes
0 answers
30 views

Sitecore DropTree field render in JSS layout service API

I am using DropTree field and I selected the listing page Item. so now I want to see the selected item full path in the layout service API. Actually Layout Data "componentName": "...
0 votes
1 answer
47 views

How to replace image in sitecore media library programmatically [duplicate]

Database master = Sitecore.Configuration.Factory.GetDatabase("master"); var item = master.GetItem(new ID("{493E6479-D647-4120-A543-B20924F24978}")); item.Editing.BeginEdit(); //I ...
0 votes
1 answer
53 views

Is there any way to expose Sitecore Api? So that 3rd party application can use POST request and further sitecore application can manage POST request

I have 3rd party application, and I want to send some data to sitecore application using POST method. So is it possible to handle HTTP POST within sitecore MVC ? If yes please suggest how to proceed
1 vote
1 answer
38 views

Update Sitecore ImageField with Media Item from Content Hub

I'm writing a program that creates a new asset in Content Hub using the upload API. How do I attach that newly created asset to theImageField of an item in Sitecore. Most of the examples show how to ...
0 votes
0 answers
34 views

How can I allow editing of Sitecore CMS data to users outside my network?

I'm currently working on a project to create a non-commerce product listing site where listings are created and managed by our external partners, who will validate by a different IDP from internal ...
0 votes
1 answer
92 views

How can I get the content from a Page and all its Components in JSON format?

I have a website with Sitecore 10.1 and MVC. There is a requirement to get the page data and data of all components placed on the page in a single JSON object. We are not using the Sitecore layout ...
0 votes
1 answer
107 views

Does Sitecore 10.2 support async code? [duplicate]

Say we have a SitecoreController which has async Task endpoints.. so my question is does sitecore support this async code? I have heard that there were some issues with async code while returning ...
  • 101
-1 votes
1 answer
85 views

Sitecore Broken Links report

Needs to get all the broken links for clean up purpose. Please let us know do we have any custom code to get all the broken links without power shell script. When we try get all broken links Sitecore ...
  • 87
2 votes
2 answers
86 views

Sitecore DropTree Query

I am using Sitecore 9. I am having a problem trying to populate the droptree in the template(source). The template ID for the Apple, Banana and Peach is {AB86861A-6030-46C5-B394-E8F99E8B87DB} and the ...
  • 101
1 vote
1 answer
93 views

How to get all the published items without publish:itemProcessed event

We have installed sitecore publishing service module to separate publishing. Earlier we were using publish:itemProcessedevent to get all publishing items but with Sitecore Publish module this event is ...
  • 87
3 votes
2 answers
195 views

Need Rest API in Sitecore which can create, get, update , delete and publish items in sitecore without writing any code

Is there any Rest API in Sitecore which can create, get, update , delete and publish items in web instance and Solr without writing any code
3 votes
1 answer
66 views

Unable to access Sitecore Publish service get request

We have a custom dashboard for monitoring all servers health check, as part that we have one component to display publishing statistics (Here we display ongoing, queued publish items). Now we are ...
  • 87
0 votes
2 answers
99 views

How to terminate/Kill Sitecore publishing using Sitecore publishing module

We have installed Sitecore publishing module (3.1.1) for Sitecore 9.0.1 version, we have multiple content authors and they are publishing multiple items simultaneously because of this few of the ...
  • 87
1 vote
1 answer
87 views

Cd url is going to 404

I have downloaded Sitecore Next JS containers setup and installed XP1 in our local instance. But the default CD url is going to 404. The CM Sitecore url including Experience Editor & Preview and ...
0 votes
3 answers
63 views

Sitecore MultilistField.Remove() is not able to remove items from selected list

My Code is something like this MultilistField multilistField= item.Fields["FieldID"]; foreach (var item in multilistField.GetItems()) { if (multilistField.Contains(item.ID....
0 votes
0 answers
71 views

Sitecore Forms IViewModel and InputViewModel bool error

I am trying to get the value from the Sitecore forms in Sitecore(9.3). Actually, I am trying to hook up the Mailchimp with the Sitecore forms, following the URL. https://sitecoreguys.blogspot.com/...
  • 101
0 votes
2 answers
133 views

How to map child items using glass mapper 5.8?

I want to map child items which come from a parent datasource and I gave the parent datasource as the datasource for the rendering. This is my Datasource in my rendering This is my list of child ...
0 votes
2 answers
146 views

Sitecore 10.2 upgrade - Some sitecore folders are not displaying

We are doing Sitecore upgrade from 9.2 to 10.2. When we reusing the same new publishing targets in upgrade, we couldn't able to see the Layout/Templates/System folders. We can see that, if we can ...
  • 199
0 votes
0 answers
73 views

Sitecore forms showing form page after submission instead of thank you message

Sitecore forms showing form page after submission instead of thank you message. But thank you message showing for few seconds and vanish quickly.
  • 199
0 votes
1 answer
64 views

Sitecore Forms script are not loading intermittenly

We have Sitecore forms added in one of page and we have referenced the RenderFormsScript method. Intermittently script are not loaded in to our pages. Is there way to find the root cause?
  • 199
0 votes
1 answer
54 views

How to use OData API key with custom integrated API .NET 4.8 MVC controller?

https://doc.sitecore.com/xp/en/developers/91/sitecore-experience-manager/api-keys-for-the-odata-item-service.html https://www.linkedin.com/pulse/sitecore-api-key-throttle-series-2-md-arifuzzaman-arif/ ...
0 votes
1 answer
38 views

Searching for events of custom model type in XConnect

I have cloned this repo and updated it to run with Sitecore 10.1 (which is our current version): https://github.com/adeneys/cortex-processing-demo The above application has functionality to create a ...
2 votes
1 answer
63 views

How to get the closest items in the Sitecore tree?

I would like get the closest list of items, if the items starts with particular name in the sitecore tree. In the tree, if i am in Item page, i have to take all the closest items start with Item ...
  • 199
0 votes
1 answer
95 views

Solr returns 500 exception for /solr/sitecore_master_index/update

We have deployed Sitecore into Azure. In Solr server we noticed a 500 exception(/solr/sitecore_master_index/update). Sitecore log shows the below exception: Exception: SolrNet.Exceptions....
  • 87
0 votes
0 answers
43 views

While rebuilding sitecore index getting java.nio.file.NoSuchFileException

We have deployed Sitecore instance in Azure.When we try to rebuild master index getting below exception. We are using Sitecore 9.0.1 version. java.nio.file.NoSuchFileException: D:\home\site\wwwroot\...
  • 87
0 votes
1 answer
89 views

When this URL(/sitecore/shell/Applications/Buckets/Services/Search.ashx) gets called

We have deployed Sitecore into the Azure cloud. We often see Sitecore CM instance getting down, to fix this slowness check the http5xxx error on the azure web APP. As part of troubleshooting noticed ...
  • 87
0 votes
0 answers
55 views

How can I use Commerce API in order to add data to the Shared Environments database?

I made a Sitecore API and registered a Router, and after that, I called it through PostmanAPI. I write a command process to add data to the database but follow the default when inheriting from ...
0 votes
1 answer
589 views

Create API controller in sitecore

I am using Sitecore 10 and trying to implement an API controller, but I got this issue when calling API in postman https://{mydomain}/saveform { "Message": "An error has occurred.&...
0 votes
0 answers
32 views

Sitecore Send an email with link to set password for a new virtual user

I'm using Sitecore 10.2 I'm currently creating a new virtual user. However I wanted to generate a link that is valid for a day and mail this link to the newly created virtual user. The virtual user ...
0 votes
0 answers
10 views

"Components does not exist" when creating custom entities on Sitecore XC 10.1

I created a custom entity following this guide: https://websterian.com/2018/10/10/sitecore-commerce-adding-an-entirely-new-entity-part-1-commerce-engine-and-business-tools/ I got an error when I ...
0 votes
0 answers
87 views

ERROR Forbidden when call API /api/GenericSearch from Postman Sitecore XC 10.1

After I deploy Sitecore.Commerce.Engine.SDK.7.0.55, I use postman and call to API /GenericSearch() follow this doc: https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-commerce/search-...
0 votes
0 answers
78 views

Error 404 when calling Custom Plugin API from Sitecore 10.1 SDK

I use the Sitecore.Commerce.Engine.SDK.7.0.55 solution to create a new custom plugin from the template Sitecore.Commerce.Plugin.Sample (I left the default, not customized). Then I build and add ...
1 vote
2 answers
198 views

Show Items in drop tree dynamically based on Sites

I have a requirement to show the datasource item in droptree field and its a multi site solution. My content tree structure is as below WebSite A Home Global ...
0 votes
1 answer
180 views

How can I Override Sitecore’s Media Handler to force user to redirect to login Page if user is not Authenticated

I need a way to prevent access to files in media items if a user is not authenticated. If a user is not authenticated he/she should be forced to redirect to login Page. If a user is authenticated then ...
  • 97
1 vote
2 answers
171 views

Reset Sitecore 10.2 control editor and inetpub folder in the root directory

I have installed Sitecore 10.2 using SIA and I need to reset the control editor (so that all the templates and sites created get deleted) and the inetpub folder gets cleared up as well. Is there a way ...
  • 45
0 votes
1 answer
106 views

I was unable to setup my Sitecore 10.2 Angular app using latest NPM version 8.6.0 Node 17.8.0

While setting up my first headless Sitecore 10.2 angular app, I was getting errors like unable to resolve dependency tree Sitecore version 10.2 NPM version 8.6.0 Node 17.8.0 Command that is failing: ...
0 votes
1 answer
100 views

200 error on a bad URL request

Well this is weird, we have a Sitecore 9.1 multisite, and when someone tries to access https://www.abc.com/www.cc.com/ it is redirecting to 200 status code but with a server error message but if I ...
0 votes
4 answers
335 views

Sitecore LINQ Case-Sensitive Query

This is my code for searching a data in the specified index: using (var context = ContentSearchManager.GetIndex(Common.Constants.IndexNames.PlotTreeIndexName).CreateSearchContext()) { var ...
1 vote
2 answers
110 views

Get all items in Archive and Recycle Bin

The code I know for getting the archive is Sitecore.Context.Database.Archives["archive"]. I checked the method and it has GetEntries() but it needs to be supplied with ItemID. Is it possible ...
0 votes
2 answers
226 views

Is there a way to access Azure keyvault secrets from sitecore site

I have some secrets stored in azure keyvault. Using the following code, I was able to get the secret values via a console application. using System.Management.Automation; Collection<PSObject> ...
  • 349
0 votes
1 answer
310 views

How to read values from ConnectionString config file

I want to get values from ConnectionStrings.config. Currently, I hard-coded the string in my code which I copied in ConnectionStrings.config. Is there a way via Sitecore API to fetch values from this ...
0 votes
2 answers
70 views

Get ArchiveEntry fields through the Item API

Is it possible to retrieve the fields of an ArchiveEntry type using Sitecore Item API? e.g. archiveEntry.Fields["FieldName"]
2 votes
1 answer
169 views

How to mock MediaManager in Sitecore using nSubstitute and xUnit

I am in the process of setting up some unit tests for a Sitecore project (using this guide as a starting point: https://www.codeflood.net/blog/2020/05/17/logicless-view-itemless-model/) I have come ...
3 votes
1 answer
270 views

How to mock an ImageField in Sitecore using nSubstitute and xUnit

I am in the process of setting up some unit tests for a Sitecore project (using this guide as a starting point: https://www.codeflood.net/blog/2020/05/17/logicless-view-itemless-model/) I have come ...

1
2 3 4 5
8