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
0 votes
0 answers
28 views

Sitecore itemservice showing 404 page not found after upgrade [closed]

We are upgrading our SXA site from Sitecore 8.2 to 9.3. The frontend part is in Angular and content is exposed to angular using SSC. After the deployment of code to Sitecore 9.3, we are getting 404 ...
user avatar
1 vote
2 answers
105 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 ...
user avatar
0 votes
1 answer
30 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 ...
user avatar
  • 87
1 vote
2 answers
85 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 ...
user avatar
  • 39
0 votes
1 answer
26 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: ...
user avatar
0 votes
1 answer
60 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 ...
user avatar
0 votes
4 answers
110 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()) { ...
user avatar
1 vote
2 answers
48 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 ...
user avatar
0 votes
2 answers
74 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> ...
user avatar
  • 317
0 votes
1 answer
75 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 ...
user avatar
0 votes
1 answer
23 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"]
user avatar
2 votes
1 answer
58 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 ...
user avatar
3 votes
1 answer
92 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 ...
user avatar
2 votes
2 answers
145 views

What is the best way to check if the Item is being inherited from a template?

I am using Sitecore 10.1 and I am upgrading my code from the Sitecore 8.2 solutions. I want to know the best practice to check if the Item is being inherited from a template? The requirement is to use ...
user avatar
  • 1,011
1 vote
1 answer
26 views

Sitecore Role creation API

Is there a Sitecore Role creation API similar to item creation ? Can I map user to roles using Sitecore REST API?
user avatar
1 vote
1 answer
48 views

How to add a multiline text fields values in a single cell of excel in Sitecore MVC

I am using Sitecore 8.0 . We have one Export of data feature using Excel. For all the fields the data is getting exported in a cell properly ,but for the Multiline text field the text is getting ...
user avatar
  • 181
0 votes
0 answers
45 views

How to display the JSON content of a SXA page in a sequential order in Sitecore 9.0.1?

We have a Sitecore SXA website. Sitecore version is 9.0.1, SXA version is 1.7. I am fetching the json data of a page by using default Sitecore resolvers and appending ?sc_device=json. But ...
user avatar
  • 181
0 votes
1 answer
189 views

Sitecore CD Error Value cannot be null. Parameter name: item

I am getting an error when i try to hit any page in CD. It was fine and all of sudden started receiving this error. I am not able to figure out what caused this issue. Could anyone faced this issue ...
user avatar
0 votes
0 answers
24 views

How can I get all language versions of an item using the OData API?

I am retrieving a list of items using the OData REST API with the URL <server>/sitecore/api/ssc/aggregate/content/Items?sc_apikey=<key>. Without specifying a language parameter in the URL, ...
user avatar
  • 103
0 votes
0 answers
29 views

Sitecore Commerce Bootstrap - Database Login Error

I am trying to get the commerce engine running. generated the toke and running the bootstrap command, getting the below error 'Login failed for user 'sa'. I have given full permissions on the commerce ...
user avatar
  • 153
0 votes
1 answer
47 views

Change the template and retain the field value (internal link to a general link)

I have a template and it is inherited. I have a field called website. I need to change the website field from internal link to a general link. When i do that, I loose all the values. How can i retain ...
user avatar
  • 33
0 votes
0 answers
82 views

Images show relative path in preview mode but in Normal it shows absolute path Media.MediaLinkServerUrl Setting

I have changed one of the settings in both cd and cm server in the Sitecore.config file to show the absolute path for our media images. The setting is Media.MediaLinkServerUrl <setting name="...
user avatar
  • 33
0 votes
2 answers
66 views

Sitecore (version 8.2) Itemservice returns a 404 NotFound

As the title suggested, I'm getting a StatusCode NotFound (404). Everything as far as I know has been setup correctly. Been reading and following this to a T: https://doc.sitecore.com/en/developers/82/...
user avatar
0 votes
0 answers
78 views

How can I get UploadedFile (upload from out of box Sitecore Form) Blob / fileContent?

How can I retrieve Filecontent from [sitecore_forms_filestorage].[FileStorage] based on id value? I tried the below code, but got a "_fileStorageProvider is null" error. Guid fieldid = Guid....
user avatar
4 votes
0 answers
1k views

Is there a generic way to get page source of current page / Sitecore.Context.Item without downloading it?

Is there a generic way to get the HTML page source of the current Sitecore.Context.Item without downloading it, so, it will cover all (WebForms/Sitecore.Mvc/JSS etc.) scenarios? Is it possible to get ...
user avatar
  • 677
0 votes
1 answer
35 views

Trying to use the Sitecore ItemService in our UITests but receiving a 500 error with the following log

As the title says, our project contains a a UITesting project that uses the ItemService to login and do perform actions such as create an item, check if an item exist, etc. However for one of our ...
user avatar
0 votes
0 answers
28 views

Deleting the item from the WEB database when the item unpublish date and time is over [duplicate]

I have an item. I select the Date and time for that item to unpublish(MASTER). When the date and time passes, I switch to the web database and I still see that item there. We have a service that calls ...
user avatar
  • 33
0 votes
2 answers
54 views

Possible to retrieve PDFs deleted from the media library or retain their URL for new version?

I have deleted some PDFs from the Sitecore media library by replacing them with new PDFs which were already added to the library. As a result, the media URL is now changed. The owner now says they ...
user avatar
  • 1
0 votes
0 answers
83 views

Issues with Federated Authentication on a multi site architecture for separate client id per site

For a multi-site architecture, we have separate client id for each site under the same Auth0 Domain. In the IdentityProviderProcessor, whenever I try to assign clientId for the relevant site inside ...
user avatar
1 vote
1 answer
78 views

Get current site in IdentityProvidersProcessor for Federated Login

We have a multisite architecture, and I am working on implementing the federated authentication using Auth0 for visitors login/signup. I need to fetch separate client id and secret per tenant based on ...
user avatar
0 votes
0 answers
59 views

XHTML validation error when trying to edit from experience editor

I have a aspx layout file with format <a href "www.abc.com"> <sc:Placeholder Key="footer1" runat="server" /&...
user avatar
  • 1
2 votes
1 answer
88 views

Jss not recognized as internal or external command while running in C#

I am calling a batch file via c# using powershell library, I see the below error 'jss' is not recognized as an internal or external command, Whereas manually executing the batch file runs with no ...
user avatar
  • 317
0 votes
2 answers
132 views

Content Search API issue with Droplist and Treelist fields

I am facing a weird(might not be weird for experienced people) issue where ContentSearch API is returning null value for few fields while I can see the correct values in Solr. The fields whose values ...
user avatar
1 vote
1 answer
41 views

Custom facet field

In sitecore 9.3, when creating a new facet in documentation it is stated "Field Name - The lower case name of the field that is used in the index and that the facet is based on. You can enter ...
user avatar
0 votes
1 answer
58 views

How can I use the taxonomy identifier instead of the id, using the REST API?

I am working on a connector with a Sitecore Content Hub environnement. I am using the REST API, sending POST request to create some Assets. I wonder if there is a way to set a taxonomy relation with ...
user avatar
  • 11
2 votes
1 answer
261 views

How to show success message alert on form submit in Sitecore 9 Forms in the same page?

I am trying to implement a custom Sitecore 9 Forms (not WFFM forms) functionality. And I need to show a success alert message on successful submission of the form. But here's the catch, The success ...
user avatar
  • 33
-1 votes
2 answers
108 views

Sitecore instance and website in same browser with different tab is not working

Recently upgraded Sitecore 8.1 to 9.3, after that we are trying to open Sitecore instance and website in same browser with different tab but custom web services are not getting called while it is ...
user avatar
1 vote
1 answer
160 views

How to expose Sitecore SXA website content in JSON format to third party using custom API?

We have a Sitecore SXA website. Sitecore version is 9.0.1, SXA version is 1.7 We have to share the website content to third party in JSON format using custom API. So third party will consume this API ...
user avatar
  • 78
0 votes
0 answers
109 views

Sitecore SXA dynamically changing presentation at runtime

I have a Sitecore 9.2 SXA solution currently holding five Sites. Let's say Tenant Corporate Site1 Site2 Shared Site3 Site4 All Sites are accessible, except for Shared, where there's a source of ...
user avatar
0 votes
1 answer
130 views

Sitecore.Context.Database.SelectSingleItem("/page-help") not working in CM

I have a code that query an alias item like this Sitecore.Context.Database.SelectSingleItem("/page-help") but I get an error saying End of string expected at position 42. it only throws ...
user avatar
0 votes
1 answer
84 views

How to Update Form submission Information in sitecore 9?

User Submit the Form data, insert those values by default in to "[ExperienceForms].[sitecore_forms_storage].[FieldData]" Table. how can we edit using API or Power Shell script?
user avatar
0 votes
0 answers
54 views

Dynamic Sitemap created from Content Hub data

So I am already using the built-in sitemap generator that comes with Sitecore 9.3 and that works fine. I am able to get out pages that are in the content tree. The issue comes when my company wants to ...
user avatar
0 votes
0 answers
15 views

Sitecore A route named 'sitecore_graphql_/api/xx' is already in the route collection. Route names must be unique. Parameter name: name [duplicate]

I am new for Sitecore JSS. I am using Sitecore 9.3/SXA/JSS - I am not able to login into my Sitecore after deploying UI components. I am getting "Sitecore A route named 'sitecore_graphql_/api/xx' ...
user avatar
0 votes
0 answers
93 views

Websocket integration in sitecore 9.3

We need to integrate the WebSocket client into the Sitecore project. We are using controller rendering, but I am not able to understand how to establish duplex communication with a WebSocket server. I ...
user avatar
0 votes
1 answer
26 views

How do I display the RTE/ Word Content in Asp.net webforms?

We have bee using Sitecore 8.1 and in 8.1 we use the Field Types RTE and Word more . Due to some reason i had to use Asp.net Webforms not MVC. Can any one please help me how do i dispay the content of ...
user avatar
  • 384
0 votes
1 answer
53 views

Different results on different machines when fetching a Sitecore RTF

I'm building a web application and experiencing a weird issue. I have a Sitecore RTF containing some formatted text and a link In my web application I have an HTML file with the following snippet: <...
user avatar
0 votes
1 answer
49 views

How can I automate the reconnect of a Sitecore XC catalog after initialize of Commerce Engine?

Working with Sitecore XC, we need to reconnect the commerce catalog every time we do an initialize of the Commerce Engine. We can do this initialize optionally during development. We need to execute ...
user avatar
2 votes
1 answer
94 views

Sitecore ItemService API resolve .../link.aspx?_id=abc

the Sitecore ItemService API returns a field ÌtemUrl which contains something like this ~/link.aspx?_id=35D02976C748402A8E6F22A2827F4451&amp;_z=z Is it possible to turn this into a URL like www....
user avatar
  • 45
1 vote
1 answer
124 views

Sitecore 9.3 FXM API 403 error

We are getting a 403 error when creating an external site in console logs and the following error message in External Site page: Could not validate beacon script - The remote server returned an error: ...
user avatar
1 vote
1 answer
267 views

Raw HTML in a Multiline text field in Sitecore 9.3

I created a new field in a template, it is a Multi-Line Text(name html field). I created a component and added on the page. I go to experience editor. click on the component to edit it. The html ...
user avatar
  • 33

1
2 3 4 5
7