Martin Andersen Martin Andersen - 19 days ago 13
reST (reStructuredText) Question

How to get data from Sitecore

I am a newbie to Sitecore and I want to ask if it possible to get data from sitecore via. some REST API or if I can intercept when form data changes and save it to a json file.

Answer

There are a few ways to do this depending on what version of Sitecore you are using, but the most robust at the moment is to use the Sitecore Services Client Framework:

https://sdn.sitecore.net/upload/sitecore7/75/developer%27s_guide_to_sitecore.services.client_sc75-a4.pdf

You can use the ItemService REST api to get data out of Sitecore in json format of if you need more control over the data you can use the EntityService. This is specific to Sitecore 7.5 and above.

If you're in an earlier version then you have the Item Web api:

https://sdn.sitecore.net/upload/sdn5/modules/sitecore%20item%20web%20api/sitecore_item_web_api_developer_guide_sc65-66-usletter.pdf

If you planning on intercepting data on Web Forms for Marketers forms then you're best off using a Custom Save Action to save form data to a json file:

http://www.roundedcube.com/Blog/2016/creating-a-custom-save-action-for-sitecore-wffm

Comments