Using REST in SharePoint Designer to cross Site Collection Boundaries

REST queries allow working with SharePoint Foundation list data in XML format, and any application that can send REST URLs to SharePoint Foundation can retrieve its list data. As an example, the REST interface uses the new joins feature of lists, so that when SharePoint Foundation receives an ADO.NET Data Services query that implements the joins feature, the query is translated into a native Collaborative Application Markup Language (CAML) query.

REST is limited in SP 2010 because Microsoft did not finish the service to use Managed Metadata Services.

http://bp.rlan.ca/_vti_bin/ListData.svc gets all lists etc. available?

http://bp.rlan.ca/sites/wm/_vti_bin/ListData.svc/WorkItems Gets all work items in the list

http://bp.rlan.ca/sites/wm/_vti_bin/ListData.svc/WorkItems(2)  Brings back item 1, enter (2) it will bring back item 2.

http://bp.rlan.ca/sites/wm/_vti_bin/ListData.svc/WorkItems?$filter=(Title eq ‘jim’)    this one filters on title to return 1

()/(http://bp.rlan.ca/_vti_bin/ListData.svc/<ListName>(<Index>)/(<Field>)

http://bp.rlan.ca/sites/wm/_vti_bin/ListData.svc/WorkItems?$filter=(StatusValue eq ‘Completed’) – filters only completed items

To see XML instead of Feed view go to Internet Options > Content tab > Feeds and web Slices Settings button and Uncheck feed reading view.

stopped testing here

http://sp2010/_vti_bin/ListData.svc/Tasks?$metadata — describes the entity types for every list in the website

http://bp.rlan.ca/_vti_bin/ListData.svc/Tasks?$orderby=Name –sorts by name

http://bp.rlan.ca/_vti_bin/ListData.svc/Tasks?$filter=Project/Title eq ‘My Project Title’  — Uses a navigation property to filter the list by title of a related project.

http://bp.rlan.ca/_vti_bin/ListData.svc/Tasks?$expand=Client – Shows XML  parent

QueryString parameters for REST

  • $filter
  • $expand
  • $orderby
  • $skip
  • $top
  • $metadata (will bring back all the XML metadata about the object. Think of it like WSDL for your REST call)
    Examples

http://bp.rlan.ca/_vti_bin/ListData.svc/Tasks?$orderby=xxx&$filter=(2010 eq year(NewsArticleDate))and (06 eq month(NewsArticleDate)) and (ContentType eq ‘News Article’)

Advertisements