Yes, I know. REST is simple…but first things first. You have a single development VM containing SharePoint 2010 Beta 2 and you want to experiment with REST but keep getting those painful 404 errors? Ok, here are the basics to setting up REST with SP 2010 Beta 2.
- Install ADO.NET Data Services (CTP 2) http://www.microsoft.com/downloads/details.aspx?FamilyID=a71060eb-454e-4475-81a6-e9552b1034fc&displaylang=en
ADO.NET data services is just a piece of the larger pie called WCF Data Services in .NET (note: CPT 2 above is based on .NET v3.5) http://msdn.microsoft.com/en-us/data/bb931106.aspx
Note: As of 1/27/2010 ADO.NET Data Services has been updated here ==> http://www.microsoft.com/downloads/details.aspx?familyid=79d7f6f8-d6e9-4b8c-8640-17f89452148e&displaylang=en to SP1
2. On your development VM (say on your top level site) identify a list, or lists you want to experiment with.
You can start by just entering the ListData.svc URL as follows (my SharePoint instance is http://win-dcbei0i59th/SitePages/Home.aspx) so I can enter something like http://win-dcbei0i59th/_vti_bin/ListData.svc
The above result (in atom) returns an enumeration of the lists on my sample site.
3. ListData.svc is case sensitive so if you want to work with a specific list you need to keep that in mind. For example, to work with the Calendar the URL is
http://win-dcbei0i59th/_vti_bin/ListData.svc/Calendar (not calendar)
to work with the task list use
4. The general filter syntax for read operations is rather simple, which is great. Here is a sample
http://win-dcbei0i59th/_vti_bin/ListData.svc/Calendar?$filter=(Title eq ‘TEST2’)
Other parameters exist ($filter,$expand,$orderby,$skip,$top,$metadata) as well as great ways to use this new service, here are a few