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
0answers
70 views

Encrypt zip file while uploading to media library folder sitecore 8.2

i have followed the sitecore link and create my custom processor for (Sitecore.Pipelines.Upload.Save). i have faced issues while saving all media items. it gives error on file.SaveAs(filename); ...
0
votes
2answers
1k views

How to filter an Item's children based on its template?

I have a navigation component that should list the current page in a hierarchy of items. I use below line of code to build navigation tree. return item .GetChildren() .Select(i => ...
0
votes
1answer
507 views

Programmatically Execute Workflow Action of an item from a URL

I am trying to execute a Workflow Action "Approve" or "Reject" from a URL to an ID, is my approach correct? I need help finishing it, how do I run this code from a URL and how do run it on any ID, I ...
1
vote
1answer
312 views

How to add item in contact custom facet List type property

I have created a custom facet model with Sitecore 9.0.1 & xConnect. My contact custom facet contains a property of List<string> which I want to populate with different values while contact ...
1
vote
1answer
861 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("...
2
votes
1answer
293 views

Sitecore Scheduler job automatically stopped running

I have a sitecore scheduler job running every 60 minutes, It used to be every 10 minutes but after testing I changed it to run every 60 minutes <agent type="XYZ.Scheduler.AdviserSync" method="Run" ...
1
vote
1answer
341 views

Sitecore Scheduled Tasks and Dependency Injection

I am using sitecore workflow action in order to execute method, but the DI inject services not working, what i have to do to solve this issue ? EX: basiclly i have work flow that will call ...
0
votes
1answer
249 views

Is it possible to display field name in View(cshtml) using glass mapper

I am trying to display field name using Glass Mapper in view rendering in following format: FieldName - FieldValue FieldName - FieldValue Ex: Country - USA City - New York I ...
0
votes
0answers
32 views

Sitecore Item Api Fail Fast

i am wondering why did i could create the same Item repeatedly and remove the same item repeatedly on the same requests. Does Sitecore automatically commits database changes on the end of requests? ...
5
votes
1answer
96 views

How to update XDB with customer details in a separate thread

I noticed the call to update the customer details onto xDB is taking considerable amount of time so I would like to do it in a separate thread so that application does not have to wait until the ...
0
votes
1answer
632 views

Get parent item and it's all child item from solr searchresultItem

I have a requirement that needs to get particular item along with all child item or some of the child item using template id from solr searchresultitem. Can anyone help how to achieve this?
1
vote
0answers
137 views

Injecting dependencies into custom ServicesApiController without using ServiceLocator

I am injecting a dependency into an custom Api controller I've created that is inheriting from ServicesApiController. I have found that I need to use our service locator class to do this as otherwise ...
1
vote
1answer
418 views

Sitecore GEOIP Issue with load balancer

In a project, I have implemented Sitecore GEOIP to get visitor's country information. In local, it was working fine but when we deployed it in Production environment, GEOIP was not able to get visitor'...
0
votes
3answers
658 views

Getting “Message: Service has been disposed, cannot create object” with Glass.Mapper

I'm using Glass.Mapper v4.5.0.4 and Sitecore 8.2 (rev. 170407). I'm doing an import into Sitecore and am using the SitecoreService.Save(T target) method for creating and saving items. I have the ...
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
0answers
114 views

Sitecore MultiLanguage Content changes the URL. Results 404, Not found error

I'm having an issue in my site.I'm using VirtualFolder property to change the site language content. I've a link 'Environment' and my default site language is Chinese. So,the URL looks like www.xyz....
1
vote
2answers
747 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 ...
1
vote
1answer
396 views

Advantages of servicesapicontroller over api controller

I've been looking for best way to expose a api that returns data in Sitecore and I found some implementation which use ServicesApiContorller, what are the advantages of using this controller over ...
1
vote
1answer
43 views

Updating xDB on async mode on Sitecore 8.2 update 4

We are pushing the customer details into xDB when they login. The problem is we may have times where more than 5k customers could be accessing the site at the same time, So I don't want updating xDB ...
-2
votes
1answer
470 views

Looping through items in bucketed folder [duplicate]

For a project I am working on, I am attempting to figure out how to loop through a bucketed folder programmatically using C#. In viewing the bucketed folder structure, the bucket folder nests the ...
0
votes
1answer
127 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 ...
0
votes
1answer
55 views

CD site setup for one country / subset of languages

Planning to setup 2 new CD servers which contain only French and English language pages. All other language versions should not exist in new web db. I took the existing web db backup and setup site ...
1
vote
2answers
475 views

ItemWebService not working

So I need to retrieve an item using the sitecore API. So firstly, I need to log in, Im following what this site states: https://doc.sitecore.net/sitecore_experience_platform/developing/...
0
votes
1answer
211 views

Finding siblings in buckets

We've a folder item which stores all new artciles. This item is bucketable. But after turning into a bucket, we are not able to find previous and next sibling of an item under bucket. The below code ...
0
votes
0answers
542 views

How to automatically escape item paths for use in Sitecore query

Is there some API utility method which can automatically escape an item path for use in a Sitecore query? I am building a query string in code which uses an item path. If the item path contains a ...
1
vote
0answers
215 views

Sitecore Commerce Categories children is not being populated. “GetNavigationViewModel”

I have setup Sitecore 8.2 + Commerce Server + SOLR I have created Catalog under departments. "Commerce Catalog Manager" [Commerce Catalog Manager] ABC (category) ZYX (sub Category) ZZZ (sub ...
1
vote
2answers
146 views

Context.Site is null within LinkProvider code triggered from FileSystemWatcher callback

Scenario in our Sitecore 8.1 instance is that, we have a .NET FileSystemWatcher object that is initialized in Application_BeginRequest of global.asax. When a file is dropped in the watched folder, ...
2
votes
1answer
495 views

Best way to Use Sitecore Data for other Application?

I need to create the separate ASP.NET Web API 2 Application for the Native mobiles Apps (Andriod and IOS), that will consume the Sitecore web application data. Currently it’s on the same solution and ...
4
votes
3answers
1k views

Sitecore Item - Generated HTML

One of client wants to send email using standard .NET SMTP client. I would like to know How I can generate HTML of my Sitecore item which has all layouts and renderings configured and assigned that ...
2
votes
3answers
186 views

One CD server site goes down-Notification

Using 3 CD server to host my sitecore site. Using load balancer navigating the traffic on servers. Some time one of the CD server site goes down how we can get notification. Is there any way run some ...
1
vote
0answers
130 views

Restricting user from forcing manual submit to the Sitecore Url

Looking for the best practices to tackle a user behavior in my Sitecore 7.5 application. Basically there is an action method decorated with the [HttpPost] attribute. This action is invoked through ...
2
votes
1answer
298 views

Intermittent issues with the Sitecore Ajax Post request while invoking a MVC Action [closed]

I have an application running on Sitecore 7.5 where my code is invoking an MVC Action at client side. The action method is decorated with the [HttpPost] attribute. https://www.XYZ.com/api/sitecore/...
0
votes
2answers
379 views

Store media item in Sitecore somewhere else instead of Media Library

Is this possible to store Media items in some other Content tree node in place of Media Library?
5
votes
1answer
123 views

Creating friendly imageurl in scheduled job

I am using a scheduled job to import some content into Sitecore. Hereby I am inserting inline images into a rich text editor field. I determine the src of the img tags by using: string url = ...
4
votes
2answers
2k views

How do I get an Item from Sitecore's internal URI protocol?

I have a reference to an item that uses the sitecore: protocol: "sitecore://master/{...GUID HERE...}?lang=en&ver=0" I could attempt to parse this URI manually to look up the item, but I'm pretty ...
2
votes
0answers
95 views

Updating Sitecore renderings programmatically [duplicate]

I am trying to update the renderings (more than 12) programmatically. I have around 1000+ items and each item as multiple languages (8+). I have developed the tool to see which all items as renderings ...
2
votes
1answer
767 views

Sitecore field.GetItems() returns no items on Non English version

We have an item which is having a multilist field in it. This field has selected value and the below code is working fine on English version. Other language versions are returning empty result. We ...
0
votes
2answers
725 views

How to unlock sitecore items programmatically

The best practice for content editors is to check in Sitecore item after editiing is done.But they often don't follow this practice. So when some other Content editor comes to that item, he manually ...
0
votes
1answer
553 views

solr Sitecore full text indexing ifilter

I'm attempting to index the content of pdf's with Solr 6.6.2 and Sitecore 8.2 Update 6. I've got my solr indexes working correctly, and I'm able to search text from pages (content items) and I'm able ...
0
votes
1answer
187 views

Is there a way to use a rich text field as meta tags?

Is there a way to use a rich text field as meta tags? I'm picking up where someone left off and they are trying to use a Html.Partial to load a cshtml file that pulls from a rich text field. This is ...
1
vote
1answer
68 views

WebApi queries on nonexistent resource returns 200

I am using the Sitecore 7.2 Item Web API to retrieve some items. Using fast queries I am not able get a "404" in case an item doesn't exist (even if i don't use fast queries, i still don't get 404). ...
1
vote
0answers
84 views

How to get input value from textbox and store that in content tree in Sitecore?

I have created a textbox and button in a View Rendering. Now I want to know that how to store the input value from this textbox by clicking button and store that in content tree. How would I do that?...
3
votes
1answer
1k views

Object reference not set to an instance of an object in Experience Profile (SC9 & SQL xDB) [duplicate]

I’ve successfully installed SC9 and have been able to push contacts into xDB via xConnect without any problems. I can see the contacts in the SQL database and that bit is working fine. Something ...
1
vote
1answer
2k views

Sitecore api calls returns 403

This question is similar to sitecore api service returns 403. I got the system admin to set the security policy to ServicesOnPolicy However, I'm still getting 403 error. In SOAPUI, I am using the ...
10
votes
2answers
5k views

How to get the our local date and time from the sitecore datetime field(raw value format - yyymmddThhmmssZ)?

I have set the date in the sitecore item for some datetime field as below. And its getting saved as below format in the master/web database. 20170401T073000Z When I try to get that value using the ...
1
vote
1answer
370 views

Get Sitecore page content dynamically

I'm trying to get a page's content dynamically so I can open in a modal. What's the best way of getting the html from a page given an ID/page url?
2
votes
3answers
183 views

Data re-writing from Sitecore 7.2 with SPE

So I need to re-create some content from Sitecore 7.2 to a new Sitecore 8 instance. What we had in mind is to create a script using PowerShell in the new Sitecore 8 instance to fetch the needed data ...
4
votes
1answer
390 views

Change field type from Droplist to Droplink

I have content items with Droplist field. I want to change this field to Droplink field type. What is the best solution/practice to change it without losing already existing data?
4
votes
1answer
679 views

Receiving 404 error when accessing Item Web Api with Sitecore 7.2

Im trying to use the item web api in sitecore 7.2 to retrieve https://[hostname]/-/item/v1/sitecore/content/ in postman, but it returns a 404 not found error (the whole 404 not found html page of ...
7
votes
2answers
449 views

How to copy an item to multiple locations

What is the easiest and quickest way to copy an item to various locations? I have about 100 multisites in a solution and I have created a new template. I need to create a new item inheriting this ...