SlideShare a Scribd company logo
SHA02 – Le REST API
di SharePoint 2013
Giuseppe Marchi
Dev4Side S.r.l. – SharePoint MVP
info@peppedotnet.it - @PeppeDotNet
http://www.peppedotnet.it
http://www.dev4side.com
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Grazie a
Sponsor

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Who I am
•

Co-founder of Dev4Side S.r.l.

•

4 years Microsoft SharePoint MVP

•

Speaker in Microsoft and Community events in Italy

•

MCP, MCPD Web applications, MCTS ASP.NET 4, WSS 3.0, MOSS 2007 and
SharePoint 2010

•

"SharePointer" from 2005

•

Father of www.peppedotnet.it 

•

Author of the book «Pocket C#», Apogeo

•

Active member, speaker and promoter of SharePointCommunity.it

•

First, in Italy, with an App in the Office Store

•

One of the TOP 25 SharePoint Influencers in Europe

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Agenda
•

What’s REST?

•

What’s REST in SharePoint

•

SharePoint 2013 API changes
 What’s new with REST interface

•

New REST APIs syntax

•

Basic operators and actions

•

General tips

•

Known limits

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
What’s REST?
•

REST = Representational State Transfer
 It’s an architecture style for designing networked applications
 RESTful applications use HTTP requests to post data (create and/or update),
read data (e.g., make queries), and delete data. Thus, REST uses HTTP for all
four CRUD (Create/Read/Update/Delete) operations.
 REST is a lightweight alternative to Web Services

•

It’s an architectural style, awesome for cross-platform apps

•

Easier and smaller than SOAP

•

Easy to use with Javascript, than C#

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
What’s REST in SharePoint?

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
What’s REST in SharePoint?
•

It’s another way to consume data, use all the advanced services and
functionalities exposed by SharePoint from your own client applications

•

in a secure way

•

… all done with a simple HTTP request!

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
What we had in the past?
•

MOSS 2007
 SOAP Services

•

SharePoint 2010
 SOAP Services
 Client Object Model





Direct access to client.svc service
Request always in XML
Must use a proxy
Supports only .NET, Silverlight and Javascript

 REST Interface (ListData.svc)
 Only for lists!

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
What we have now – New REST APIs
•

Direct access to client.svc service (using _api alias)

•

Access HTTP GET, PUT, Merge, POST Requests

•

OData implementation*

•

Atom XML or JSON as data type

•

Supports any application, language or platform that enables you to do a
HTTP request

 You can access to a lot of features of the Client Object Model through an HTTP
request!

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
Our first call to SharePoint 2013 REST APIs

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Entry points
REST service includes several access points that enable developers to
navigate to specific functionality of SharePoint 2013. The table below lists
some of these access points.
Feature area

Entry point

Context

http://server/site/_api/contextInfo

Site

http://server/site/_api/site

Web

http://server/site/_api/web

User profile

http://server/site/_api/SP
.UserProfiles.PeopleManager

Search

http://server/site/_api/search

Publishing

http://server/site/_api/publishing

Excel services (new and

http://server/site/_vti_bin/ExcelRest.aspx

only on SharePoint Online)

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
URL syntax for REST calls
•

A request to the new REST interface shall use an URL composed in the
following way:
 Part 1 - Service root URI
 Es: http://siteurl/_api/

 Part 2 - Resource path (default entry point + resource)
 Es: web, site collection, list, file, sql table, user, namespace, method, etc…

 Part 3 - Query strings options (OData operators)
 Es: $filter, $select, etc…

Full documentation on MSDN:

http://msdn.microsoft.com/en-us/library/office/dn292556.aspx

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Allowed HTTP methods
•

Each REST command is a POST, GET, PUT, MERGE or DELETE HTTP
request (mapping to CRUD) where the specific resource is in the URL
and into request data





READ -> GET HTTP request
CREATE -> HTTP POST request
UPDATE -> HTTP POST PUT or HTTP POST MERGE request
DELETE -> HTTP DELETE request

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
Let’s play with _api

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Sample URLs
http://siteurl/_api/web
http://siteurl/_api/web/lists
http://siteurl/_api/web/lists?$filter=BaseTemplate eq 101
http://siteurl/_api/web/lists?$orderby=Title asc
http://siteurl/_api/web/lists?$top=5&$skip=5
http://siteurl/_api/web/lists?$filter=startswith(Title, 'Shared')
http://siteurl/_api/web/lists/getByTitle('Contacts')
http://siteurl/_api/web/lists/getByTitle('Contacts')/items
http://siteurl/_api/web/lists/getByTitle('Contacts')/items(1)
http://siteurl/_api/web/lists/getByTitle('Contacts')/items(1)/Title
http://siteurl/_api/web/lists/getByTitle('Contacts')/items(1)?$select=Title
http://siteurl/_api/web/lists/getbytitle('shared documents')/rootfolder/folders?$select=Name
http://siteurl/_api/web/getFolderByServerRelativeUrl('/Shared documents/Folder1/Folder2')
http://siteurl/_api/web/getFolderByServerRelativeUrl('Shared documents')/Folders/add(url=''New
folder')
http://siteurl/_api/Web/getFolderByServerRelativeUrl('Shared
documents')/Files/add(url='NewFile.txt', overwrite=true)
http://siteurl/_api/web/currentuser/email

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
How to find resource path?
•

Start from /_api/web!

•

Client object model reference

•

List of assemblies: 15/config/clientcallable xml files

•

SPRemoteAPIExplorer Visual Studio Extension

•

REST Navigator
(http://sprest.architectingconnectedsystems.com/navigator.aspx)

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
How to compone a query
•

In order to use the new REST interface in SharePoint 2013, you have to create
an HTTP request using these parameters:






URL – URI of the resource you want to manage
Request type – GET/POST
Data - parameters for POST queries
ContentType – Content type of Data (XML/JSON), default: XML
Headers





•

Accept – Content type of the response (XML/JSON), default: XML
X-RequestDigest – Security token
X-HTTP-Method – PUT/MERGE/DELETE
IF-MATCH – To manage concurrency

Note: you can do this HTTP request from every platform or programming
language!

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
How to compone a query

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Basic operations – Read (Javascript)
$.ajax({
url: '/_api/web/lists/getByTitle('LIST NAME')/items',
type: 'GET',
headers: {
'Accept': 'application/json;odata=verbose',
},
success: function (data) {
$.each(data.d.results, function(index, items) {
//...
}
},
error: function (jqXHR, textStatus, errorThrown) {
//...
}
});

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Basic operations – Read (C#)
//url
string url = "http://sp2013/_api/web/lists?$select=Title";
//credenziali
CredentialCache credentials = new CredentialCache();
credentials.Add(new Uri(url), "NTLM", CredentialCache.DefaultNetworkCredentials);
//richiesta HTTP
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Credentials = credentials;
request.Method = "GET";
request.Accept = "application/atom+xml;odata=verbose";
request.ContentLength = 0;
//lettura risposta HTTP
Stream postStream;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string results = GetHTTPResponse(response, out postStream, out results);
XmlDocument doc = new XmlDocument();
doc.LoadXml(results);
XmlNamespaceManager namespaces = new XmlNamespaceManager(new NameTable());
namespaces.AddNamespace("d", "http://schemas.microsoft.com/ado/2007/08/dataservices");
var lists = doc.SelectNodes("//d:Title", namespaces);
foreach (XmlNode list in lists)
Console.WriteLine(list.InnerText);

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Basic operations - Insert
$.ajax({
url: '/_api/web/lists/getByTitle('LIST NAME')/items',
type: 'POST',
data: JSON.stringify(JSON OBJECT),
contentType: 'application/json;odata=verbose',
headers: {
'content-type': 'application/json;odata=verbose',
'Accept': 'application/json;odata=verbose',
'X-RequestDigest': 'DIGEST VALUE'
},
success: function (data) {
//...
},
error: function (jqXHR, textStatus, errorThrown) {
//...
}
});
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Basic operations - Insert
$.ajax({
url: '/_api/web/lists/getByTitle('LIST NAME')/items',
type: 'POST',
data: JSON.stringify(JSON OBJECT),
contentType: 'application/json;odata=verbose',
headers: {
'content-type': 'application/json;odata=verbose',
'Accept': 'application/json;odata=verbose',
'X-RequestDigest': 'DIGEST VALUE' //??????????????
},
success: function (data) {
//...
},
error: function (jqXHR, textStatus, errorThrown) {
//...
}
});
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
The digest
•

It’s a token that enables SharePoint to validate current user session

•

It’s required for every POST call to REST APIs in which you change data
(INSERT, UPDATE, DELETE) and shall be the value of the HTTP header:
 X-RequestDigest

•

Where we can find this value?

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
The digest – How to find it?
OPTION 1

var formDigest = '';
$.ajax({
url: http://siteurl/_api/contextinfo
type: 'POST',
contentType: 'application/json;odata=verbose',
headers: { 'Accept': 'application/json;odata=verbose'},
success: function (data) {
formDigest = data.d.GetContextWebInformation.FormDigestValue;
},
error: function (jqXHR, textStatus, errorThrown) {
alert(errorThrown);
},
async: false
});
OPTION 2
var formDigest = $('__REQUESTDIGEST').val();
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Basic operations - Update

Note: For MERGE requests,
setting properties is
optional; any properties
that you do not explicitly
set retain their current
property. For PUT
requests, if you do not
specify all required
properties in object
updates, the REST service
returns an exception.

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Basic operations - Delete

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
General tips
•

Limit response length!
 Request only data that you want to use, with the $select parameter
 Paginate response where you can
 Use JSON (you get a smaller payload)

•

Limit the number of requests
 Remember that you are a client and that the request comes from a server

•

Request data in async way

•

Take care of concurrency (using IF-MATCH header)

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Known limits
•

Operations are a subset of the Client Object Model
 Client Object Model is a subset of the Server Object Model…

•

No request batching

•

No elevation of privilegies

•

OData is not fully implemented

•

256 characters for URLs

•

Items pagination with $top and $skip it’s bugged

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
BELLA! 
www.peppedotnet.it
www.dev4side.com

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Do you SharePoint?
•

SharePoint & Office Conference 2014
 27-28 Maggio 2014

•

http://www.sharepointconference.it/

•

Perché non puoi mancare





•

I migliori speaker italiani ed internazionali
30 sessioni tecniche + video registrati
Roundtable
Ask the Expert

Super Early Bird fino al 28 Marzo 2014!

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Q&A
Tutto il materiale di questa sessione su
http://www.communitydays.it/
Lascia il feedback su questa sessione,

potrai essere estratto per i nostri premi!
Seguici su
Twitter @CommunityDaysIT
Facebook http://facebook.com/cdaysit
#CDays14

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Ad

More Related Content

What's hot (20)

SharePoint 2010 Client Object Model
SharePoint 2010 Client Object ModelSharePoint 2010 Client Object Model
SharePoint 2010 Client Object Model
G. Scott Singleton
 
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
Sparkhound Inc.
 
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
 
SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote Authentication
Adil Ansari
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
Rob Windsor
 
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
Rob Windsor
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
Rob Windsor
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
Phil Wicklund
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
Kashif Imran
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
Rob Windsor
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
John Calvert
 
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Eric Shupps
 
Developing a Provider Hosted SharePoint app
Developing a Provider Hosted SharePoint appDeveloping a Provider Hosted SharePoint app
Developing a Provider Hosted SharePoint app
Talbott Crowell
 
SharePoint 2013 REST and CSOM
SharePoint 2013 REST  and CSOMSharePoint 2013 REST  and CSOM
SharePoint 2013 REST and CSOM
Usama Wahab Khan Cloud, Data and AI
 
Share point apps the good, the bad, and the pot of gold at the end of the r...
Share point apps   the good, the bad, and the pot of gold at the end of the r...Share point apps   the good, the bad, and the pot of gold at the end of the r...
Share point apps the good, the bad, and the pot of gold at the end of the r...
Bill Ayers
 
Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013
Giuseppe Marchi
 
Designing for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted AppsDesigning for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted Apps
Roy Kim
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010
Ben Robb
 
Working With Sharepoint 2013 Apps Development
Working With Sharepoint 2013 Apps DevelopmentWorking With Sharepoint 2013 Apps Development
Working With Sharepoint 2013 Apps Development
Pankaj Srivastava
 
Hooking SharePoint APIs with Android
Hooking SharePoint APIs with AndroidHooking SharePoint APIs with Android
Hooking SharePoint APIs with Android
Kris Wagner
 
SharePoint 2010 Client Object Model
SharePoint 2010 Client Object ModelSharePoint 2010 Client Object Model
SharePoint 2010 Client Object Model
G. Scott Singleton
 
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
Sparkhound Inc.
 
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
 
SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote Authentication
Adil Ansari
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
Rob Windsor
 
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
Rob Windsor
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
Rob Windsor
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
Phil Wicklund
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
Kashif Imran
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
Rob Windsor
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
John Calvert
 
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Eric Shupps
 
Developing a Provider Hosted SharePoint app
Developing a Provider Hosted SharePoint appDeveloping a Provider Hosted SharePoint app
Developing a Provider Hosted SharePoint app
Talbott Crowell
 
Share point apps the good, the bad, and the pot of gold at the end of the r...
Share point apps   the good, the bad, and the pot of gold at the end of the r...Share point apps   the good, the bad, and the pot of gold at the end of the r...
Share point apps the good, the bad, and the pot of gold at the end of the r...
Bill Ayers
 
Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013
Giuseppe Marchi
 
Designing for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted AppsDesigning for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted Apps
Roy Kim
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010
Ben Robb
 
Working With Sharepoint 2013 Apps Development
Working With Sharepoint 2013 Apps DevelopmentWorking With Sharepoint 2013 Apps Development
Working With Sharepoint 2013 Apps Development
Pankaj Srivastava
 
Hooking SharePoint APIs with Android
Hooking SharePoint APIs with AndroidHooking SharePoint APIs with Android
Hooking SharePoint APIs with Android
Kris Wagner
 

Similar to SharePoint 2013 REST APIs (20)

Tips and Tricks for Building Visual Studio Workflows
Tips and Tricks for Building Visual Studio WorkflowsTips and Tricks for Building Visual Studio Workflows
Tips and Tricks for Building Visual Studio Workflows
Malin De Silva
 
Web api
Web apiWeb api
Web api
Sudhakar Sharma
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
Getting Started with API Management
Getting Started with API ManagementGetting Started with API Management
Getting Started with API Management
Revelation Technologies
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
Jitendra Bafna
 
ITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul Services
Ortus Solutions, Corp
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
Liam Cleary [MVP]
 
2013 - Back to the Future with Client/Server Development
2013 - Back to the Future with Client/Server Development 2013 - Back to the Future with Client/Server Development
2013 - Back to the Future with Client/Server Development
Chris O'Connor
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
Sachin G Kulkarni
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016
Ortus Solutions, Corp
 
Rest ful tools for lazy experts
Rest ful tools for lazy expertsRest ful tools for lazy experts
Rest ful tools for lazy experts
ColdFusionConference
 
REST - Why, When and How? at AMIS25
REST - Why, When and How? at AMIS25REST - Why, When and How? at AMIS25
REST - Why, When and How? at AMIS25
Jon Petter Hjulstad
 
06 web api
06 web api06 web api
06 web api
Bat Programmer
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Taiseer Joudeh
 
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
Kiril Iliev
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIs
Siva Arunachalam
 
grlc: Bridging the Gap Between RESTful APIs and Linked Data
grlc: Bridging the Gap Between RESTful APIs and Linked Datagrlc: Bridging the Gap Between RESTful APIs and Linked Data
grlc: Bridging the Gap Between RESTful APIs and Linked Data
Albert Meroño-Peñuela
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
Tom Johnson
 
Tips and Tricks for Building Visual Studio Workflows
Tips and Tricks for Building Visual Studio WorkflowsTips and Tricks for Building Visual Studio Workflows
Tips and Tricks for Building Visual Studio Workflows
Malin De Silva
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
Jitendra Bafna
 
ITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul Services
Ortus Solutions, Corp
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
Liam Cleary [MVP]
 
2013 - Back to the Future with Client/Server Development
2013 - Back to the Future with Client/Server Development 2013 - Back to the Future with Client/Server Development
2013 - Back to the Future with Client/Server Development
Chris O'Connor
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
Sachin G Kulkarni
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016
Ortus Solutions, Corp
 
REST - Why, When and How? at AMIS25
REST - Why, When and How? at AMIS25REST - Why, When and How? at AMIS25
REST - Why, When and How? at AMIS25
Jon Petter Hjulstad
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Taiseer Joudeh
 
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
Kiril Iliev
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIs
Siva Arunachalam
 
grlc: Bridging the Gap Between RESTful APIs and Linked Data
grlc: Bridging the Gap Between RESTful APIs and Linked Datagrlc: Bridging the Gap Between RESTful APIs and Linked Data
grlc: Bridging the Gap Between RESTful APIs and Linked Data
Albert Meroño-Peñuela
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
Tom Johnson
 
Ad

More from Giuseppe Marchi (12)

Calling APIs with SharePoint Framework
Calling APIs with SharePoint FrameworkCalling APIs with SharePoint Framework
Calling APIs with SharePoint Framework
Giuseppe Marchi
 
Wiriting applications for Microsoft Teams
Wiriting applications for Microsoft TeamsWiriting applications for Microsoft Teams
Wiriting applications for Microsoft Teams
Giuseppe Marchi
 
SharePoint Framework tips and tricks
SharePoint Framework tips and tricksSharePoint Framework tips and tricks
SharePoint Framework tips and tricks
Giuseppe Marchi
 
What's new in SharePoint 2016
What's new in SharePoint 2016What's new in SharePoint 2016
What's new in SharePoint 2016
Giuseppe Marchi
 
Prepararsi a spostare le proprie applicazioni share point su office 365
Prepararsi a spostare le proprie applicazioni share point su office 365Prepararsi a spostare le proprie applicazioni share point su office 365
Prepararsi a spostare le proprie applicazioni share point su office 365
Giuseppe Marchi
 
SharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricksSharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricks
Giuseppe Marchi
 
Apps for SharePoint Online 2013
Apps for SharePoint Online 2013Apps for SharePoint Online 2013
Apps for SharePoint Online 2013
Giuseppe Marchi
 
Sp real world solutions - field permissions
Sp real world solutions - field permissionsSp real world solutions - field permissions
Sp real world solutions - field permissions
Giuseppe Marchi
 
Introduction to Umbraco
Introduction to UmbracoIntroduction to Umbraco
Introduction to Umbraco
Giuseppe Marchi
 
Integrazione tra SharePoint 2010 e Windows Azure (Azure Day)
Integrazione tra SharePoint 2010 e Windows Azure (Azure Day)Integrazione tra SharePoint 2010 e Windows Azure (Azure Day)
Integrazione tra SharePoint 2010 e Windows Azure (Azure Day)
Giuseppe Marchi
 
Introduzione a SharePoint 2010 per sviluppatori (.NET Campus 2011)
Introduzione a SharePoint 2010 per sviluppatori (.NET Campus 2011)Introduzione a SharePoint 2010 per sviluppatori (.NET Campus 2011)
Introduzione a SharePoint 2010 per sviluppatori (.NET Campus 2011)
Giuseppe Marchi
 
Introduzione a SharePoint Online (Microsoft Community Tour)
Introduzione a SharePoint Online (Microsoft Community Tour)Introduzione a SharePoint Online (Microsoft Community Tour)
Introduzione a SharePoint Online (Microsoft Community Tour)
Giuseppe Marchi
 
Calling APIs with SharePoint Framework
Calling APIs with SharePoint FrameworkCalling APIs with SharePoint Framework
Calling APIs with SharePoint Framework
Giuseppe Marchi
 
Wiriting applications for Microsoft Teams
Wiriting applications for Microsoft TeamsWiriting applications for Microsoft Teams
Wiriting applications for Microsoft Teams
Giuseppe Marchi
 
SharePoint Framework tips and tricks
SharePoint Framework tips and tricksSharePoint Framework tips and tricks
SharePoint Framework tips and tricks
Giuseppe Marchi
 
What's new in SharePoint 2016
What's new in SharePoint 2016What's new in SharePoint 2016
What's new in SharePoint 2016
Giuseppe Marchi
 
Prepararsi a spostare le proprie applicazioni share point su office 365
Prepararsi a spostare le proprie applicazioni share point su office 365Prepararsi a spostare le proprie applicazioni share point su office 365
Prepararsi a spostare le proprie applicazioni share point su office 365
Giuseppe Marchi
 
SharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricksSharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricks
Giuseppe Marchi
 
Apps for SharePoint Online 2013
Apps for SharePoint Online 2013Apps for SharePoint Online 2013
Apps for SharePoint Online 2013
Giuseppe Marchi
 
Sp real world solutions - field permissions
Sp real world solutions - field permissionsSp real world solutions - field permissions
Sp real world solutions - field permissions
Giuseppe Marchi
 
Integrazione tra SharePoint 2010 e Windows Azure (Azure Day)
Integrazione tra SharePoint 2010 e Windows Azure (Azure Day)Integrazione tra SharePoint 2010 e Windows Azure (Azure Day)
Integrazione tra SharePoint 2010 e Windows Azure (Azure Day)
Giuseppe Marchi
 
Introduzione a SharePoint 2010 per sviluppatori (.NET Campus 2011)
Introduzione a SharePoint 2010 per sviluppatori (.NET Campus 2011)Introduzione a SharePoint 2010 per sviluppatori (.NET Campus 2011)
Introduzione a SharePoint 2010 per sviluppatori (.NET Campus 2011)
Giuseppe Marchi
 
Introduzione a SharePoint Online (Microsoft Community Tour)
Introduzione a SharePoint Online (Microsoft Community Tour)Introduzione a SharePoint Online (Microsoft Community Tour)
Introduzione a SharePoint Online (Microsoft Community Tour)
Giuseppe Marchi
 
Ad

Recently uploaded (20)

Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 

SharePoint 2013 REST APIs

  • 1. SHA02 – Le REST API di SharePoint 2013 Giuseppe Marchi Dev4Side S.r.l. – SharePoint MVP [email protected] - @PeppeDotNet http://www.peppedotnet.it http://www.dev4side.com #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 2. Grazie a Sponsor #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 3. Who I am • Co-founder of Dev4Side S.r.l. • 4 years Microsoft SharePoint MVP • Speaker in Microsoft and Community events in Italy • MCP, MCPD Web applications, MCTS ASP.NET 4, WSS 3.0, MOSS 2007 and SharePoint 2010 • "SharePointer" from 2005 • Father of www.peppedotnet.it  • Author of the book «Pocket C#», Apogeo • Active member, speaker and promoter of SharePointCommunity.it • First, in Italy, with an App in the Office Store • One of the TOP 25 SharePoint Influencers in Europe #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 4. Agenda • What’s REST? • What’s REST in SharePoint • SharePoint 2013 API changes  What’s new with REST interface • New REST APIs syntax • Basic operators and actions • General tips • Known limits #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 5. What’s REST? • REST = Representational State Transfer  It’s an architecture style for designing networked applications  RESTful applications use HTTP requests to post data (create and/or update), read data (e.g., make queries), and delete data. Thus, REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations.  REST is a lightweight alternative to Web Services • It’s an architectural style, awesome for cross-platform apps • Easier and smaller than SOAP • Easy to use with Javascript, than C# #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 6. What’s REST in SharePoint? #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 7. What’s REST in SharePoint? • It’s another way to consume data, use all the advanced services and functionalities exposed by SharePoint from your own client applications • in a secure way • … all done with a simple HTTP request! #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 8. What we had in the past? • MOSS 2007  SOAP Services • SharePoint 2010  SOAP Services  Client Object Model     Direct access to client.svc service Request always in XML Must use a proxy Supports only .NET, Silverlight and Javascript  REST Interface (ListData.svc)  Only for lists! #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 9. What we have now – New REST APIs • Direct access to client.svc service (using _api alias) • Access HTTP GET, PUT, Merge, POST Requests • OData implementation* • Atom XML or JSON as data type • Supports any application, language or platform that enables you to do a HTTP request  You can access to a lot of features of the Client Object Model through an HTTP request! #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 10. demo Our first call to SharePoint 2013 REST APIs #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 11. Entry points REST service includes several access points that enable developers to navigate to specific functionality of SharePoint 2013. The table below lists some of these access points. Feature area Entry point Context http://server/site/_api/contextInfo Site http://server/site/_api/site Web http://server/site/_api/web User profile http://server/site/_api/SP .UserProfiles.PeopleManager Search http://server/site/_api/search Publishing http://server/site/_api/publishing Excel services (new and http://server/site/_vti_bin/ExcelRest.aspx only on SharePoint Online) #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 12. URL syntax for REST calls • A request to the new REST interface shall use an URL composed in the following way:  Part 1 - Service root URI  Es: http://siteurl/_api/  Part 2 - Resource path (default entry point + resource)  Es: web, site collection, list, file, sql table, user, namespace, method, etc…  Part 3 - Query strings options (OData operators)  Es: $filter, $select, etc… Full documentation on MSDN: http://msdn.microsoft.com/en-us/library/office/dn292556.aspx #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 13. Allowed HTTP methods • Each REST command is a POST, GET, PUT, MERGE or DELETE HTTP request (mapping to CRUD) where the specific resource is in the URL and into request data     READ -> GET HTTP request CREATE -> HTTP POST request UPDATE -> HTTP POST PUT or HTTP POST MERGE request DELETE -> HTTP DELETE request #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 14. demo Let’s play with _api #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 15. Sample URLs http://siteurl/_api/web http://siteurl/_api/web/lists http://siteurl/_api/web/lists?$filter=BaseTemplate eq 101 http://siteurl/_api/web/lists?$orderby=Title asc http://siteurl/_api/web/lists?$top=5&$skip=5 http://siteurl/_api/web/lists?$filter=startswith(Title, 'Shared') http://siteurl/_api/web/lists/getByTitle('Contacts') http://siteurl/_api/web/lists/getByTitle('Contacts')/items http://siteurl/_api/web/lists/getByTitle('Contacts')/items(1) http://siteurl/_api/web/lists/getByTitle('Contacts')/items(1)/Title http://siteurl/_api/web/lists/getByTitle('Contacts')/items(1)?$select=Title http://siteurl/_api/web/lists/getbytitle('shared documents')/rootfolder/folders?$select=Name http://siteurl/_api/web/getFolderByServerRelativeUrl('/Shared documents/Folder1/Folder2') http://siteurl/_api/web/getFolderByServerRelativeUrl('Shared documents')/Folders/add(url=''New folder') http://siteurl/_api/Web/getFolderByServerRelativeUrl('Shared documents')/Files/add(url='NewFile.txt', overwrite=true) http://siteurl/_api/web/currentuser/email #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 16. How to find resource path? • Start from /_api/web! • Client object model reference • List of assemblies: 15/config/clientcallable xml files • SPRemoteAPIExplorer Visual Studio Extension • REST Navigator (http://sprest.architectingconnectedsystems.com/navigator.aspx) #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 17. How to compone a query • In order to use the new REST interface in SharePoint 2013, you have to create an HTTP request using these parameters:      URL – URI of the resource you want to manage Request type – GET/POST Data - parameters for POST queries ContentType – Content type of Data (XML/JSON), default: XML Headers     • Accept – Content type of the response (XML/JSON), default: XML X-RequestDigest – Security token X-HTTP-Method – PUT/MERGE/DELETE IF-MATCH – To manage concurrency Note: you can do this HTTP request from every platform or programming language! #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 18. demo How to compone a query #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 19. Basic operations – Read (Javascript) $.ajax({ url: '/_api/web/lists/getByTitle('LIST NAME')/items', type: 'GET', headers: { 'Accept': 'application/json;odata=verbose', }, success: function (data) { $.each(data.d.results, function(index, items) { //... } }, error: function (jqXHR, textStatus, errorThrown) { //... } }); #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 20. Basic operations – Read (C#) //url string url = "http://sp2013/_api/web/lists?$select=Title"; //credenziali CredentialCache credentials = new CredentialCache(); credentials.Add(new Uri(url), "NTLM", CredentialCache.DefaultNetworkCredentials); //richiesta HTTP HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Credentials = credentials; request.Method = "GET"; request.Accept = "application/atom+xml;odata=verbose"; request.ContentLength = 0; //lettura risposta HTTP Stream postStream; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string results = GetHTTPResponse(response, out postStream, out results); XmlDocument doc = new XmlDocument(); doc.LoadXml(results); XmlNamespaceManager namespaces = new XmlNamespaceManager(new NameTable()); namespaces.AddNamespace("d", "http://schemas.microsoft.com/ado/2007/08/dataservices"); var lists = doc.SelectNodes("//d:Title", namespaces); foreach (XmlNode list in lists) Console.WriteLine(list.InnerText); #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 21. Basic operations - Insert $.ajax({ url: '/_api/web/lists/getByTitle('LIST NAME')/items', type: 'POST', data: JSON.stringify(JSON OBJECT), contentType: 'application/json;odata=verbose', headers: { 'content-type': 'application/json;odata=verbose', 'Accept': 'application/json;odata=verbose', 'X-RequestDigest': 'DIGEST VALUE' }, success: function (data) { //... }, error: function (jqXHR, textStatus, errorThrown) { //... } }); #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 22. Basic operations - Insert $.ajax({ url: '/_api/web/lists/getByTitle('LIST NAME')/items', type: 'POST', data: JSON.stringify(JSON OBJECT), contentType: 'application/json;odata=verbose', headers: { 'content-type': 'application/json;odata=verbose', 'Accept': 'application/json;odata=verbose', 'X-RequestDigest': 'DIGEST VALUE' //?????????????? }, success: function (data) { //... }, error: function (jqXHR, textStatus, errorThrown) { //... } }); #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 23. The digest • It’s a token that enables SharePoint to validate current user session • It’s required for every POST call to REST APIs in which you change data (INSERT, UPDATE, DELETE) and shall be the value of the HTTP header:  X-RequestDigest • Where we can find this value? #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 24. The digest – How to find it? OPTION 1 var formDigest = ''; $.ajax({ url: http://siteurl/_api/contextinfo type: 'POST', contentType: 'application/json;odata=verbose', headers: { 'Accept': 'application/json;odata=verbose'}, success: function (data) { formDigest = data.d.GetContextWebInformation.FormDigestValue; }, error: function (jqXHR, textStatus, errorThrown) { alert(errorThrown); }, async: false }); OPTION 2 var formDigest = $('__REQUESTDIGEST').val(); #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 25. Basic operations - Update Note: For MERGE requests, setting properties is optional; any properties that you do not explicitly set retain their current property. For PUT requests, if you do not specify all required properties in object updates, the REST service returns an exception. #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 26. Basic operations - Delete #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 27. General tips • Limit response length!  Request only data that you want to use, with the $select parameter  Paginate response where you can  Use JSON (you get a smaller payload) • Limit the number of requests  Remember that you are a client and that the request comes from a server • Request data in async way • Take care of concurrency (using IF-MATCH header) #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 28. Known limits • Operations are a subset of the Client Object Model  Client Object Model is a subset of the Server Object Model… • No request batching • No elevation of privilegies • OData is not fully implemented • 256 characters for URLs • Items pagination with $top and $skip it’s bugged #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 30. Do you SharePoint? • SharePoint & Office Conference 2014  27-28 Maggio 2014 • http://www.sharepointconference.it/ • Perché non puoi mancare     • I migliori speaker italiani ed internazionali 30 sessioni tecniche + video registrati Roundtable Ask the Expert Super Early Bird fino al 28 Marzo 2014! #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 31. Q&A Tutto il materiale di questa sessione su http://www.communitydays.it/ Lascia il feedback su questa sessione, potrai essere estratto per i nostri premi! Seguici su Twitter @CommunityDaysIT Facebook http://facebook.com/cdaysit #CDays14 #CDays14 – Milano 25, 26 e 27 Febbraio 2014