130 likes | 303 Views
Using SharePoint 2013’s REST API with JavaScript / jQuery for building client-side solutions. Who Craig Pilkenton. Solution Architect with Slalom Consulting SharePoint .NET SQL Server Powershell Started with “Tahoe” back in early 2000 craig.pilkenton@slalom.com
E N D
Using SharePoint 2013’s REST API with JavaScript / jQuery for building client-side solutions
WhoCraig Pilkenton Solution Architect with Slalom Consulting • SharePoint • .NET • SQL Server • Powershell Started with “Tahoe” back in early 2000 craig.pilkenton@slalom.com http://www.linkedin.com/in/craigpilkenton
WhatSharePoint 2013 REST Interface REST? • Representational State Transfer – in SharePoint since 2010 version • Based on the OData protocol • Simply, it is a GET or POST in the URL to SharePoint, same as for retrieving web pages • Open a SharePoint _API URL, pass in Query String parameters to filter or sort the data, and get back simplified datasets of JSON or XML, just like an RSS or ATOM Feed
WhyGetting things done quicker Why do I care? • Can be accessed cross-browser and cross-platform • With Office 365, it’s one of only 2 ways to query or push data into SharePoint • Can use any standard Web languages such as JavaScript/jQuery or PHP, and any technology stack or language that supports REST to access almost all SharePoint capabilities and entities now • Doesn’t require loading up CSOM/JSOM libraries (and writing CAML queries!), unless specific entities are needed (e.g. Managed Metadata, Workflows, etc.) • Allows visualization of data beyond just what List Views or DataViews can do
HowBrowsers What do I use? • FireFox with FireBug add-on is my favorite browser (need to turn off Feed-Reading option) • Internet Explorer – F12 developer tools • SoapUI or Runscope.com
WhenCustom views of data When’s a good choice? • Office 365 Napa apps, of course! • Single-Page Applications (SPA’s) to limit post-backs • Showing row data in a custom summed or grouped format • Creating picture rotators / banners or incorporating graphs and charts
When…continuedSimple Applications Data Visualization / Forecasting Web Part
When…continuedSimple Applications JavaScript Web Part Fed from Lists and causes postback Employee Finder Web Part Content By Search Web Part with Search Templates
When…continuedSimple Applications JavaScript Web Part with tabbed header of core feeds Social Feeds Web Part Pulls in the last 3 public posts, formatted similar to application
When…continuedSimple Applications “Save My Searches” Web Part Captures and saves URL for ‘replaying’ SharePoint Searches
When…continuedSimple Applications JavaScript Web Part that saves without postback Send Feedback Web Part All data queried from and stored in a SharePoint List
How-to’sLinks & Such • MSDN Magazine – Understanding and Using the SharePoint 2013 REST Interface • NothingButSharePoint.com – Using the updated SharePoint 2013 REST API versus the SharePoint 2010 model • CodeAcademy – jQuery Track • .appendTo() – Learn JavaScript/jQuery free