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
1answer
22 views

Sitecore Analytics api new method in 9.0 version

We recently upgraded our project to Sitecore9 initial release from 7.2. We were re-compiling our code including latest Sitecore.Analytics.dll We are getting this error if (Tracker.IsActive) { ...
3
votes
5answers
875 views

Cannot find packages containing StandardController

I am very new to Sitecore, trying to implement a basic controller inheriting from StandardController. I've followed the official Sitecore docs for setting up the environment to work with MVC here: ...
2
votes
1answer
133 views

How to fetch users in particular domain programmatically in Sitecore9

We recently upgraded our project to Sitecore9 initial release from 7.2. We were re-compiling our code including latest Sitecore.Kernel. We got this error: error CS0117: 'Factory' does not contain a ...
0
votes
1answer
122 views

Show Multi-list selected items on view by glass mapper

I am able to get Guid of seleced items by Glass Mapper but i don't know how i can get those item by Id and show them on view. Glass mapper property that i am using is: [SitecoreField("Media Links")] ...
0
votes
0answers
152 views

Multilist items render on MVC view by razor sysntax

I have a footer template that have Title, Description and links. Links are multi-list. I need to render the selected items from links multi-list with Title and description on footer view. I know how ...
6
votes
1answer
1k views

How to get Descendants of a Sitecore item using Glass mapper?

Is there any direct approach to get descendants(child items and sub child items) of a Sitecore item in Glassmapper model. I know [SitecoreChildren] can be used in GlassMapper model to get Child items....
2
votes
1answer
167 views

Unable to retrieve a Sitecore Item

I am trying to retrieve a Sitecore.Data.Items.Item using this line: var myItem = Context.Database.GetItem("/sitecore/content/x"); but instead of an Item I get a null exception. I have also tried ...
0
votes
1answer
103 views

'Sitecore.SecurityModel.Cryptography.IHashEncryption' from assembly 'Sitecore.Kernel

I have this problem with the instance of the Sitecore. A made a publish from VS project with the same Sitecore.Kernel.dll and Sitecore.Mvc.Dll of the instance. After that I cann't reach anymore the ...
2
votes
2answers
661 views

Sitecore 9 forms redirecting to formbuilder link on submit

I am having an issue when submitting a form when there is no redirect. Basically i have a contact us form and eventually will implement a email action. But every time i click the submit button even ...
3
votes
1answer
369 views

What’s the best practice to Expose Sitecore 9 APIs for Mobile Apps Development? [closed]

Currently, I am looking Sitecore CMS solution for native mobile app development. Mobile App Team is using Swift for IOS and Java for Android. So we have a limitation to use JSS react native for ...
2
votes
2answers
478 views

How to retrieve image url in MVC view from model

I am new to Sitecore. I am trying to create a small demo which will display all the products with its image and description. But i am getting error in my view also i am not able to display anything. ...
4
votes
1answer
163 views

Livetime section Valid From and Valid To

I have item with publishing restrictions. After apply restriction for item I see that in Livetime section Valid From and Valid To fields was set. It's ok. But when I'm trying to get item by id: ...
1
vote
0answers
294 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 ...
0
votes
0answers
278 views

Sitecore SolrNet - The given key was not present in the dictionary error

We are using SolrNet open source client in Sitecore 9.0 update2 and SXA 1.7 version. We have written this code to get SolrConnection: Assert.ArgumentNotNull(searchcontext, "searchcontext"); var ...
3
votes
0answers
25 views

Restoring marketing taxonomies with Sitecore powershell extenstion

I am trying to automate Sitecore upgrade from 8.1 to 9.0.1. In Upgrade steps, There is one step restoring deleted marketing taxonomies, which can easily be done with Url navigation and click button on ...
0
votes
1answer
279 views

How to remove 'route' object in Sitecore jss layout service api response?

When I get the data from http://{domain.name}/sitecore/api/layout/render/jss?item=/&sc_apikey=[api-key] Then response is like {sitecore: {context:{something}, route:{something}} But I don't want ...
3
votes
1answer
512 views

LinkManager.Provider is deprecated in Sitecore 9, how to get the default provider then?

The following code works in Sitecore 8.2 but not in Sitecore 9: var provider = LinkManager.Provider; The Provider property is not available anymore in Sitecore 9 Sitecore.Kernel, what should I use ...
1
vote
1answer
99 views

Error while saving SXA page from Experience Editor [closed]

I am trying to save the page after doing edits in SXA page from Experience editor and getting below error every time. This is occuring only for this page. In network tab, the response for ...
4
votes
1answer
488 views

Sitecore 9 in Azure PaaS : Add Application Insights SDK

For Sitecore 9 on Azure PaaS and newer versions, what is the best practice to Add and configure the Application Insights SDK in Visual Studio to generate some telemetry in Visual Studio. As we are ...
2
votes
1answer
273 views

Action methods in ServiceApiController is not catching the request

I'm using Sitecore 9 and I have created a ServiceApiController to enhance Sitecore API. I put a simple action method but it doesn't catch any request and I get this exception: Document not found - ...
7
votes
1answer
121 views

Is there a method in Sitecore's utilities to format a numerical file size in a friendly way?

The title pretty much says it all. I feel like I've come across a method in the past that does something like: long fileSize = 524288000; string prettyFileSize = Sitecore.SomeUtility....
0
votes
1answer
210 views

Unable to fetch item using getitem method

I was trying to access item using getitem method from SOAP service. Sitecore.Data.Items.Item item = Sitecore.context.Database.GetItem(<ID>) But Item is null. I tried to fetch using Id and path ...
0
votes
0answers
179 views

Programmatically move items from web to master database?

I have a utility page that creates Sitecore items from a csv file. This utility page is used to import thousands of items at a time, which are used for interactive map data. The items are stored in ...
1
vote
1answer
60 views

Get prefetch cache created status

Is there any way to understand the status of prefecth cache ? What i want to understand is that if the prefetch is already created or not ? When i disassemble the sitecore.kernal , I see a property ...
0
votes
1answer
328 views

User Profile table in SQL

I am saving a user profile and one of the field is "UserLanguage" which is saving fine Context.User.Profile.Save(); The save method is working as expected but where the User Profile being saved in ...
0
votes
1answer
62 views

WFFM custom toggle switch [closed]

I am adding toggle switch as a custom field. Toggle.cs (Toggle C# code) public class Toggle: Sitecore.Form.Web.UI.Controls.Checkbox { } public class ToggleField : Sitecore.Forms.Mvc....
2
votes
1answer
59 views

Fetching Final renderings in an .aspx page

I am creating a script to fetch rendering parameters of a sublayout and edit data template item field data based on the values of fields of rendering parameters. I was able to fetch renderings in ....
8
votes
2answers
208 views

What is alternative of “.PageMode.IsExperienceEditor” property in JSS-react?

What is alternative of .PageMode.IsExperienceEditor property of Sitecore.Context in JSS-react to verify the ExperienceEditor context ?
0
votes
1answer
668 views

Sitecore support for async controller renderings

I am planning to use ASP.NET async pattern in my Sitecore project, but I'm getting the error: Asynchronous method which returns task as result cannot be executed synchronously Is there a way to ...
4
votes
1answer
91 views

Content Item batch retrieval in .Net code?

Is there a way to retrieve a set of content items from Sitecore's APIs in batches, besides using the REST API? I'm looking at improving performance for a client's Sitecore site. A lot of the legacy ...
1
vote
1answer
324 views

Sitecore keywords in the metadata

Lets say we have 4 renderings on the Page and each rendering has a data source attached to it which has a Keyword field that is being used for SEO purpose. Is it possible to get all the attached ...
1
vote
1answer
216 views

How to add renderings programmatically when another rendering is added

Which pipeline should I use when a new rendering is added in the presentation? I have a scenario to add renderings programmatically if a particular rendering is added in the item. I will write a ...
0
votes
1answer
179 views

Sitecore 7.2 using droplink

I will start out by saying I am a bit of a noob when it comes to C# and Sitecore, but I am getting better. I am trying to update our code to use a droplink control for an event item (we'll call it ...
17
votes
3answers
2k views

What does headless mean in the context of Sitecore?

There have been numerous discussions around headless capabilities supported by the Sitecore platform. What does that even mean? What product offerings from Sitecore support headless capabilities? ...
1
vote
0answers
33 views

Not able to create a new SXA Accordian items in IE

I am trying to add a new SXA Accordian component from Experience editor in IE but not able to get 'Create' link which is working fine in Chrome. PFB Screenshots
1
vote
1answer
31 views

Creating an item with the API returns 201, but then I cannot find the item?

Note: I am using a trial instance of Sitecore 9.0.2. I create an item: curl -X POST \ https://mysitecoreurl/sitecore/api/ssc/item/%2Fsitecore%2Fcontent%2FHome%2Ffolder1 \ -H 'Content-Type: ...
0
votes
1answer
367 views

How to check Server side whether session is time out or not?

As I am new to Sitecore and working on session time out functionality in Sitecore. Instead of redirecting to login page I've to display session time out warning message to end user and How to validate ...
0
votes
0answers
44 views

“virtual” sites in the navigation tree

When I have have my navigation tree with page X and page Y and some content on page X and I need to show the same page X with the same content under an other content tree. E.g. page X under page Z. ...
1
vote
1answer
129 views

Experience Profile custom facet retrieval error

I was trying to create custom facets in Sitecore 9.0 Update 1. I was able to create one and add a custom tab in experience profile. I fill the custom facet data with the help of a WFFM form. I see the ...
2
votes
1answer
270 views

Updating droplink field value by name

I'm trying to update a droplink field value using its name but I get the following error: Value not in the selection list The code is item.Fields["__Subitems Sorting"].Value = sort; // sort ...
1
vote
2answers
136 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
1answer
247 views

What do I need to do to display an image on my web page using the ItemService API?

I've uploaded a few images of kittens, teddy bears, flowers, and other cute things to a folder within the Sitecore Media Library. I now need to access them using the ItemService API and display them ...
1
vote
2answers
247 views

Force saving of an item

I have several newly added save events for existing items. Any way to force a save of an item? When I do $item.Editing.BeginEdit() / $item.Editing.EndEdit() in PowerShell it returns false since ...
1
vote
2answers
159 views

Publish items using the JavaScript ItemService API

I'm using the ItemService API in Javascript to login to sitecore and dynamically create items (documentation i'm using) var xhr = new XMLHttpRequest(); xhr.open("POST", "http://<your server>/...
0
votes
1answer
303 views

How to integrate an external API with Catalog in Sitecore Commerce 9.0.2

I want to fetch the data from an external API and show it for my Catalog items. The API basically contains the details of my sellable items like product price, name and other details which properties ...
1
vote
1answer
417 views

How can I add custom catalog attributes in Sitecore Experience commerce 9 and populate it with data from API?

I want to add new attributes for my catalog in Sitecore Experience Commerce 9 update 2 but not sure how to add it using the Sitecore Experience platform. Moreover all the properties data need to be ...
5
votes
1answer
239 views

What is the ShutdownGuard and how should I use it?

I heard someone mention the use of ShutdownGuard for long running precesses. How does one properly make use of this and what are some cautions around its usage?
1
vote
1answer
380 views

Import Media Items in Sitecore Media Library ItemService Restfull API

We are implementing a solution that requires importing media items like images inside Sitecore Media Library. Found it is achievable with Old WebApi, however nothing mentioned equivalent in Sitecore ...
1
vote
0answers
145 views

Can't create contact list

I couldn't create contacts list and getting following exception, HTTP POST URL http://x/sitecore/api/ssc/ListManagement/ContactList Exception Sitecore.XConnect.XdbSearchUnavailableException: The ...
0
votes
1answer
116 views

How to make Sitecore.Context.Item.Fields work in a web control in an external project

I have a Web Forms page and it uses Sitecore.Context.Item.Fields. This works when I publish to the local Sitecore instance. But in my project that is external to the Sitecore instance, Visual Studio ...