SlideShare a Scribd company logo
1 of 32
Introduction to the SharePoint 2013 Client Object
Model and REST API
Rob Windsor
rob@robwindsor.com
@robwindsor
About Me
ī‚§ Senior SharePoint Consultant
ī‚§ Technical Contributor to the Pluralsight On-Demand Library
ī‚§ Microsoft MVP, MCPD, MCT
ī‚§ Founder and Past-President of the North Toronto .NET UG
ī‚§ Co-author of Prof. Visual Basic 2012 and .NET 4.5 (Wrox)
Client Object Model (CSOM)
ī‚§ API used when building remote applications
ī¯ Designed to be similar to the Server Object Model
ī¯ Introduced in SharePoint 2010, expanded in SharePoint 2013
ī¯ Slightly different versions for SP 2013 on-premises and SP Online
ī‚§ Three implementations
ī¯ .NET Managed, Silverlight (plus Mobile), JavaScript
ī¯ Façades on top of /_vti_bin/Client.svc
ī‚§ Managed implementation has two versions
ī¯ Version 15 is for use against an on-premises farm
ī¯ Version 16 is for use against SharePoint Online
ī‚§ Communication with SharePoint done in batches
Client Object Model Coverage
ī‚§ Sites, Webs, Features, Event Receivers
ī‚§ Lists, List Items, Fields, Content Types, Views, Forms
ī‚§ Files, Folders
ī‚§ Users, Roles, Groups, User Profiles, Feeds
ī‚§ Web Parts
ī‚§ Search
ī‚§ Taxonomy
ī‚§ Workflow
ī‚§ IRM
ī‚§ E-Discovery
ī‚§ Analytics
ī‚§ Business Data
Communicating with SharePoint
ī‚§ All CRUD operations are automatically batched
ī‚§ Requests for resources batched using Load and LoadQuery methods
ī‚§ Batches are executed using ExecuteQuery or ExecuteQueryAsync
ī¯ This triggers a POST request to Client.svc/ProcessQuery
ī¯ Message body contains XML document with batched request information
ī¯ Response contains requested resources in JSON format
Client Object Model Authentication
ī‚§ .NET Managed
ī¯ Windows credentials passed by default
ī¯ ClientContext.AuthenticationMode
ī¯ Default
ī¯ Anonymous
ī¯ FormsAuthentication
ī¯ ClientContext.Credentials
ī¯ Expects System.Net.ICredentials
ī¯ NetworkCredential, SharePointOnlineCredentials, â€Ļ
ī¯ ClientContext.FormsAuthenticationLoginInfo
ī‚§ Silverlight and JavaScript
ī¯ Credentials of the hosting Web application are always used
Retrieving Resources Using Load
var context = new ClientContext(siteUrl)
var web = context.Web;
context.Load(web);
context.Load(web.Lists);
context.ExecuteQuery();
ResultsListBox.Items.Add(web.Title);
ResultsListBox.Items.Add(web.Lists.Count);
ī‚§ Indicates object data should be included in next batch retrieval
ī‚§ Not all property values are retrieved
ī¯ Example: collections of associated objects
var context = SP.ClientContext.get_current();
var web = context.get_web();
var lists = web.get_lists();
context.load(web);
context.load(lists);
context.executeQueryAsync(success, fail);
function success() {
var div = jQuery("#message");
div.text(web.get_title());
div.append("<br />");
div.append(lists.get_count());
}
Managed: JavaScript:
Retrieving Resources Using LoadQuery
(Managed Code)
var web = context.Web;
var query = from list in web.Lists
where list.Hidden == false &&
list.ItemCount > 0
select list;
var lists = context.LoadQuery(query);
context.ExecuteQuery();
Console.WriteLine(lists.Count());
ī‚§ Indicates result of query should be included in next batch
retrieval
ī‚§ Query executed on server
ī‚§ Result returned from call
ī¯ Not loaded in-place as with Load
Retrieving Resources Using loadQuery
(JavaScript)
var context = SP.ClientContext.get_current();
var lists = context.get_web().get_lists();
context.load(lists);
context.executeQueryAsync(success, fail);
function success() {
var div = jQuery("#message");
div.text(lists.get_count());
}
ī‚§ No LINQ in JavaScript
ī‚§ loadQuery very similar to load
ī‚§ Returns new object
ī‚§ Returns array for collections
var context = SP.ClientContext.get_current();
var lists = context.get_web().get_lists();
var myLists = context.loadQuery(lists);
context.executeQueryAsync(success, fail);
function success() {
var div = jQuery("#message");
div.text(myLists.length);
}
load: loadQuery:
Selecting Fields to Retrieve
var web = context.Web;
context.Load(web, w => w.Title, w => w.Description);
var query = from list in web.Lists.Include(l => l.Title)
where list.Hidden == false &&
list.ItemCount > 0
select list;
var lists = context.LoadQuery(query);
context.ExecuteQuery();
ī‚§ Limit fields returned to reduce network traffic
ī‚§ Use parameter array in Load and LoadQuery
ī‚§ Use Include for collections
var web = context.get_web();
var lists = web.get_lists();
context.load(web, "Title", "Description");
context.load(lists, "Include(Title)");
context.executeQueryAsync(success, fail);
Managed: JavaScript:
Retrieving List Items
ī‚§ Somewhat different than Server OM
ī‚§ Set of items accessed by List.GetItems method
ī¯ Forces use of CAML query to encourage reduced result sets
ī‚§ Selecting fields to be returned
ī¯ Can use ViewFields in query
ī¯ Can use Include with Load or LoadQuery
ī‚§ CSOM does not support cross-list CAML queries
ī¯ Can use KeywordQuery with Search API for similar results
Task Server OM Managed Client OM
Get list web.Lists[“Products”] web.Lists.GetByTitle(“Products”)
Get items list.Items list.GetItems(query)
Get item title item.Title item[“Title”]
Query type SPQuery CamlQuery
Using CAML Queries
var web = context.Web;
var list = web.Lists.GetByTitle("Products");
var query = new CamlQuery();
query.ViewXml = "<View>" +
"<Query>" +
"<Where><Eq>" +
"<FieldRef Name='Category' " +
"LookupId='True' />" +
"<Value Type='Lookup'>1</Value>" +
"</Eq></Where>" +
"</Query>" +
"</View>";
var items = list.GetItems(query);
context.Load(items,
c => c.Include(li => li["ID"], li => li["Title"]));
context.ExecuteQuery();
var context = SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle("Products");
var query = new SP.CamlQuery();
query.set_viewXml("<View>" +
"<Query>" +
"<Where><Eq>" +
"<FieldRef Name='Category' " +
"LookupId='True' />" +
"<Value Type='Lookup'>1</Value>" +
"</Eq></Where>" +
"</Query>" +
"<RowLimit>5</RowLimit>" +
"</View>");
var items = list.getItems(query);
context.load(web, "Title");
context.load(items, "Include(ID, Title)");
context.executeQueryAsync(success, fail);
Managed: JavaScript:
REST API
ī‚§ API used when building remote applications
ī‚§ What is the REST API in SharePoint
ī¯ Data-centric web services based on the Open Data Protocol (OData)
ī¯ Each resource or set of resources is addressable
ī¯ http://<site url>/_api/web
ī¯ http://<site url>/_api/web/lists
ī¯ http://<site url>/_api/web/lists/getByTitle(‘Customers’)
ī¯ http://<site url>/_api/web/lists/getByTitle(‘Customers’)/items
ī¯ Operations on resources map to HTTP Verbs
ī¯ GET, PUT, POST, DELETE, â€Ļ
ī¯ Results from service returned in AtomPub (XML) or JavaScript Object
Notation (JSON) format
REST API History
ī‚§ SharePoint 2010
ī¯ Initial REST API added
ī¯ /_vti_bin/ListData.svc
ī¯ Exposed CRUD operations on list data
ī‚§ SharePoint 2013
ī¯ REST API expands and evolves
ī¯ ListData.svc deprecated
ī¯ Still available for backwards compatibility
ī¯ RESTful operations added to /_vti_bin/Client.svc
ī¯ /_api added as an alias for /_vti_bin/Client.svc
REST API Coverage
ī‚§ Sites, Webs, Features, Event Receivers
ī‚§ Lists, List Items, Fields, Content Types, Views, Forms, IRM
ī‚§ Files, Folders
ī‚§ Users, Roles, Groups, User Profiles, Feeds
ī‚§ Search
ī‚§ No support for Managed Metadata
ī¯ Term Store or Managed Metadata Fields
ī‚§ No support for Workflow
Retrieving Data (Managed)
ī‚§ Service metadata for /_api was added around April 2013
ī¯ You can add a service reference in Visual Studio
ī¯ Tooling to add a service reference for SharePoint Online does not work
ī‚§ Service proxy contains two context classes
ī¯ SP.Data.ListData – access to list data
ī¯ SP.ApiData – access to everything else
ī‚§ Generated proxy classes do not natively support updates
ī¯ SharePoint REST API works differently than OData
ī¯ Need to use POST tunneling and client hooks to get updates to work
ī¯ Too much work – better off using CSOM
ī‚§ For more detail see white paper by Paul Schaelein
ī¯ SharePoint 2013 REST and WCF Data Services
ī¯ http://www.schaeflein.net/Pages/SharePoint-2013-REST-and-WCF-
Data-Services.aspx
ī‚§ Still have the option of using the 2010 version of REST API
Retrieving Data (Managed)
var svcUri = new Uri(siteUrl + "/_api");
var context = new SP2013Proxy.SP.ApiData(svcUri);
context.Credentials = System.Net.CredentialCache.DefaultCredentials;
var resourceUri = new Uri("/web", UriKind.Relative);
var webs = context.Execute<SP2013Proxy.SP.Web>(resourceUri);
var web = webs.First();
ResultsListBox.Items.Add(web.Title);
Retrieving Data (Managed)
ī‚§ Have option of doing HTTP requests
ī‚§ Need to work with raw XML or JSON
var url = siteUrl + "/_api/Web/";
var client = new WebClient();
client.UseDefaultCredentials = true;
client.Headers[HttpRequestHeader.Accept] = "application/json;odata=verbose";
var json = client.DownloadString(url);
var ser = new JavaScriptSerializer();
dynamic item = ser.Deserialize<object>(json);
ResultsListBox.Items.Add(item["d"]["Title"]);
Retrieving Data (JavaScript)
ī‚§ Use jQuery to make service call
ī‚§ Use _spPageContextInfo to get site URL
ī‚§ Use Accept header to request JSON response
var call = jQuery.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/",
type: "GET",
dataType: "json",
headers: {
Accept: "application/json;odata=verbose"
}
});
call.done(function (data, textStatus, jqXHR) {
var div = jQuery("#message");
div.text(data.d.Title);
});
call.fail(function (jqXHR, textStatus, errorThrown) {
alert("Call failed. Error: " + errorThrown);
});
OData Queries
ī‚§ Queries represented by query strings added to resource URL
Option Example
$select _api/Web/Lists?$select=Title,ItemCount
$filter _api/Web/Lists?$filter=(Hidden eq false)
$orderby _api/Web/Lists?$orderby=ItemCount desc
$skip, $top _api/Web/Lists?$skip=25&$top=10
$expand _api/Web/Lists?$expand=Fields
Full documentation: http://www.odata.org/documentation/odata-v2-documentation/
uri-conventions/#4_Query_String_Options (http://bit.ly/10dqevp)
OData Continuations
ī‚§ OData provider may limit number of item in response
ī‚§ Need to check for __next (JSON) or link element (AtomPub)
ī‚§ Use URL to get next set of results
CAML Queries
ī‚§ Must be executed using a POST
ī‚§ Headers must include Form Digest
var viewXml = { ViewXml: "<View>" +
"<Query>" +
"<Where><Eq>" +
"<FieldRef Name='Category' LookupId='True' />" +
"<Value Type='Lookup'>1</Value>" +
"</Eq></Where>" +
"</Query>" +
"</View>"
}
var call = jQuery.ajax({
url: _spPageContextInfo.webAbsoluteUrl +
"/_api/Web/Lists/getByTitle('Products')/GetItems(query=@v1)?" +
@v1=" + JSON.stringify(viewXml),
type: "POST",
dataType: "json",
headers: {
Accept: "application/json;odata=verbose",
"X-RequestDigest": jQuery("#__REQUESTDIGEST").val()
}
});
Form Digest
ī‚§ Protects against replay attacks
ī‚§ Value available in hidden field on SharePoint page
ī‚§ Unique to user and site
ī‚§ Only valid for limited time
ī‚§ Use UpdateFormDigest() function to refresh value in hidden
field
ī¯ Service call only make if form digest has expired
ī‚§ For more details see blog post by Wictor Wilen
ī¯ How to refresh the Request Digest value in JavaScript
ī¯ http://www.wictorwilen.se/sharepoint-2013-how-to-refresh-the-request-
digest-value-in-javascript
Creating a List (CSOM)
ī‚§ Moderately different than code for Server Object Model
ī‚§ Adding the list
ī¯ Web.Lists.Add(creationInformation)
ī¯ Parameter is type ListCreationInformation
var web = context.Web;
var lci = new ListCreationInformation();
lci.Title = "Tasks";
lci.QuickLaunchOption = QuickLaunchOptions.On;
lci.TemplateType = (int)ListTemplateType.Tasks;
var list = web.Lists.Add(lci);
var web = context.get_web();
var lci = new SP.ListCreationInformation();
lci.set_title("Tasks");
lci.set_quickLaunchOption(SP.QuickLaunchOptions.on);
lci.set_templateType(SP.ListTemplateType.tasks);
var list = web.get_lists().add(lci);
Managed: JavaScript:
Creating a List (REST)
ī‚§ Send POST to /_api/Web/Lists
ī‚§ Message body has SP.List object with properties
ī¯ Fills same role as SP.ListCreationInformation object in CSOM
ī‚§ Must include Form Digest in headers
var call = jQuery.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists",
type: "POST",
data: JSON.stringify({
"__metadata": { type: "SP.List" },
BaseTemplate: SP.ListTemplateType.tasks,
Title: "Tasks"
}),
headers: {
Accept: "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"X-RequestDigest": jQuery("#__REQUESTDIGEST").val()
}
});
Creating and Updating List Items (CSOM)
ī‚§ Virtually the same as code for Server Object Model
ī‚§ Adding a list item
ī¯ List.AddItem(creationInformation)
ī¯ Parameter is type ListItemCreationInformation
ī‚§ Updating field values
ī¯ Exactly the same as Server Object Model code
var web = context.Web;
var list = web.Lists.GetByTitle("Tasks");
var ici = new ListItemCreationInformation();
var item = list.AddItem(ici);
item["Title"] = "Sample Task";
item["AssignedTo"] = web.CurrentUser;
item["DueDate"] = DateTime.Now.AddDays(7);
item.Update();
var web = context.get_web();
var list = web.get_lists().getByTitle("Tasks");
var ici = new SP.ListItemCreationInformation();
var item = list.addItem(ici);
item.set_item("Title", "Sample Task");
item.set_item("AssignedTo", web.get_currentUser());
var due = new Date();
due.setDate(due.getDate() + 7);
item.set_item("DueDate", due);
item.update();
Managed: JavaScript:
Creating List Items (REST - JavaScript)
ī‚§ Post to /_api/Web/Lists/getByTitle(‘<List Name>’)/Items
ī‚§ Type name is SP.Data.<List Name>ListItem
var call = jQuery.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getByTitle('Tasks')/Items",
type: "POST",
data: JSON.stringify({
"__metadata": { type: "SP.Data.TasksListItem" },
Title: "Sample Task",
AssignedToId: userId,
DueDate: due
}),
headers: {
Accept: "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"X-RequestDigest": jQuery("#__REQUESTDIGEST").val()
}
});
Creating List Items (REST - Managed)
ī‚§ Create instance of list item type
ī¯ One of the generated types in the service proxy
ī‚§ Set property values
ī‚§ Add to list using the AddTo<list name> method on context
var svcUri = new Uri(siteUrl + "/_vti_bin/ListData.svc");
var context = new SP2010Proxy.DemoDataContext(svcUri);
context.Credentials = System.Net.CredentialCache.DefaultCredentials;
var item = new SP2010Proxy.ProductsItem();
item.Title = "Test Product";
item.ProductID = 999;
item.CategoryId = 1;
item.UnitPrice = 9.99;
item.UnitsInStock = 99;
context.AddToProducts(item);
context.SaveChanges();
Updating List Items (REST - Managed)
ī‚§ Get list item
ī‚§ Update property values
ī‚§ Call UpdateObject on context
var svcUri = new Uri(siteUrl + "/_vti_bin/ListData.svc");
var context = new SP2010Proxy.DemoDataContext(svcUri);
context.Credentials = System.Net.CredentialCache.DefaultCredentials;
var query = from product in context.Products
where product.ProductID == 999
select product;
var item = query.FirstOrDefault();
if (item != null)
{
item.UnitPrice = 4.44;
item.UnitsInStock = 44;
context.UpdateObject(item);
context.SaveChanges();
}
Updating List Items (REST - JavaScript)
ī‚§ Send to /_api/Web/Lists/getByTitle(‘<List>')/Items(<Item Id>)
ī‚§ Request type (X-Http-Method)
ī¯ Can update by sending PUT
ī¯ All writable field values must be specified
ī¯ Can update by sending POST
ī¯ Set X-Http-Method to PATCH or MERGE
ī¯ Only send field values that are changing
ī‚§ Concurrency (IF-MATCH)
ī¯ Item metadata includes etag which represents the version
ī¯ Set IF-MATCH in header to etag value
ī¯ Update will fail if item has been updated since read
ī¯ SET IF-MATCH in header to *
ī¯ Update will overwrite changes (if any)
Updating List Items (REST - JavaScript)
var call = jQuery.ajax({
url: _spPageContextInfo.webAbsoluteUrl +
"/_api/Web/Lists/getByTitle('Tasks')/Items(" + item.Id + ")",
type: "POST",
data: JSON.stringify({
"__metadata": { type: "SP.Data.TasksListItem" },
Status: "In Progress",
PercentComplete: 0.10
}),
headers: {
Accept: "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"X-RequestDigest": jQuery("#__REQUESTDIGEST").val(),
"IF-MATCH": item.__metadata.etag,
"X-Http-Method": "PATCH"
}
});
Thank You
ī‚§ Big thanks to the organizers, sponsors and you for
making this event possible
ī‚§ Please fill out your evaluation
ī‚§ Please keep in touch
rob@robwindsor.com
@robwindsor
blogs.msmvps.com/windsor

More Related Content

What's hot

Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web APIBrad Genereaux
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Aijaz Ali Abro
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorialMohammed Fazuluddin
 
Introducing Clean Architecture
Introducing Clean ArchitectureIntroducing Clean Architecture
Introducing Clean ArchitectureRoc Boronat
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentationritika1
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentationæ´Ē 随发
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivityTanmoy Barman
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#Doncho Minkov
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETRajkumarsoy
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHPVibrant Technologies & Computers
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScriptBala Narayanan
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painSander Mak (@Sander_Mak)
 
Asp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkAsp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkShravan A
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
 

What's hot (20)

ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
 
Generics
GenericsGenerics
Generics
 
Introducing Clean Architecture
Introducing Clean ArchitectureIntroducing Clean Architecture
Introducing Clean Architecture
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHP
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the pain
 
Asp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkAsp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity Framework
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 

Viewers also liked

Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchRob Windsor
 
Office 365 Deployment Strategies
Office 365 Deployment StrategiesOffice 365 Deployment Strategies
Office 365 Deployment StrategiesBert Johnson
 
SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)Kashif Imran
 
Customizing SharePoint Online
Customizing SharePoint OnlineCustomizing SharePoint Online
Customizing SharePoint OnlineBert Johnson
 
Understanding SharePoint Content Types
Understanding SharePoint Content TypesUnderstanding SharePoint Content Types
Understanding SharePoint Content TypesBenjamin Niaulin
 
Stop Updating, Start Evolving - The Digital Workplace Truth
Stop Updating, Start Evolving - The Digital Workplace TruthStop Updating, Start Evolving - The Digital Workplace Truth
Stop Updating, Start Evolving - The Digital Workplace TruthBenjamin Niaulin
 
Understand the SharePoint Basics
Understand the SharePoint BasicsUnderstand the SharePoint Basics
Understand the SharePoint BasicsBenjamin Niaulin
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIChris Beckett
 
SharePoint Online vs. On-Premise
SharePoint Online vs. On-PremiseSharePoint Online vs. On-Premise
SharePoint Online vs. On-PremiseEvan Hodges
 
Build Killer Visuals with SharePoint 2013 Search & Display Templates
Build Killer Visuals with SharePoint 2013 Search & Display TemplatesBuild Killer Visuals with SharePoint 2013 Search & Display Templates
Build Killer Visuals with SharePoint 2013 Search & Display TemplatesBenjamin Niaulin
 
Office 365 deployment fast track
Office 365 deployment fast trackOffice 365 deployment fast track
Office 365 deployment fast trackMotty Ben Atia
 
Discover SharePoint 2016 Preview and the Vision
Discover SharePoint 2016 Preview and the VisionDiscover SharePoint 2016 Preview and the Vision
Discover SharePoint 2016 Preview and the VisionBenjamin Niaulin
 
Understanding SharePoint site structure what's inside
Understanding SharePoint site structure  what's insideUnderstanding SharePoint site structure  what's inside
Understanding SharePoint site structure what's insideBenjamin Niaulin
 
App Model For SharePoint 2013
App Model For SharePoint 2013App Model For SharePoint 2013
App Model For SharePoint 2013Toni Il Caiser
 
SharePoint Online v Onprem
SharePoint Online v OnpremSharePoint Online v Onprem
SharePoint Online v OnpremConcurrency, Inc.
 
What and how do I choose SharePoint 2013 On-premise vs. Cloud (Office 365)
What and how do I choose SharePoint 2013 On-premise vs. Cloud (Office 365)What and how do I choose SharePoint 2013 On-premise vs. Cloud (Office 365)
What and how do I choose SharePoint 2013 On-premise vs. Cloud (Office 365)WinWire Technologies Inc
 
SharePoint 2016: Features Overview
SharePoint 2016: Features OverviewSharePoint 2016: Features Overview
SharePoint 2016: Features OverviewShareGate
 
Comprendre la recherche dans SharePoint
Comprendre la recherche dans SharePointComprendre la recherche dans SharePoint
Comprendre la recherche dans SharePointBenjamin Niaulin
 
Mieux comprendre SharePoint 2013
Mieux comprendre SharePoint 2013Mieux comprendre SharePoint 2013
Mieux comprendre SharePoint 2013Benjamin Niaulin
 

Viewers also liked (20)

Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio Lightswitch
 
SP24 S055 SharePointToolbox by Rodrigo Pinto
SP24 S055 SharePointToolbox by Rodrigo PintoSP24 S055 SharePointToolbox by Rodrigo Pinto
SP24 S055 SharePointToolbox by Rodrigo Pinto
 
Office 365 Deployment Strategies
Office 365 Deployment StrategiesOffice 365 Deployment Strategies
Office 365 Deployment Strategies
 
SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)
 
Customizing SharePoint Online
Customizing SharePoint OnlineCustomizing SharePoint Online
Customizing SharePoint Online
 
Understanding SharePoint Content Types
Understanding SharePoint Content TypesUnderstanding SharePoint Content Types
Understanding SharePoint Content Types
 
Stop Updating, Start Evolving - The Digital Workplace Truth
Stop Updating, Start Evolving - The Digital Workplace TruthStop Updating, Start Evolving - The Digital Workplace Truth
Stop Updating, Start Evolving - The Digital Workplace Truth
 
Understand the SharePoint Basics
Understand the SharePoint BasicsUnderstand the SharePoint Basics
Understand the SharePoint Basics
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST API
 
SharePoint Online vs. On-Premise
SharePoint Online vs. On-PremiseSharePoint Online vs. On-Premise
SharePoint Online vs. On-Premise
 
Build Killer Visuals with SharePoint 2013 Search & Display Templates
Build Killer Visuals with SharePoint 2013 Search & Display TemplatesBuild Killer Visuals with SharePoint 2013 Search & Display Templates
Build Killer Visuals with SharePoint 2013 Search & Display Templates
 
Office 365 deployment fast track
Office 365 deployment fast trackOffice 365 deployment fast track
Office 365 deployment fast track
 
Discover SharePoint 2016 Preview and the Vision
Discover SharePoint 2016 Preview and the VisionDiscover SharePoint 2016 Preview and the Vision
Discover SharePoint 2016 Preview and the Vision
 
Understanding SharePoint site structure what's inside
Understanding SharePoint site structure  what's insideUnderstanding SharePoint site structure  what's inside
Understanding SharePoint site structure what's inside
 
App Model For SharePoint 2013
App Model For SharePoint 2013App Model For SharePoint 2013
App Model For SharePoint 2013
 
SharePoint Online v Onprem
SharePoint Online v OnpremSharePoint Online v Onprem
SharePoint Online v Onprem
 
What and how do I choose SharePoint 2013 On-premise vs. Cloud (Office 365)
What and how do I choose SharePoint 2013 On-premise vs. Cloud (Office 365)What and how do I choose SharePoint 2013 On-premise vs. Cloud (Office 365)
What and how do I choose SharePoint 2013 On-premise vs. Cloud (Office 365)
 
SharePoint 2016: Features Overview
SharePoint 2016: Features OverviewSharePoint 2016: Features Overview
SharePoint 2016: Features Overview
 
Comprendre la recherche dans SharePoint
Comprendre la recherche dans SharePointComprendre la recherche dans SharePoint
Comprendre la recherche dans SharePoint
 
Mieux comprendre SharePoint 2013
Mieux comprendre SharePoint 2013Mieux comprendre SharePoint 2013
Mieux comprendre SharePoint 2013
 

Similar to Introduction to the SharePoint Client Object Model and REST API

Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...SharePoint Saturday NY
 
Wss Object Model
Wss Object ModelWss Object Model
Wss Object Modelmaddinapudi
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVCIndicThreads
 
Working with a super model for SharePoint Tuga IT 2016
Working with a super model for SharePoint Tuga IT 2016Working with a super model for SharePoint Tuga IT 2016
Working with a super model for SharePoint Tuga IT 2016Sonja Madsen
 
Taking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APITaking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APIEric Shupps
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actionsAren Zomorodian
 
[SharePoint Korea Conference 2013 / 강ėœ¨ęĩŦ] Sharepoint ėŠ¤ë§ˆíŠ¸í•˜ę˛Œ 개발하기
[SharePoint Korea Conference 2013 / 강ėœ¨ęĩŦ] Sharepoint ėŠ¤ë§ˆíŠ¸í•˜ę˛Œ 개발하기[SharePoint Korea Conference 2013 / 강ėœ¨ęĩŦ] Sharepoint ėŠ¤ë§ˆíŠ¸í•˜ę˛Œ 개발하기
[SharePoint Korea Conference 2013 / 강ėœ¨ęĩŦ] Sharepoint ėŠ¤ë§ˆíŠ¸í•˜ę˛Œ 개발하기lanslote
 
Share point hosted add ins munich
Share point hosted add ins munichShare point hosted add ins munich
Share point hosted add ins munichSonja Madsen
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013Kiril Iliev
 
Developing With Data Technologies
Developing With Data TechnologiesDeveloping With Data Technologies
Developing With Data TechnologiesChakkaradeep Chandran
 
Rest API and Client OM for Developer
Rest API and Client OM for DeveloperRest API and Client OM for Developer
Rest API and Client OM for DeveloperInnoTech
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APISparkhound Inc.
 
SharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and EventsSharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and EventsMohan Arumugam
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Rob Windsor
 
ADO.NET Data Services
ADO.NET Data ServicesADO.NET Data Services
ADO.NET Data Servicesukdpe
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...SPTechCon
 
How To Manage API Request with AXIOS on a React Native App
How To Manage API Request with AXIOS on a React Native AppHow To Manage API Request with AXIOS on a React Native App
How To Manage API Request with AXIOS on a React Native AppAndolasoft Inc
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web servicesnbuddharaju
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365Luis Valencia
 

Similar to Introduction to the SharePoint Client Object Model and REST API (20)

Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
Wss Object Model
Wss Object ModelWss Object Model
Wss Object Model
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
Working with a super model for SharePoint Tuga IT 2016
Working with a super model for SharePoint Tuga IT 2016Working with a super model for SharePoint Tuga IT 2016
Working with a super model for SharePoint Tuga IT 2016
 
Taking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APITaking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST API
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
[SharePoint Korea Conference 2013 / 강ėœ¨ęĩŦ] Sharepoint ėŠ¤ë§ˆíŠ¸í•˜ę˛Œ 개발하기
[SharePoint Korea Conference 2013 / 강ėœ¨ęĩŦ] Sharepoint ėŠ¤ë§ˆíŠ¸í•˜ę˛Œ 개발하기[SharePoint Korea Conference 2013 / 강ėœ¨ęĩŦ] Sharepoint ėŠ¤ë§ˆíŠ¸í•˜ę˛Œ 개발하기
[SharePoint Korea Conference 2013 / 강ėœ¨ęĩŦ] Sharepoint ėŠ¤ë§ˆíŠ¸í•˜ę˛Œ 개발하기
 
Share point hosted add ins munich
Share point hosted add ins munichShare point hosted add ins munich
Share point hosted add ins munich
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 
Developing With Data Technologies
Developing With Data TechnologiesDeveloping With Data Technologies
Developing With Data Technologies
 
Rest API and Client OM for Developer
Rest API and Client OM for DeveloperRest API and Client OM for Developer
Rest API and Client OM for Developer
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST API
 
SharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and EventsSharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and Events
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
ADO.NET Data Services
ADO.NET Data ServicesADO.NET Data Services
ADO.NET Data Services
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
How To Manage API Request with AXIOS on a React Native App
How To Manage API Request with AXIOS on a React Native AppHow To Manage API Request with AXIOS on a React Native App
How To Manage API Request with AXIOS on a React Native App
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vÃĄzquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
đŸŦ The future of MySQL is Postgres 🐘
đŸŦ  The future of MySQL is Postgres   🐘đŸŦ  The future of MySQL is Postgres   🐘
đŸŦ The future of MySQL is Postgres 🐘RTylerCroy
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraÃējo
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
đŸŦ The future of MySQL is Postgres 🐘
đŸŦ  The future of MySQL is Postgres   🐘đŸŦ  The future of MySQL is Postgres   🐘
đŸŦ The future of MySQL is Postgres 🐘
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Introduction to the SharePoint Client Object Model and REST API

  • 1. Introduction to the SharePoint 2013 Client Object Model and REST API Rob Windsor rob@robwindsor.com @robwindsor
  • 2. About Me ī‚§ Senior SharePoint Consultant ī‚§ Technical Contributor to the Pluralsight On-Demand Library ī‚§ Microsoft MVP, MCPD, MCT ī‚§ Founder and Past-President of the North Toronto .NET UG ī‚§ Co-author of Prof. Visual Basic 2012 and .NET 4.5 (Wrox)
  • 3. Client Object Model (CSOM) ī‚§ API used when building remote applications ī¯ Designed to be similar to the Server Object Model ī¯ Introduced in SharePoint 2010, expanded in SharePoint 2013 ī¯ Slightly different versions for SP 2013 on-premises and SP Online ī‚§ Three implementations ī¯ .NET Managed, Silverlight (plus Mobile), JavaScript ī¯ Façades on top of /_vti_bin/Client.svc ī‚§ Managed implementation has two versions ī¯ Version 15 is for use against an on-premises farm ī¯ Version 16 is for use against SharePoint Online ī‚§ Communication with SharePoint done in batches
  • 4. Client Object Model Coverage ī‚§ Sites, Webs, Features, Event Receivers ī‚§ Lists, List Items, Fields, Content Types, Views, Forms ī‚§ Files, Folders ī‚§ Users, Roles, Groups, User Profiles, Feeds ī‚§ Web Parts ī‚§ Search ī‚§ Taxonomy ī‚§ Workflow ī‚§ IRM ī‚§ E-Discovery ī‚§ Analytics ī‚§ Business Data
  • 5. Communicating with SharePoint ī‚§ All CRUD operations are automatically batched ī‚§ Requests for resources batched using Load and LoadQuery methods ī‚§ Batches are executed using ExecuteQuery or ExecuteQueryAsync ī¯ This triggers a POST request to Client.svc/ProcessQuery ī¯ Message body contains XML document with batched request information ī¯ Response contains requested resources in JSON format
  • 6. Client Object Model Authentication ī‚§ .NET Managed ī¯ Windows credentials passed by default ī¯ ClientContext.AuthenticationMode ī¯ Default ī¯ Anonymous ī¯ FormsAuthentication ī¯ ClientContext.Credentials ī¯ Expects System.Net.ICredentials ī¯ NetworkCredential, SharePointOnlineCredentials, â€Ļ ī¯ ClientContext.FormsAuthenticationLoginInfo ī‚§ Silverlight and JavaScript ī¯ Credentials of the hosting Web application are always used
  • 7. Retrieving Resources Using Load var context = new ClientContext(siteUrl) var web = context.Web; context.Load(web); context.Load(web.Lists); context.ExecuteQuery(); ResultsListBox.Items.Add(web.Title); ResultsListBox.Items.Add(web.Lists.Count); ī‚§ Indicates object data should be included in next batch retrieval ī‚§ Not all property values are retrieved ī¯ Example: collections of associated objects var context = SP.ClientContext.get_current(); var web = context.get_web(); var lists = web.get_lists(); context.load(web); context.load(lists); context.executeQueryAsync(success, fail); function success() { var div = jQuery("#message"); div.text(web.get_title()); div.append("<br />"); div.append(lists.get_count()); } Managed: JavaScript:
  • 8. Retrieving Resources Using LoadQuery (Managed Code) var web = context.Web; var query = from list in web.Lists where list.Hidden == false && list.ItemCount > 0 select list; var lists = context.LoadQuery(query); context.ExecuteQuery(); Console.WriteLine(lists.Count()); ī‚§ Indicates result of query should be included in next batch retrieval ī‚§ Query executed on server ī‚§ Result returned from call ī¯ Not loaded in-place as with Load
  • 9. Retrieving Resources Using loadQuery (JavaScript) var context = SP.ClientContext.get_current(); var lists = context.get_web().get_lists(); context.load(lists); context.executeQueryAsync(success, fail); function success() { var div = jQuery("#message"); div.text(lists.get_count()); } ī‚§ No LINQ in JavaScript ī‚§ loadQuery very similar to load ī‚§ Returns new object ī‚§ Returns array for collections var context = SP.ClientContext.get_current(); var lists = context.get_web().get_lists(); var myLists = context.loadQuery(lists); context.executeQueryAsync(success, fail); function success() { var div = jQuery("#message"); div.text(myLists.length); } load: loadQuery:
  • 10. Selecting Fields to Retrieve var web = context.Web; context.Load(web, w => w.Title, w => w.Description); var query = from list in web.Lists.Include(l => l.Title) where list.Hidden == false && list.ItemCount > 0 select list; var lists = context.LoadQuery(query); context.ExecuteQuery(); ī‚§ Limit fields returned to reduce network traffic ī‚§ Use parameter array in Load and LoadQuery ī‚§ Use Include for collections var web = context.get_web(); var lists = web.get_lists(); context.load(web, "Title", "Description"); context.load(lists, "Include(Title)"); context.executeQueryAsync(success, fail); Managed: JavaScript:
  • 11. Retrieving List Items ī‚§ Somewhat different than Server OM ī‚§ Set of items accessed by List.GetItems method ī¯ Forces use of CAML query to encourage reduced result sets ī‚§ Selecting fields to be returned ī¯ Can use ViewFields in query ī¯ Can use Include with Load or LoadQuery ī‚§ CSOM does not support cross-list CAML queries ī¯ Can use KeywordQuery with Search API for similar results Task Server OM Managed Client OM Get list web.Lists[“Products”] web.Lists.GetByTitle(“Products”) Get items list.Items list.GetItems(query) Get item title item.Title item[“Title”] Query type SPQuery CamlQuery
  • 12. Using CAML Queries var web = context.Web; var list = web.Lists.GetByTitle("Products"); var query = new CamlQuery(); query.ViewXml = "<View>" + "<Query>" + "<Where><Eq>" + "<FieldRef Name='Category' " + "LookupId='True' />" + "<Value Type='Lookup'>1</Value>" + "</Eq></Where>" + "</Query>" + "</View>"; var items = list.GetItems(query); context.Load(items, c => c.Include(li => li["ID"], li => li["Title"])); context.ExecuteQuery(); var context = SP.ClientContext.get_current(); var web = context.get_web(); var list = web.get_lists().getByTitle("Products"); var query = new SP.CamlQuery(); query.set_viewXml("<View>" + "<Query>" + "<Where><Eq>" + "<FieldRef Name='Category' " + "LookupId='True' />" + "<Value Type='Lookup'>1</Value>" + "</Eq></Where>" + "</Query>" + "<RowLimit>5</RowLimit>" + "</View>"); var items = list.getItems(query); context.load(web, "Title"); context.load(items, "Include(ID, Title)"); context.executeQueryAsync(success, fail); Managed: JavaScript:
  • 13. REST API ī‚§ API used when building remote applications ī‚§ What is the REST API in SharePoint ī¯ Data-centric web services based on the Open Data Protocol (OData) ī¯ Each resource or set of resources is addressable ī¯ http://<site url>/_api/web ī¯ http://<site url>/_api/web/lists ī¯ http://<site url>/_api/web/lists/getByTitle(‘Customers’) ī¯ http://<site url>/_api/web/lists/getByTitle(‘Customers’)/items ī¯ Operations on resources map to HTTP Verbs ī¯ GET, PUT, POST, DELETE, â€Ļ ī¯ Results from service returned in AtomPub (XML) or JavaScript Object Notation (JSON) format
  • 14. REST API History ī‚§ SharePoint 2010 ī¯ Initial REST API added ī¯ /_vti_bin/ListData.svc ī¯ Exposed CRUD operations on list data ī‚§ SharePoint 2013 ī¯ REST API expands and evolves ī¯ ListData.svc deprecated ī¯ Still available for backwards compatibility ī¯ RESTful operations added to /_vti_bin/Client.svc ī¯ /_api added as an alias for /_vti_bin/Client.svc
  • 15. REST API Coverage ī‚§ Sites, Webs, Features, Event Receivers ī‚§ Lists, List Items, Fields, Content Types, Views, Forms, IRM ī‚§ Files, Folders ī‚§ Users, Roles, Groups, User Profiles, Feeds ī‚§ Search ī‚§ No support for Managed Metadata ī¯ Term Store or Managed Metadata Fields ī‚§ No support for Workflow
  • 16. Retrieving Data (Managed) ī‚§ Service metadata for /_api was added around April 2013 ī¯ You can add a service reference in Visual Studio ī¯ Tooling to add a service reference for SharePoint Online does not work ī‚§ Service proxy contains two context classes ī¯ SP.Data.ListData – access to list data ī¯ SP.ApiData – access to everything else ī‚§ Generated proxy classes do not natively support updates ī¯ SharePoint REST API works differently than OData ī¯ Need to use POST tunneling and client hooks to get updates to work ī¯ Too much work – better off using CSOM ī‚§ For more detail see white paper by Paul Schaelein ī¯ SharePoint 2013 REST and WCF Data Services ī¯ http://www.schaeflein.net/Pages/SharePoint-2013-REST-and-WCF- Data-Services.aspx ī‚§ Still have the option of using the 2010 version of REST API
  • 17. Retrieving Data (Managed) var svcUri = new Uri(siteUrl + "/_api"); var context = new SP2013Proxy.SP.ApiData(svcUri); context.Credentials = System.Net.CredentialCache.DefaultCredentials; var resourceUri = new Uri("/web", UriKind.Relative); var webs = context.Execute<SP2013Proxy.SP.Web>(resourceUri); var web = webs.First(); ResultsListBox.Items.Add(web.Title);
  • 18. Retrieving Data (Managed) ī‚§ Have option of doing HTTP requests ī‚§ Need to work with raw XML or JSON var url = siteUrl + "/_api/Web/"; var client = new WebClient(); client.UseDefaultCredentials = true; client.Headers[HttpRequestHeader.Accept] = "application/json;odata=verbose"; var json = client.DownloadString(url); var ser = new JavaScriptSerializer(); dynamic item = ser.Deserialize<object>(json); ResultsListBox.Items.Add(item["d"]["Title"]);
  • 19. Retrieving Data (JavaScript) ī‚§ Use jQuery to make service call ī‚§ Use _spPageContextInfo to get site URL ī‚§ Use Accept header to request JSON response var call = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/", type: "GET", dataType: "json", headers: { Accept: "application/json;odata=verbose" } }); call.done(function (data, textStatus, jqXHR) { var div = jQuery("#message"); div.text(data.d.Title); }); call.fail(function (jqXHR, textStatus, errorThrown) { alert("Call failed. Error: " + errorThrown); });
  • 20. OData Queries ī‚§ Queries represented by query strings added to resource URL Option Example $select _api/Web/Lists?$select=Title,ItemCount $filter _api/Web/Lists?$filter=(Hidden eq false) $orderby _api/Web/Lists?$orderby=ItemCount desc $skip, $top _api/Web/Lists?$skip=25&$top=10 $expand _api/Web/Lists?$expand=Fields Full documentation: http://www.odata.org/documentation/odata-v2-documentation/ uri-conventions/#4_Query_String_Options (http://bit.ly/10dqevp)
  • 21. OData Continuations ī‚§ OData provider may limit number of item in response ī‚§ Need to check for __next (JSON) or link element (AtomPub) ī‚§ Use URL to get next set of results
  • 22. CAML Queries ī‚§ Must be executed using a POST ī‚§ Headers must include Form Digest var viewXml = { ViewXml: "<View>" + "<Query>" + "<Where><Eq>" + "<FieldRef Name='Category' LookupId='True' />" + "<Value Type='Lookup'>1</Value>" + "</Eq></Where>" + "</Query>" + "</View>" } var call = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getByTitle('Products')/GetItems(query=@v1)?" + @v1=" + JSON.stringify(viewXml), type: "POST", dataType: "json", headers: { Accept: "application/json;odata=verbose", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() } });
  • 23. Form Digest ī‚§ Protects against replay attacks ī‚§ Value available in hidden field on SharePoint page ī‚§ Unique to user and site ī‚§ Only valid for limited time ī‚§ Use UpdateFormDigest() function to refresh value in hidden field ī¯ Service call only make if form digest has expired ī‚§ For more details see blog post by Wictor Wilen ī¯ How to refresh the Request Digest value in JavaScript ī¯ http://www.wictorwilen.se/sharepoint-2013-how-to-refresh-the-request- digest-value-in-javascript
  • 24. Creating a List (CSOM) ī‚§ Moderately different than code for Server Object Model ī‚§ Adding the list ī¯ Web.Lists.Add(creationInformation) ī¯ Parameter is type ListCreationInformation var web = context.Web; var lci = new ListCreationInformation(); lci.Title = "Tasks"; lci.QuickLaunchOption = QuickLaunchOptions.On; lci.TemplateType = (int)ListTemplateType.Tasks; var list = web.Lists.Add(lci); var web = context.get_web(); var lci = new SP.ListCreationInformation(); lci.set_title("Tasks"); lci.set_quickLaunchOption(SP.QuickLaunchOptions.on); lci.set_templateType(SP.ListTemplateType.tasks); var list = web.get_lists().add(lci); Managed: JavaScript:
  • 25. Creating a List (REST) ī‚§ Send POST to /_api/Web/Lists ī‚§ Message body has SP.List object with properties ī¯ Fills same role as SP.ListCreationInformation object in CSOM ī‚§ Must include Form Digest in headers var call = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists", type: "POST", data: JSON.stringify({ "__metadata": { type: "SP.List" }, BaseTemplate: SP.ListTemplateType.tasks, Title: "Tasks" }), headers: { Accept: "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() } });
  • 26. Creating and Updating List Items (CSOM) ī‚§ Virtually the same as code for Server Object Model ī‚§ Adding a list item ī¯ List.AddItem(creationInformation) ī¯ Parameter is type ListItemCreationInformation ī‚§ Updating field values ī¯ Exactly the same as Server Object Model code var web = context.Web; var list = web.Lists.GetByTitle("Tasks"); var ici = new ListItemCreationInformation(); var item = list.AddItem(ici); item["Title"] = "Sample Task"; item["AssignedTo"] = web.CurrentUser; item["DueDate"] = DateTime.Now.AddDays(7); item.Update(); var web = context.get_web(); var list = web.get_lists().getByTitle("Tasks"); var ici = new SP.ListItemCreationInformation(); var item = list.addItem(ici); item.set_item("Title", "Sample Task"); item.set_item("AssignedTo", web.get_currentUser()); var due = new Date(); due.setDate(due.getDate() + 7); item.set_item("DueDate", due); item.update(); Managed: JavaScript:
  • 27. Creating List Items (REST - JavaScript) ī‚§ Post to /_api/Web/Lists/getByTitle(‘<List Name>’)/Items ī‚§ Type name is SP.Data.<List Name>ListItem var call = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getByTitle('Tasks')/Items", type: "POST", data: JSON.stringify({ "__metadata": { type: "SP.Data.TasksListItem" }, Title: "Sample Task", AssignedToId: userId, DueDate: due }), headers: { Accept: "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() } });
  • 28. Creating List Items (REST - Managed) ī‚§ Create instance of list item type ī¯ One of the generated types in the service proxy ī‚§ Set property values ī‚§ Add to list using the AddTo<list name> method on context var svcUri = new Uri(siteUrl + "/_vti_bin/ListData.svc"); var context = new SP2010Proxy.DemoDataContext(svcUri); context.Credentials = System.Net.CredentialCache.DefaultCredentials; var item = new SP2010Proxy.ProductsItem(); item.Title = "Test Product"; item.ProductID = 999; item.CategoryId = 1; item.UnitPrice = 9.99; item.UnitsInStock = 99; context.AddToProducts(item); context.SaveChanges();
  • 29. Updating List Items (REST - Managed) ī‚§ Get list item ī‚§ Update property values ī‚§ Call UpdateObject on context var svcUri = new Uri(siteUrl + "/_vti_bin/ListData.svc"); var context = new SP2010Proxy.DemoDataContext(svcUri); context.Credentials = System.Net.CredentialCache.DefaultCredentials; var query = from product in context.Products where product.ProductID == 999 select product; var item = query.FirstOrDefault(); if (item != null) { item.UnitPrice = 4.44; item.UnitsInStock = 44; context.UpdateObject(item); context.SaveChanges(); }
  • 30. Updating List Items (REST - JavaScript) ī‚§ Send to /_api/Web/Lists/getByTitle(‘<List>')/Items(<Item Id>) ī‚§ Request type (X-Http-Method) ī¯ Can update by sending PUT ī¯ All writable field values must be specified ī¯ Can update by sending POST ī¯ Set X-Http-Method to PATCH or MERGE ī¯ Only send field values that are changing ī‚§ Concurrency (IF-MATCH) ī¯ Item metadata includes etag which represents the version ī¯ Set IF-MATCH in header to etag value ī¯ Update will fail if item has been updated since read ī¯ SET IF-MATCH in header to * ī¯ Update will overwrite changes (if any)
  • 31. Updating List Items (REST - JavaScript) var call = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getByTitle('Tasks')/Items(" + item.Id + ")", type: "POST", data: JSON.stringify({ "__metadata": { type: "SP.Data.TasksListItem" }, Status: "In Progress", PercentComplete: 0.10 }), headers: { Accept: "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val(), "IF-MATCH": item.__metadata.etag, "X-Http-Method": "PATCH" } });
  • 32. Thank You ī‚§ Big thanks to the organizers, sponsors and you for making this event possible ī‚§ Please fill out your evaluation ī‚§ Please keep in touch rob@robwindsor.com @robwindsor blogs.msmvps.com/windsor

Editor's Notes

  1. 2