SlideShare a Scribd company logo
1 of 40
Download to read offline
chris.beckett@obeflow.com
www.obeflow.com
(425) 522-3727
Enterprise Content Management and Business Process Automation Software as a Service
Understanding and Programming
the SharePoint REST API
About Chris Beckett
24+10
MCM
MCT
MCSE
MCPD
Entrepreneur
Solutions Architect
Systems Engineer
Trainer and Author
chris.beckett@obeflow.com
@sharepointbits
blog.sharepointbits.com
Agenda
Introduction to
SharePoint Web
Services
Working with
REST and ODATA
Services
Programming
with the
REST API
Agenda
Introduction to
SharePoint Web
Services Working with
REST and ODATA
Services
Programming
with the
REST API
Available SharePoint Web Services
• Open Standards
• RPC Model
• Protocol Agnostic
• XML
• Microsoft Proprietary
• Batch RPC Model
• Client Runtime
• XML / JSON
• Open Standards
• REST Model
• HTTP Only
• ATOM / JSON
SOAP
Web Services
(ASMX)
Client Side Object
Model
(CSOM/JSOM)
REST API
(ODATA)
SharePoint 2010 Web Service Access
SOAP CSOM REST
Lists and Libraries
Site and List Settings
Site Security
Workflow
Search
Managed Metadata
User Profiles
Publishing
SharePoint 2010 Web Service Clients
SOAP CSOM REST
JavaScript
Silverlight
.NET
Windows Phone
Other Languages
InfoPath Receive
InfoPath Submit
BCS WCF Connector
SharePoint 2013 Web Service Access
SOAP CSOM REST
Lists and Libraries
Site and List Settings
Site Security
Workflow
Search
Managed Metadata
User Profiles
Publishing
Deprecated
SharePoint 2010 Web Service Clients
SOAP CSOM REST
JavaScript
Silverlight
.NET
Windows Phone
Other Languages
InfoPath Receive
InfoPath Submit
BCS WCF Connector
Deprecated
What is SOAP?
Created by Microsoft in 1998 / W3C Standard
Protocol Agnostic / Common to use HTTP
RPC Message Pattern (Request/Response)
XML Schema used for Message Structures
SharePoint Web Service Addresses
Web Service Web Service Address
Search http://<site>/_vti_bin/search.asmx
User Profiles http://<site>/_vti_bin/userprofileservice.asmx
Sites http://<site>/_vti_bin/sites.asmx
Lists http://<site>/_vti_bin/lists.asmx
Permissions http://<site>/_vti_bin/permissions.asmx
Copy http://<site>/_vti_bin/copy.asmx
31 Public Web Services (25+6) in SharePoint
SOAP Request Message Format
SOAP Envelope
SOAP Body
Method and
Parameters
SOAP Considerations
• All Versions of SharePoint
• Ubiquitous
• Protocol Agnostic
• Language Agnostic
• Access to Enterprise Services
• Designed to work with Proxy
• Not JavaScript Friendly
• Verbose Xml Data
• No Anonymous
What is the CSOM?
Proprietary Microsoft SharePoint Client API
.NET / Silverlight / WP7 / ECMAScript
Mimics Server-side Object Model
Proprietary Message Transfer Format
CSOM Architecture
CSOM (.NET)
Create a Context
Load the Context
Execute Query
Access Properties
CSOM Considerations
• Efficient for Batch Operations
• Familiar for SharePoint
Developers
• Supports LINQ Queries
• Works with Anonymous
• Less Efficient for Simple
Operations
• Unfamiliar to Web Developers
• Limited # of Client Runtimes
• Microsoft Proprietary
What is REST?
Representational State Transfer
Web Addressable Resources / Hyperlink-able
Maps CRUD operations with HTTP Verbs
Commonly uses JSON for Data Messages
Anatomy of a REST Call
Request URLHTTP Method
HTTP Body with
Encoded DataHeaders
HTTP Status Codes
Status Code Description
200 OK The server successfully processed the request.
400 Bad Request The server didn't understand the request.
401 Unauthorized The request requires authentication.
404 Not Found The server can't find the requested page.
500 Internal Server Error The server encountered an error.
Calling a web service
requires checking the
status code to validate
success
Data Encoding - ATOMPUB
Data Encoding - JSON
REST Considerations
• Efficient for simple operations
• Familiar to Web Developers
• HTTP and open standards
• Very JavaScript Friendly
• Limited support for Anonymous
• Complex for batch operations
• Unfamiliar to SharePoint
Developers
• Requires knowledge of HTTP
protocol and programming
Anatomy of a REST
Call
 Using the List Data Service
 Using the Client REST API
 Data Encoding
Agenda
Introduction to
SharePoint Web
Services
Working with
REST and ODATA
Services Programming
with the
REST API
Understanding and programming the SharePoint REST API
ODATA Operations and Parameters
GET (Retrieve)
POST (Create)
PUT (Update All Fields)
DELETE (Delete)
MERGE (Update Specific)
$filter={simple predicate}
$expand={Entity}
$order by={property}
$skip={n}
$top={n}
$metadata
Operations Parameters
ODATA Query Operators
Area Supported Not Supported
Numeric
Comparisons
• Lt, Le
• Gt, Ge
• Eq, Ne
• add, sub, mul, div, mod
• round, floor, ceiling
String
Comparisons
• startsWith
• substringof
• Eq
• Ne
• endsWith, trim
• substring, replace, concat
• tolower, toupper
Date and Time
Functions
• day(), month(), year()
• hour(), minute(),
second()
• DateTimeRangesOverlap
Querying with
ODATA
 $Top and $Skip
 $Filter
 $Select
 $OrderBy
 $Expand
Agenda
Introduction to
SharePoint Web
Services
Working with
REST and ODATA
Services
Programming
with the
REST API
Programming Tools / Platforms
• C++
• C#
• VB.NET
• PHP
• Java
• Datajs
• jQuery
• Sencha Rest Connector
• JayData
• RequestExecutor
Compiled Languages JavaScript Libraries
List Data Service Access Points
Area Access Point
Lists http://server/site/_vti_bin/ListData.svc
List http://server/site/_vti_bin/ListData.svc/Tasks
Client REST Service Access Points
Area Access Point
Site http://server/site/_api/site
Web http://server/site/_api/web
Lists http://server/site/_api/web/lists
List http://server/site/_api/web/lists/getbytitle(‘Tasks’)
User Profile http://server/site/_api/SP.UserProfiles.PeopleManager
Search http://server/site/_api/search
Publishing http://server/site/_api/publishing
Visual Studio
List Data Service 2010 (ECMA Script)
Request Executor (SharePoint 2013)
Calling SharePoint
REST APIs
 HTTP Verbs
 Accept Headers
 Authentication
 eTags and Concurrency
More Information
Choose the Right API set with SharePoint 2013
http://msdn.microsoft.com/en-us/library/jj164060.aspx
Complete Basic Operations with the SharePoint 2013 Client Library
http://msdn.microsoft.com/en-us/library/fp179912.aspx
Programming using the SharePoint 2013 REST Service
http://msdn.microsoft.com/en-us/library/fp142385.aspx
SharePoint 2010 Web Services
http://msdn.microsoft.com/en-us/library/ee705814(v=office.14).aspx
Accessing SharePoint 2010 Lists by Using WCF Data Services
http://msdn.microsoft.com/en-us/library/hh134614(v=office.14).aspx
Tools and Utilities
LinqPad – Learn ODATA Queries with Linq
http://www.linqpad.net/
RESTClient – Java Application for Testing REST Programming
https://code.google.com/p/rest-client/
CAML Designer for SharePoint 2010 and 2013
http://sharepoint.biwug.be/SitePages/Caml_Designer.aspx
Fiddler – HTTP Debugger
http://www.fiddler2.com/fiddler2/
SharePoint 2013 Search Query Tool
http://sp2013searchtool.codeplex.com/
Questions
Thank you for attending!
Please complete your
evaluations. Your feedback is
appreciated 
chris.beckett@obeflow.com
(425) 522-3727
@sharepointbits
blog.sharepointbits.com

More Related Content

What's hot

Hacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdfHacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdfMatt Tesauro
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaEdureka!
 
[오픈소스컨설팅]Atlassian JIRA Deep Dive
[오픈소스컨설팅]Atlassian JIRA Deep Dive[오픈소스컨설팅]Atlassian JIRA Deep Dive
[오픈소스컨설팅]Atlassian JIRA Deep DiveJi-Woong Choi
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring SecurityOrest Ivasiv
 
Dapr: distributed application runtime
Dapr: distributed application runtimeDapr: distributed application runtime
Dapr: distributed application runtimeMoaid Hathot
 
SharePoint 開発でできること 2019年9月版
SharePoint 開発でできること 2019年9月版SharePoint 開発でできること 2019年9月版
SharePoint 開発でできること 2019年9月版Hiroaki Oikawa
 
From capabilities to services modelling for business-it alignment v.2
From capabilities to services   modelling for business-it alignment v.2From capabilities to services   modelling for business-it alignment v.2
From capabilities to services modelling for business-it alignment v.2Trond Hjorteland
 
Top Trends in Application Architecture That Enable.pdf
Top Trends in Application Architecture That Enable.pdfTop Trends in Application Architecture That Enable.pdf
Top Trends in Application Architecture That Enable.pdfMantoshKumarSingh7
 
SharePoint 開発入門
SharePoint 開発入門SharePoint 開発入門
SharePoint 開発入門Hiroaki Oikawa
 
Developing event-driven microservices with event sourcing and CQRS (phillyete)
Developing event-driven microservices with event sourcing and CQRS (phillyete)Developing event-driven microservices with event sourcing and CQRS (phillyete)
Developing event-driven microservices with event sourcing and CQRS (phillyete)Chris Richardson
 
Event Driven Architecture (EDA) Reference Architecture
Event Driven Architecture (EDA) Reference ArchitectureEvent Driven Architecture (EDA) Reference Architecture
Event Driven Architecture (EDA) Reference ArchitectureBob Rhubart
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology StackEberhard Wolff
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - IntroductionKnoldus Inc.
 

What's hot (20)

PHP版レガシーコード改善に役立つ新パターン #wewlc_jp
PHP版レガシーコード改善に役立つ新パターン #wewlc_jp PHP版レガシーコード改善に役立つ新パターン #wewlc_jp
PHP版レガシーコード改善に役立つ新パターン #wewlc_jp
 
Hacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdfHacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdf
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
[오픈소스컨설팅]Atlassian JIRA Deep Dive
[오픈소스컨설팅]Atlassian JIRA Deep Dive[오픈소스컨설팅]Atlassian JIRA Deep Dive
[오픈소스컨설팅]Atlassian JIRA Deep Dive
 
50.000 orange stickies later
50.000 orange stickies later50.000 orange stickies later
50.000 orange stickies later
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring Security
 
Rest API
Rest APIRest API
Rest API
 
Dapr: distributed application runtime
Dapr: distributed application runtimeDapr: distributed application runtime
Dapr: distributed application runtime
 
SharePoint 開発でできること 2019年9月版
SharePoint 開発でできること 2019年9月版SharePoint 開発でできること 2019年9月版
SharePoint 開発でできること 2019年9月版
 
Frans Rosén Keynote at BSides Ahmedabad
Frans Rosén Keynote at BSides AhmedabadFrans Rosén Keynote at BSides Ahmedabad
Frans Rosén Keynote at BSides Ahmedabad
 
From capabilities to services modelling for business-it alignment v.2
From capabilities to services   modelling for business-it alignment v.2From capabilities to services   modelling for business-it alignment v.2
From capabilities to services modelling for business-it alignment v.2
 
Top Trends in Application Architecture That Enable.pdf
Top Trends in Application Architecture That Enable.pdfTop Trends in Application Architecture That Enable.pdf
Top Trends in Application Architecture That Enable.pdf
 
SharePoint 開発入門
SharePoint 開発入門SharePoint 開発入門
SharePoint 開発入門
 
Laravel Eloquent ORM
Laravel Eloquent ORMLaravel Eloquent ORM
Laravel Eloquent ORM
 
Developing event-driven microservices with event sourcing and CQRS (phillyete)
Developing event-driven microservices with event sourcing and CQRS (phillyete)Developing event-driven microservices with event sourcing and CQRS (phillyete)
Developing event-driven microservices with event sourcing and CQRS (phillyete)
 
Event Driven Architecture (EDA) Reference Architecture
Event Driven Architecture (EDA) Reference ArchitectureEvent Driven Architecture (EDA) Reference Architecture
Event Driven Architecture (EDA) Reference Architecture
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
SSRF workshop
SSRF workshop SSRF workshop
SSRF workshop
 

Viewers also liked

SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationAdil Ansari
 
SharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricksSharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricksGiuseppe Marchi
 
Understanding the REST API of SharePoint 2013
Understanding the REST API of SharePoint 2013Understanding the REST API of SharePoint 2013
Understanding the REST API of SharePoint 2013SPSSTHLM
 
ORCID Member Site Integration: Using the API
ORCID Member Site Integration: Using the APIORCID Member Site Integration: Using the API
ORCID Member Site Integration: Using the APIORCID, Inc
 
The Digital Workplace - What are the elements - How do we achieve success - s...
The Digital Workplace - What are the elements - How do we achieve success - s...The Digital Workplace - What are the elements - How do we achieve success - s...
The Digital Workplace - What are the elements - How do we achieve success - s...Ruven Gotz
 
SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)Kashif Imran
 
Succeeding With SharePoint In Seven Steps - Share Atlanta
Succeeding With SharePoint In Seven Steps - Share AtlantaSucceeding With SharePoint In Seven Steps - Share Atlanta
Succeeding With SharePoint In Seven Steps - Share AtlantaRichard Harbridge
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIRob Windsor
 
Getting started with SharePoint 2013 online development
Getting started with SharePoint 2013 online developmentGetting started with SharePoint 2013 online development
Getting started with SharePoint 2013 online developmentJeremy Thake
 
SharePoint REST vs CSOM
SharePoint REST vs CSOMSharePoint REST vs CSOM
SharePoint REST vs CSOMMark Rackley
 
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonCSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonKunaal Kapoor
 
Power Up with PowerApps
Power Up with PowerAppsPower Up with PowerApps
Power Up with PowerAppsBobby Chang
 
10 Reasons to Avoid Folders in SharePoint 2013/2010
10 Reasons to Avoid Folders in SharePoint 2013/201010 Reasons to Avoid Folders in SharePoint 2013/2010
10 Reasons to Avoid Folders in SharePoint 2013/2010Bobby Chang
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
10 Best SharePoint Features You’ve Never Used (But Should)
10 Best SharePoint Features You’ve Never Used (But Should)10 Best SharePoint Features You’ve Never Used (But Should)
10 Best SharePoint Features You’ve Never Used (But Should)Christian Buckley
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayAmazon Web Services
 
SharePoint Permissions Worst Practices
SharePoint Permissions Worst PracticesSharePoint Permissions Worst Practices
SharePoint Permissions Worst PracticesBobby Chang
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to BootstrapRon Reiter
 
10 Best Productivity Features in SharePoint 2013
10 Best Productivity Features in SharePoint 201310 Best Productivity Features in SharePoint 2013
10 Best Productivity Features in SharePoint 2013Christian Buckley
 

Viewers also liked (20)

SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote Authentication
 
SharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricksSharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricks
 
Understanding the REST API of SharePoint 2013
Understanding the REST API of SharePoint 2013Understanding the REST API of SharePoint 2013
Understanding the REST API of SharePoint 2013
 
ORCID Member Site Integration: Using the API
ORCID Member Site Integration: Using the APIORCID Member Site Integration: Using the API
ORCID Member Site Integration: Using the API
 
The Digital Workplace - What are the elements - How do we achieve success - s...
The Digital Workplace - What are the elements - How do we achieve success - s...The Digital Workplace - What are the elements - How do we achieve success - s...
The Digital Workplace - What are the elements - How do we achieve success - s...
 
SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)
 
Succeeding With SharePoint In Seven Steps - Share Atlanta
Succeeding With SharePoint In Seven Steps - Share AtlantaSucceeding With SharePoint In Seven Steps - Share Atlanta
Succeeding With SharePoint In Seven Steps - Share Atlanta
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST API
 
Getting started with SharePoint 2013 online development
Getting started with SharePoint 2013 online developmentGetting started with SharePoint 2013 online development
Getting started with SharePoint 2013 online development
 
SharePoint REST vs CSOM
SharePoint REST vs CSOMSharePoint REST vs CSOM
SharePoint REST vs CSOM
 
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonCSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
 
Power Up with PowerApps
Power Up with PowerAppsPower Up with PowerApps
Power Up with PowerApps
 
A Checklist for Every API Call
A Checklist for Every API CallA Checklist for Every API Call
A Checklist for Every API Call
 
10 Reasons to Avoid Folders in SharePoint 2013/2010
10 Reasons to Avoid Folders in SharePoint 2013/201010 Reasons to Avoid Folders in SharePoint 2013/2010
10 Reasons to Avoid Folders in SharePoint 2013/2010
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
10 Best SharePoint Features You’ve Never Used (But Should)
10 Best SharePoint Features You’ve Never Used (But Should)10 Best SharePoint Features You’ve Never Used (But Should)
10 Best SharePoint Features You’ve Never Used (But Should)
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 
SharePoint Permissions Worst Practices
SharePoint Permissions Worst PracticesSharePoint Permissions Worst Practices
SharePoint Permissions Worst Practices
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 
10 Best Productivity Features in SharePoint 2013
10 Best Productivity Features in SharePoint 201310 Best Productivity Features in SharePoint 2013
10 Best Productivity Features in SharePoint 2013
 

Similar to Understanding and programming the SharePoint REST API

SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSPTechCon
 
Full Stack Developer
Full Stack DeveloperFull Stack Developer
Full Stack DeveloperAkbar Uddin
 
Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slidesCisco DevNet
 
Web api using rest based architecture
Web api using rest based architectureWeb api using rest based architecture
Web api using rest based architectureSoham Kulkarni
 
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...BlueMetalInc
 
Deploying and Managing PowerPivot for SharePoint
Deploying and Managing PowerPivot for SharePointDeploying and Managing PowerPivot for SharePoint
Deploying and Managing PowerPivot for SharePointDenny Lee
 
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
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DayTechMaster Vietnam
 
Building high performance
Building high performanceBuilding high performance
Building high performanceRoy Sheinfeld
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - IntroductionHandsOnWP.com
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기lanslote
 
Comsharepoint2013pdf
Comsharepoint2013pdfComsharepoint2013pdf
Comsharepoint2013pdfKamal Pandey
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.Andrey Oleynik
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSguest7c2e070
 
Session 7 - Integrating share point with silverlight firestarter
Session 7 - Integrating share point with silverlight firestarterSession 7 - Integrating share point with silverlight firestarter
Session 7 - Integrating share point with silverlight firestarterMithun T. Dhar
 

Similar to Understanding and programming the SharePoint REST API (20)

SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
 
Full Stack Developer
Full Stack DeveloperFull Stack Developer
Full Stack Developer
 
Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slides
 
Web api using rest based architecture
Web api using rest based architectureWeb api using rest based architecture
Web api using rest based architecture
 
Industrial training in .net
Industrial training in .netIndustrial training in .net
Industrial training in .net
 
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
 
Deploying and Managing PowerPivot for SharePoint
Deploying and Managing PowerPivot for SharePointDeploying and Managing PowerPivot for SharePoint
Deploying and Managing PowerPivot for SharePoint
 
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
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech Day
 
Oracle application framework (oaf) online training
Oracle application framework (oaf) online trainingOracle application framework (oaf) online training
Oracle application framework (oaf) online training
 
Building high performance
Building high performanceBuilding high performance
Building high performance
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - Introduction
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
 
Comsharepoint2013pdf
Comsharepoint2013pdfComsharepoint2013pdf
Comsharepoint2013pdf
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
Metaworks4 intro
Metaworks4 introMetaworks4 intro
Metaworks4 intro
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
 
Java UI Course Content
Java UI Course ContentJava UI Course Content
Java UI Course Content
 
06 web api
06 web api06 web api
06 web api
 
Session 7 - Integrating share point with silverlight firestarter
Session 7 - Integrating share point with silverlight firestarterSession 7 - Integrating share point with silverlight firestarter
Session 7 - Integrating share point with silverlight firestarter
 

Recently uploaded

Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 

Recently uploaded (20)

Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 

Understanding and programming the SharePoint REST API

  • 1. chris.beckett@obeflow.com www.obeflow.com (425) 522-3727 Enterprise Content Management and Business Process Automation Software as a Service Understanding and Programming the SharePoint REST API
  • 2. About Chris Beckett 24+10 MCM MCT MCSE MCPD Entrepreneur Solutions Architect Systems Engineer Trainer and Author chris.beckett@obeflow.com @sharepointbits blog.sharepointbits.com
  • 3. Agenda Introduction to SharePoint Web Services Working with REST and ODATA Services Programming with the REST API
  • 4. Agenda Introduction to SharePoint Web Services Working with REST and ODATA Services Programming with the REST API
  • 5. Available SharePoint Web Services • Open Standards • RPC Model • Protocol Agnostic • XML • Microsoft Proprietary • Batch RPC Model • Client Runtime • XML / JSON • Open Standards • REST Model • HTTP Only • ATOM / JSON SOAP Web Services (ASMX) Client Side Object Model (CSOM/JSOM) REST API (ODATA)
  • 6. SharePoint 2010 Web Service Access SOAP CSOM REST Lists and Libraries Site and List Settings Site Security Workflow Search Managed Metadata User Profiles Publishing
  • 7. SharePoint 2010 Web Service Clients SOAP CSOM REST JavaScript Silverlight .NET Windows Phone Other Languages InfoPath Receive InfoPath Submit BCS WCF Connector
  • 8. SharePoint 2013 Web Service Access SOAP CSOM REST Lists and Libraries Site and List Settings Site Security Workflow Search Managed Metadata User Profiles Publishing Deprecated
  • 9. SharePoint 2010 Web Service Clients SOAP CSOM REST JavaScript Silverlight .NET Windows Phone Other Languages InfoPath Receive InfoPath Submit BCS WCF Connector Deprecated
  • 10. What is SOAP? Created by Microsoft in 1998 / W3C Standard Protocol Agnostic / Common to use HTTP RPC Message Pattern (Request/Response) XML Schema used for Message Structures
  • 11. SharePoint Web Service Addresses Web Service Web Service Address Search http://<site>/_vti_bin/search.asmx User Profiles http://<site>/_vti_bin/userprofileservice.asmx Sites http://<site>/_vti_bin/sites.asmx Lists http://<site>/_vti_bin/lists.asmx Permissions http://<site>/_vti_bin/permissions.asmx Copy http://<site>/_vti_bin/copy.asmx 31 Public Web Services (25+6) in SharePoint
  • 12. SOAP Request Message Format SOAP Envelope SOAP Body Method and Parameters
  • 13. SOAP Considerations • All Versions of SharePoint • Ubiquitous • Protocol Agnostic • Language Agnostic • Access to Enterprise Services • Designed to work with Proxy • Not JavaScript Friendly • Verbose Xml Data • No Anonymous
  • 14. What is the CSOM? Proprietary Microsoft SharePoint Client API .NET / Silverlight / WP7 / ECMAScript Mimics Server-side Object Model Proprietary Message Transfer Format
  • 16. CSOM (.NET) Create a Context Load the Context Execute Query Access Properties
  • 17. CSOM Considerations • Efficient for Batch Operations • Familiar for SharePoint Developers • Supports LINQ Queries • Works with Anonymous • Less Efficient for Simple Operations • Unfamiliar to Web Developers • Limited # of Client Runtimes • Microsoft Proprietary
  • 18. What is REST? Representational State Transfer Web Addressable Resources / Hyperlink-able Maps CRUD operations with HTTP Verbs Commonly uses JSON for Data Messages
  • 19. Anatomy of a REST Call Request URLHTTP Method HTTP Body with Encoded DataHeaders
  • 20. HTTP Status Codes Status Code Description 200 OK The server successfully processed the request. 400 Bad Request The server didn't understand the request. 401 Unauthorized The request requires authentication. 404 Not Found The server can't find the requested page. 500 Internal Server Error The server encountered an error. Calling a web service requires checking the status code to validate success
  • 21. Data Encoding - ATOMPUB
  • 23. REST Considerations • Efficient for simple operations • Familiar to Web Developers • HTTP and open standards • Very JavaScript Friendly • Limited support for Anonymous • Complex for batch operations • Unfamiliar to SharePoint Developers • Requires knowledge of HTTP protocol and programming
  • 24. Anatomy of a REST Call  Using the List Data Service  Using the Client REST API  Data Encoding
  • 25. Agenda Introduction to SharePoint Web Services Working with REST and ODATA Services Programming with the REST API
  • 27. ODATA Operations and Parameters GET (Retrieve) POST (Create) PUT (Update All Fields) DELETE (Delete) MERGE (Update Specific) $filter={simple predicate} $expand={Entity} $order by={property} $skip={n} $top={n} $metadata Operations Parameters
  • 28. ODATA Query Operators Area Supported Not Supported Numeric Comparisons • Lt, Le • Gt, Ge • Eq, Ne • add, sub, mul, div, mod • round, floor, ceiling String Comparisons • startsWith • substringof • Eq • Ne • endsWith, trim • substring, replace, concat • tolower, toupper Date and Time Functions • day(), month(), year() • hour(), minute(), second() • DateTimeRangesOverlap
  • 29. Querying with ODATA  $Top and $Skip  $Filter  $Select  $OrderBy  $Expand
  • 30. Agenda Introduction to SharePoint Web Services Working with REST and ODATA Services Programming with the REST API
  • 31. Programming Tools / Platforms • C++ • C# • VB.NET • PHP • Java • Datajs • jQuery • Sencha Rest Connector • JayData • RequestExecutor Compiled Languages JavaScript Libraries
  • 32. List Data Service Access Points Area Access Point Lists http://server/site/_vti_bin/ListData.svc List http://server/site/_vti_bin/ListData.svc/Tasks
  • 33. Client REST Service Access Points Area Access Point Site http://server/site/_api/site Web http://server/site/_api/web Lists http://server/site/_api/web/lists List http://server/site/_api/web/lists/getbytitle(‘Tasks’) User Profile http://server/site/_api/SP.UserProfiles.PeopleManager Search http://server/site/_api/search Publishing http://server/site/_api/publishing
  • 35. List Data Service 2010 (ECMA Script)
  • 37. Calling SharePoint REST APIs  HTTP Verbs  Accept Headers  Authentication  eTags and Concurrency
  • 38. More Information Choose the Right API set with SharePoint 2013 http://msdn.microsoft.com/en-us/library/jj164060.aspx Complete Basic Operations with the SharePoint 2013 Client Library http://msdn.microsoft.com/en-us/library/fp179912.aspx Programming using the SharePoint 2013 REST Service http://msdn.microsoft.com/en-us/library/fp142385.aspx SharePoint 2010 Web Services http://msdn.microsoft.com/en-us/library/ee705814(v=office.14).aspx Accessing SharePoint 2010 Lists by Using WCF Data Services http://msdn.microsoft.com/en-us/library/hh134614(v=office.14).aspx
  • 39. Tools and Utilities LinqPad – Learn ODATA Queries with Linq http://www.linqpad.net/ RESTClient – Java Application for Testing REST Programming https://code.google.com/p/rest-client/ CAML Designer for SharePoint 2010 and 2013 http://sharepoint.biwug.be/SitePages/Caml_Designer.aspx Fiddler – HTTP Debugger http://www.fiddler2.com/fiddler2/ SharePoint 2013 Search Query Tool http://sp2013searchtool.codeplex.com/
  • 40. Questions Thank you for attending! Please complete your evaluations. Your feedback is appreciated  chris.beckett@obeflow.com (425) 522-3727 @sharepointbits blog.sharepointbits.com