SharePoint 2013 has extended the REST interface to provide easy access to data within your SharePoint farm. The REST interface opens the SharePoint 2013 development platform to standard Web technologies and languages. This presentation will cover the basics of getting started with the REST service and provide beneficial examples of using REST.
2. 2
About Me
SharePoint Solutions Architect at Sparkhound
in Baton Rouge
http://www.sparkhound.com/pages/blogs.asp
x
@codygros
Leader of the Baton Rouge SharePoint User
Group â www.brspug.com
4. 4
REST Introduction
REST = REpresentational State Transfer
A simpler alternative to SOAP based on HTTP
request/response pairs
Client sends HTTP requests that target specific
resources using unique URIs
5. 5
What is OData?
Odata is a standardized REST API for Data
Access
ODATA API maps CRUD operations to
HTTP verbs
http://www.odata.org
6. 6
HTTP Methods
GET
Returns an item or array of items
POST
Creates a new item
PUT
Updates an item (replaces all fields with default values)
PATCH or MERGE
Updates an item in place (existing values are retained)
DELETE
Deletes an item
7. 7
OData URIs
URI has three parts
Service root URI
Resource path
Query string options
Service Root URI Resource Path to a SharePoint Object Query String Options
8. 8
OData Query Option Parameters
$select
Specifies which columns to retrieve
$filter
Selecting what items to retrieve
$orderby
Sorting items
$expand
Retrieve results that are usually deferred
$top
Select how many items to return
$skip
Selecting which row to start at
11. 11
Request Headers
Accept
what type of data you want to receive
Content-type
What type of data you are sending in the request
body
X-HTTP-Method
Which operation to perform
X-RequestDigest
Encrypted security value required for updates
IF-MATCH
Passes Etag value to control optimistic
concurrency
12. 12
AJAX Calls
$.ajax() function is part of the core jQuery library
URI end point
Accept header: application/json;odata=verbose
13. 13
Request Digest
Provides security mechanism to protect against
replay attacks
SharePoint pages has element with ID
__REQUESTDIGEST
Passed in request by using X-RequestDigest
header
<site url>/_api/contextinfo
14. 14
Creating / Updating
You must include item type metadata for inserts
& updates
All write operations must pass valid request
digest value
15. 15
List Item Type Metadata
Each SharePoint list has a unique type for its
list items
String based type value must be passed will all
inserts and updates
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
Patch Odata V3
Merge Odata V2
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
SLIDE PURPOSE: This is where everything starts â us defining with our customers how we can make an impact in their business regardless of the technology!
SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.