1

Is there any way to get Item or Item id using Sitecore Service client based on the fields in the master database.

Search term:

http://{host}/sitecore/api/ssc/item/search?term=12345&includeStandardTemplateFields=False&fields=Email

Result JSON:

"TotalCount": 1,
  "TotalPage": 1,
  "Links": [],
  "Results": [
    {
      "Email": "emailid"
    }

But I need the Item Id or Item itself

3

Yes it is feasible to get the item id from the return result. You just need to add the itemidin the field projection. Please see below the updated Rest API

http://{host}/sitecore/api/ssc/item/search?term=12345&includeStandardTemplateFields=False&fields=Email,itemid

I did a small test with the home item and the result are shown below (which returns the item id from where it got the result)

REST API

http://{domain}c/sitecore/api/ssc/item/search?term=home&includeStandardTemplateFields=False&fields=itemid,title

Response

{
  "TotalCount": 2,
  "TotalPage": 1,
  "Links": [],
  "Results": [
    {
      "ItemID": "8e18ac80-0084-4859-8df4-d8a2fffa5f3b"
    },
    {
      "ItemID": "110d559f-dea5-42ea-9c1c-8a5df7e70ef9",
      "Title": "Sitecore Experience Platform"
    }
  ]
}

More information can be obtained from the Sitecore Documentation - The ItemService.

In the section ItemModel return values, it shows what are the different values that it returns. You just need to specify them in the field projection.

| improve this answer | |
  • Hishaam Namooya , okay i will try. – Rameshkumar Feb 23 at 10:39
  • Thanks Hishaam Namooya, its working. – Rameshkumar Feb 23 at 10:51

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.