2

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 exposed the APIs by controller and we are using the Sitecore context directly using DB.

Now, there are a couple of options to get Sitecore Data in separate application as below:

  1. Sitecore.Services.Client
  2. Sitecore Item WebApi
  3. Direct Sitecore API using Sitecore Database and Sitecore reference.

What would be the best approach for this scenarios? Any suggestion

NOTE: My Sitecore instance and new Mobile API server will be on the same network and part of Subdomain

8

This is a tricky question to answer as what is "best" can often depend on your solution.

So let's look at the options:

  • Item Web API - as @sitecorebasics said, the Item Web API is not supported in later versions of Sitecore, so even if you are on a version that it supports, I would not use it as it will make upgrades harder.
  • Sitecore Services Client - This is a good option if you have fairly simple requests for items or groups of items and you are ok with the data being an instance of Sitecore.Services.Core.Model.ItemModel
  • Custom - This is the option I pick most often, if you need a custom format returned, or need to do anything complex in the service call, its probably best to roll your own rest API using controller methods that return Json objects.

Ultimately - you need to look at the requirements for the project and work out what is the best option for that project.

  • HI Richard, I also preferred the Custom one option – Ashish Bansal May 25 '17 at 5:14
  • HI Richard, Thanks for the suggestion I also preferred the Custom one option, because I have more control on code and can manipulate the data as per my requirement, and only thing is to get some sitecore configuration in the web API project, in order to get the sitecore database refrence. – Ashish Bansal May 25 '17 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.