0
votes

I am using the Sitecore Item Web API for a Sitecore 7.5 and 8. And in both I am getting a empty list for the fields in the JSON returned.

Sample of request:

GET http://sitecore8/-/item/v1/?sc_database=web&sc_itemversion=1&language=default&payload=Content&scope=s&sc_itemid=%7b11111111-1111-1111-1111-111111111111%7d HTTP/1.1
X-Scitemwebapi-Username: sitecore\admin
X-Scitemwebapi-Password: b
Host: sitecore8
Connection: Close

Response:

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
X-Powered-By: ASP.NET
Date: Mon, 18 May 2015 17:54:53 GMT
Connection: close
Content-Length: 597

{"statusCode":200,"result":{"totalCount":1,"resultCount":1,"items":[{"Database":"web","DisplayName":"sitecore","HasChildren":true,"Icon":"/temp/IconCache/Applications/32x32/Document.png","ID":"{11111111-1111-1111-1111-111111111111}","Language":"en","LongID":"/{11111111-1111-1111-1111-111111111111}","MediaUrl":"/temp/IconCache/Applications/48x48/Document.png","Name":"sitecore","Path":"/sitecore","Template":"System/Root","TemplateId":"{C6576836-910C-4A3D-BA03-C277DBD3B827}","TemplateName":"Root","Url":"~/link.aspx?_id=11111111111111111111111111111111\u0026amp;_z=z","Version":1,"Fields":{}}]}}

Does anybody has any idea what I am missing?

Tks a lot..

1
Try to change payload=content to payload=fullMarek Musielak
As Marek states, changing that setting will likely be the answer. In the example above you are requesting the fields for the Sitecore node with the content payload . With this setting the api will only bring back the content fields for the item excluding system fields. The sitecore node doesn't have any content fields hence an empty fields collectionIan Graham
So actually you might be better off keeping the content setting and requesting a different item rather than the sitecore node.Ian Graham
Hi, thanks guys. I've tried already with Full payload. Actually I've played around with all the properties, payload, scope, extractblob, etc. Also it is happening in the custom implementation I want to use it and in a fresh sitecore 8 installation I have here.RobertoBr
In the sample I got above I am using the 1111(...) item. But I have also tried with a few other real content items.RobertoBr

1 Answers

0
votes

Damm.. the processor to get the fields were commented out in my configuration files.

<itemWebApiGetFields>
        <!--<processor type="Sitecore.ItemWebApi.Pipelines.GetFields.GetFields, Sitecore.ItemWebApi" />-->
</itemWebApiGetFields>