SlideShare a Scribd company logo
1 of 37
Understanding the REST API of
SharePoint 2013
#SPSSTHLM17
Paolo Pialorsi – paolo@pialorsi.com
January 25th, 2014

SharePoint Saturday

Stockholm
Gold

SharePint

Bronze
Raffle
Agenda
_api is new alias for _vti_bin/client.svc
Server
Client

REST
OData
JSON

CSOM
JavaScript
Library

Silverlight
Library

Custom Client Code

.Net CLR
Library
Web Application Hostname

API Namespace

http(s)://{Host Name}/{site}/_api/{namespace}/

{object}
{property}
{indexer(index)}
{method({parameter},{parameter},…)}

Site Collection (Optional)
Operation
Operator

Description

Example

eq

Equal

/Suppliers?$filter=Address/City eq 'Redmond'

ne

Not equal

/Suppliers?$filter=Address/City ne 'London'

gt

Greater than

/Products?$filter=Price gt 20

ge

Greater than or equal

/Products?$filter=Price ge 10

lt

Less than

/Products?$filter=Price lt 20

le

Less than or equal

/Products?$filter=Price le 100

and

Logical and

/Products?$filter=Price le 200 and Price gt 3.5

or

Logical or

/Products?$filter=Price le 3.5 or Price gt 200

not

Logical negation

/Products?$filter=not endswith(Description,'milk')
Operator

Description

Example

add

Addition

/Products?$filter=Price add 5 gt 10

sub

Subtraction

/Products?$filter=Price sub 5 gt 10

mul

Multiplication

/Products?$filter=Price mul 2 gt 2000

div

Division

/Products?$filter=Price div 2 gt 4

mod

Modulo

/Products?$filter=Price mod 2 eq 0
Function

Description

bool substringof(string searchString, string searchInString)

Returns a boolean value stating if the value
provided in the first argument is a substring of substringof('Alfreds',CompanyName)
the second argument. Can be used as a
replacement for the contains method.

bool endswith(string string, string suffixString)

Returns a boolean value declaring if the string
endswith(CompanyName,'Futterkiste')
provided in the first argument ends with the
string provided in the second argument.

bool startswith(string string, string prefixString)

Returns a boolean value declaring if the string
provided in the first argument starts with the startswith(CompanyName,'Alfr')
string provided in the second argument.

int length(string string)

Returns an integer value representing the
length of the string provided as argument.

int indexof(string searchInString, string searchString)

string replace(string searchInString, string searchString, string
replaceString)
string substring(string string, int pos)

Example

length(CompanyName) eq 19

Returns an integer value representing the
index of the string provided in the second
indexof(CompanyName,'lfreds') eq 1
argument, which is searched within the string
provided in the first argument.
Replaces the string provided in the second
argument with the string provided in the third replace(CompanyName,' ', '') eq
'AlfredsFutterkiste'
argument, searching within the first string
argument.

Returns a substring of the string provided in
the first argument, starting from the integer
position provided in the second argument.

substring(CompanyName,1) eq 'lfreds
Futterkiste'
Function

Description

string substring(string string, int pos, int length)

Returns a substring of the string provided in
the first argument, starting from the integer
position provided in the second argument and substring(CompanyName,1, 2) eq 'lf'
stopping after a number of characters
provided in the third integer argument.

string tolower(string string)
string toupper(string string)

Returns a string that is the lowercase
conversion of the string provided as the string
argument
Returns a string that is the uppercase
conversion of the string provided as the string
argument

Example

tolower(CompanyName) eq 'alfreds
futterkiste'
tolower(CompanyName) eq 'alfreds
futterkiste'

string trim(string string)

Returns a string trimmed from spaces, based
on the string provided as argument.

trim(CompanyName) eq 'Alfreds Futterkiste'

string concat(string string1, string string2)

Returns a string that is the concatenation of
the two string arguments provided.

concat(concat(City,', '), Country) eq 'Berlin,
Germany'

int day(DateTime datetimeValue)
int hour(DateTime datetimeValue)
int minute(DateTime datetimeValue)
int month(DateTime datetimeValue)

Returns an integer that corresponds to the
day of the datetime value provided as
argument.
Returns an integer that corresponds to the
hours of the datetime value provided as
argument.
Returns an integer that corresponds to the
minutes of the datetime value provided as
argument.
Returns an integer that corresponds to the
month of the datetime value provided as
argument.

day(BirthDate) eq 8
hour(BirthDate) eq 1
minute(BirthDate) eq 0
month(BirthDate) eq 12
Function
int second(DateTime datetimeValue)
int year(DateTime datetimeValue)
double round(double doubleValue)
decimal round(decimal decimalValue)
double floor(double doubleValue)
decimal floor(decimal datetimeValue)
double ceiling(double doubleValue)
decimal ceiling(decimal datetimeValue)

Description
Returns an integer that corresponds to the
seconds of the datetime value provided as
argument.
Returns an integer that corresponds to the
year of the datetime value provided as
argument.
Returns a double number that is the rounded
value of the double value provided as
argument.
Returns a decimal number that is the rounded
value of the decimal value provided as
argument.
Returns a double number that is the floor
value of the double value provided as
argument.
Returns a decimal number that is the floor
value of the decimal value provided as
argument.
Returns a double number that is the ceiling
value of the double value provided as
argument.
Returns a decimal number that is the ceiling
value of the decimal value provided as
argument.

Example
second(BirthDate) eq 0
year(BirthDate) eq 1948
round(Freight) eq 32
round(Freight) eq 32
floor(Freight) eq 32
floor(Freight) eq 32
ceiling(Freight) eq 33
ceiling(Freight) eq 33

bool IsOf(type value)

Returns a boolean value stating if the target
entity is of the type provided as argument.

bool IsOf(expression value, type targetType)

Returns a boolean value stating if the
isof(ShipCountry,'Edm.String')
expression provided as the first argument, is
of the type provided as the second argument.

isof('NorthwindModel.Order')
http://devbook.sp2013.local/_api/web/lists/GetByTitle(Documents')/RootFol
der/Files?$expand=Author&$select=Name,Author,TimeLastModified&
$orderby=TimeLastModified%20desc,Name&$skip=20&$top=10&
$filter=substringof('Chapter',Name)%20eq%20true
Query Part

Explanation

$expand=Author

Expands the related object Author, while retrieving the documents.

$select=Name,Author,TimeLastModified

Retrieves the fields Name, Author, and TimeLastModified.

$sort=TimeLastModified desc,Name

Sorts the output descending by TimeLastModified, and ascending by
Name.

$skip=20

Skips the first 20 items of the resultset (i.e. the first two pages of 10
items).

$top=10

Retrieves only the first 10 items of the resultset (i.e. the third page of 10
items).

$filter= substringof('Chapter',Name) eq true

Retrieves only files with a file name that contains the literla "Chapter".
{

}

"d": {
"GetContextWebInformation": {
"__metadata": {
"type":"SP.ContextWebInformation"
},
"FormDigestTimeoutSeconds":1800,
"FormDigestValue":"0x8B48E76BAF6C86A17CCEC50F9A29E7CBB85816B883417C52C10C67
FB19760517B774CD71E43517635386DE585E92A0262779824E5E0C7ECA905436A048AC85AC,
08 Jan 2013 01:11:57 -0000",
"LibraryVersion":"15.0.4420.1017",
"SiteFullUrl":"http://devbook.sp2013.local",
"SupportedSchemaVersions": {
"results": [
"14.0.0.0",
"15.0.0.0"
]
},
"WebFullUrl":"http://devbook.sp2013.local"
}
}
SP.RequestExecutor.j
s

2) Emit IFrame

App Web

3) Download proxy page

IFrame

(AppWebProxy.ASPX)

6) Get data back to app

4) Make REST/CSOM call

5) Get response data

Host Web
jQuery.ajax({
url: "http://hostname/_api/contextinfo",
type: "POST",
headers: {
"Authorization": "Bearer " + accessToken,
"accept": "application/json;odata=verbose",
"contentType": "text/xml"
},
})
Understanding the REST API of SharePoint 2013

More Related Content

What's hot

7.9.1 sop pemberian nutrisi pada pasien rawat inap
7.9.1 sop pemberian nutrisi pada pasien rawat inap7.9.1 sop pemberian nutrisi pada pasien rawat inap
7.9.1 sop pemberian nutrisi pada pasien rawat inapmiftachussidiq
 
PPT Manajemen Pelayanan RS.pptx
PPT Manajemen Pelayanan RS.pptxPPT Manajemen Pelayanan RS.pptx
PPT Manajemen Pelayanan RS.pptxRokiAbdulMalik
 
SPO Komunikasi Efektif SBAR.docx
SPO Komunikasi Efektif SBAR.docxSPO Komunikasi Efektif SBAR.docx
SPO Komunikasi Efektif SBAR.docxTyanBagoes
 
ppt presentasi proposal KTI saya tentang gangguan sistem pencernaan : post op...
ppt presentasi proposal KTI saya tentang gangguan sistem pencernaan : post op...ppt presentasi proposal KTI saya tentang gangguan sistem pencernaan : post op...
ppt presentasi proposal KTI saya tentang gangguan sistem pencernaan : post op...Faris Andrianto
 
Pengadaan customer service dan inovasi pendaftaran online ppt
Pengadaan customer service dan inovasi pendaftaran online pptPengadaan customer service dan inovasi pendaftaran online ppt
Pengadaan customer service dan inovasi pendaftaran online pptAry Syairi
 
SOP PERSIAPAN RUJUKAN.doc
SOP PERSIAPAN RUJUKAN.docSOP PERSIAPAN RUJUKAN.doc
SOP PERSIAPAN RUJUKAN.docdayderby
 
Bab 3 UKP.pdf
Bab 3 UKP.pdfBab 3 UKP.pdf
Bab 3 UKP.pdfTriasMego
 
RESOSIALISASI KOMITE DAN POKJA SKP-1 (1).pptx
RESOSIALISASI KOMITE DAN POKJA SKP-1 (1).pptxRESOSIALISASI KOMITE DAN POKJA SKP-1 (1).pptx
RESOSIALISASI KOMITE DAN POKJA SKP-1 (1).pptxWihelminaKurniyati1
 
Penyediaan Air Bersih
Penyediaan Air BersihPenyediaan Air Bersih
Penyediaan Air Bersihnesyaazzura
 
Penyelenggaraan Kesehatan Haji
Penyelenggaraan Kesehatan HajiPenyelenggaraan Kesehatan Haji
Penyelenggaraan Kesehatan Hajipjj_kemenkes
 
Complain Handling Rumah Sakit.pptx
Complain Handling Rumah Sakit.pptxComplain Handling Rumah Sakit.pptx
Complain Handling Rumah Sakit.pptxMoch Adieb SUltan
 
MONITORING EVALUASI PELAKSANAAN PENGATURAN (1).docx
MONITORING EVALUASI PELAKSANAAN PENGATURAN (1).docxMONITORING EVALUASI PELAKSANAAN PENGATURAN (1).docx
MONITORING EVALUASI PELAKSANAAN PENGATURAN (1).docxSintyaAriska
 
Makalah SOP/ Protap Pelayanan di Puskesmas / RS
Makalah SOP/ Protap Pelayanan di Puskesmas / RSMakalah SOP/ Protap Pelayanan di Puskesmas / RS
Makalah SOP/ Protap Pelayanan di Puskesmas / RSPENDIDIKAN & KESEHATAN
 
Discharge planning pada pasien pp
Discharge planning pada pasien ppDischarge planning pada pasien pp
Discharge planning pada pasien ppsri syla
 
Sop pemulangan pasien
Sop pemulangan pasienSop pemulangan pasien
Sop pemulangan pasienasthuty
 
Implementasi program-gizi-pertemuan-8
Implementasi program-gizi-pertemuan-8Implementasi program-gizi-pertemuan-8
Implementasi program-gizi-pertemuan-8Kumpulan Paper
 

What's hot (20)

7.9.1 sop pemberian nutrisi pada pasien rawat inap
7.9.1 sop pemberian nutrisi pada pasien rawat inap7.9.1 sop pemberian nutrisi pada pasien rawat inap
7.9.1 sop pemberian nutrisi pada pasien rawat inap
 
PPT Manajemen Pelayanan RS.pptx
PPT Manajemen Pelayanan RS.pptxPPT Manajemen Pelayanan RS.pptx
PPT Manajemen Pelayanan RS.pptx
 
Laporan pendahuluan
Laporan pendahuluanLaporan pendahuluan
Laporan pendahuluan
 
SPO Komunikasi Efektif SBAR.docx
SPO Komunikasi Efektif SBAR.docxSPO Komunikasi Efektif SBAR.docx
SPO Komunikasi Efektif SBAR.docx
 
ppt presentasi proposal KTI saya tentang gangguan sistem pencernaan : post op...
ppt presentasi proposal KTI saya tentang gangguan sistem pencernaan : post op...ppt presentasi proposal KTI saya tentang gangguan sistem pencernaan : post op...
ppt presentasi proposal KTI saya tentang gangguan sistem pencernaan : post op...
 
Pengadaan customer service dan inovasi pendaftaran online ppt
Pengadaan customer service dan inovasi pendaftaran online pptPengadaan customer service dan inovasi pendaftaran online ppt
Pengadaan customer service dan inovasi pendaftaran online ppt
 
SOP PERSIAPAN RUJUKAN.doc
SOP PERSIAPAN RUJUKAN.docSOP PERSIAPAN RUJUKAN.doc
SOP PERSIAPAN RUJUKAN.doc
 
Bab 3 UKP.pdf
Bab 3 UKP.pdfBab 3 UKP.pdf
Bab 3 UKP.pdf
 
RESOSIALISASI KOMITE DAN POKJA SKP-1 (1).pptx
RESOSIALISASI KOMITE DAN POKJA SKP-1 (1).pptxRESOSIALISASI KOMITE DAN POKJA SKP-1 (1).pptx
RESOSIALISASI KOMITE DAN POKJA SKP-1 (1).pptx
 
1.3 sop gizi buruk
1.3 sop gizi buruk1.3 sop gizi buruk
1.3 sop gizi buruk
 
Penyediaan Air Bersih
Penyediaan Air BersihPenyediaan Air Bersih
Penyediaan Air Bersih
 
Juknis mantis #2.pdf
Juknis mantis #2.pdfJuknis mantis #2.pdf
Juknis mantis #2.pdf
 
Penyelenggaraan Kesehatan Haji
Penyelenggaraan Kesehatan HajiPenyelenggaraan Kesehatan Haji
Penyelenggaraan Kesehatan Haji
 
Complain Handling Rumah Sakit.pptx
Complain Handling Rumah Sakit.pptxComplain Handling Rumah Sakit.pptx
Complain Handling Rumah Sakit.pptx
 
MONITORING EVALUASI PELAKSANAAN PENGATURAN (1).docx
MONITORING EVALUASI PELAKSANAAN PENGATURAN (1).docxMONITORING EVALUASI PELAKSANAAN PENGATURAN (1).docx
MONITORING EVALUASI PELAKSANAAN PENGATURAN (1).docx
 
Makalah SOP/ Protap Pelayanan di Puskesmas / RS
Makalah SOP/ Protap Pelayanan di Puskesmas / RSMakalah SOP/ Protap Pelayanan di Puskesmas / RS
Makalah SOP/ Protap Pelayanan di Puskesmas / RS
 
Discharge planning pada pasien pp
Discharge planning pada pasien ppDischarge planning pada pasien pp
Discharge planning pada pasien pp
 
Restraint
RestraintRestraint
Restraint
 
Sop pemulangan pasien
Sop pemulangan pasienSop pemulangan pasien
Sop pemulangan pasien
 
Implementasi program-gizi-pertemuan-8
Implementasi program-gizi-pertemuan-8Implementasi program-gizi-pertemuan-8
Implementasi program-gizi-pertemuan-8
 

Viewers also liked

Taking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APITaking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APIEric Shupps
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIsGiuseppe Marchi
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIsJohn Calvert
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APISparkhound Inc.
 
SharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricksSharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricksGiuseppe Marchi
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIChris Beckett
 
Getting Started With SharePoint REST API in Nintex Workflows for Office 365 I...
Getting Started With SharePoint REST API in Nintex Workflows for Office 365 I...Getting Started With SharePoint REST API in Nintex Workflows for Office 365 I...
Getting Started With SharePoint REST API in Nintex Workflows for Office 365 I...Prashant G Bhoyar (Microsoft MVP)
 
SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationAdil Ansari
 
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
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to BootstrapRon Reiter
 

Viewers also liked (10)

Taking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APITaking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST API
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIs
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST API
 
SharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricksSharePoint 2013 REST API tips & tricks
SharePoint 2013 REST API tips & tricks
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST API
 
Getting Started With SharePoint REST API in Nintex Workflows for Office 365 I...
Getting Started With SharePoint REST API in Nintex Workflows for Office 365 I...Getting Started With SharePoint REST API in Nintex Workflows for Office 365 I...
Getting Started With SharePoint REST API in Nintex Workflows for Office 365 I...
 
SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote Authentication
 
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
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 

Similar to Understanding the REST API of SharePoint 2013

Strings Arrays
Strings ArraysStrings Arrays
Strings Arraysphanleson
 
Python Programming Basics for begginners
Python Programming Basics for begginnersPython Programming Basics for begginners
Python Programming Basics for begginnersAbishek Purushothaman
 
Finite Systems Handling Language (YAFOLL message 1)
Finite Systems Handling Language (YAFOLL message 1)Finite Systems Handling Language (YAFOLL message 1)
Finite Systems Handling Language (YAFOLL message 1)Alex Shkotin
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressionsKrishna Nanda
 
EmberConf 2021 - Crossfile Codemodding with Joshua Lawrence
EmberConf 2021 - Crossfile Codemodding with Joshua LawrenceEmberConf 2021 - Crossfile Codemodding with Joshua Lawrence
EmberConf 2021 - Crossfile Codemodding with Joshua LawrenceJoshua Lawrence
 
JavaScript – ECMAScript Basics By Satyen
JavaScript – ECMAScript Basics By SatyenJavaScript – ECMAScript Basics By Satyen
JavaScript – ECMAScript Basics By SatyenSatyen Pandya
 
Naïveté vs. Experience
Naïveté vs. ExperienceNaïveté vs. Experience
Naïveté vs. ExperienceMike Fogus
 
String and string buffer
String and string bufferString and string buffer
String and string bufferkamal kotecha
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshopBAINIDA
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat SheetHortonworks
 
Perl and Haskell: Can the Twain Ever Meet? (tl;dr: yes)
Perl and Haskell: Can the Twain Ever Meet? (tl;dr: yes)Perl and Haskell: Can the Twain Ever Meet? (tl;dr: yes)
Perl and Haskell: Can the Twain Ever Meet? (tl;dr: yes)Wim Vanderbauwhede
 

Similar to Understanding the REST API of SharePoint 2013 (20)

Computer programming 2 Lesson 10
Computer programming 2  Lesson 10Computer programming 2  Lesson 10
Computer programming 2 Lesson 10
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
Variables In Php 1
Variables In Php 1Variables In Php 1
Variables In Php 1
 
Strings Arrays
Strings ArraysStrings Arrays
Strings Arrays
 
vbscripting
vbscriptingvbscripting
vbscripting
 
Python Programming Basics for begginners
Python Programming Basics for begginnersPython Programming Basics for begginners
Python Programming Basics for begginners
 
Finite Systems Handling Language (YAFOLL message 1)
Finite Systems Handling Language (YAFOLL message 1)Finite Systems Handling Language (YAFOLL message 1)
Finite Systems Handling Language (YAFOLL message 1)
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressions
 
EmberConf 2021 - Crossfile Codemodding with Joshua Lawrence
EmberConf 2021 - Crossfile Codemodding with Joshua LawrenceEmberConf 2021 - Crossfile Codemodding with Joshua Lawrence
EmberConf 2021 - Crossfile Codemodding with Joshua Lawrence
 
JavaScript – ECMAScript Basics By Satyen
JavaScript – ECMAScript Basics By SatyenJavaScript – ECMAScript Basics By Satyen
JavaScript – ECMAScript Basics By Satyen
 
Naïveté vs. Experience
Naïveté vs. ExperienceNaïveté vs. Experience
Naïveté vs. Experience
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
Ch2
Ch2Ch2
Ch2
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat Sheet
 
Chapter 6 Intermediate Code Generation
Chapter 6   Intermediate Code GenerationChapter 6   Intermediate Code Generation
Chapter 6 Intermediate Code Generation
 
M C6java7
M C6java7M C6java7
M C6java7
 
Computer programming 2 Lesson 12
Computer programming 2  Lesson 12Computer programming 2  Lesson 12
Computer programming 2 Lesson 12
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
 
Perl and Haskell: Can the Twain Ever Meet? (tl;dr: yes)
Perl and Haskell: Can the Twain Ever Meet? (tl;dr: yes)Perl and Haskell: Can the Twain Ever Meet? (tl;dr: yes)
Perl and Haskell: Can the Twain Ever Meet? (tl;dr: yes)
 

Recently uploaded

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Recently uploaded (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Understanding the REST API of SharePoint 2013

  • 1. Understanding the REST API of SharePoint 2013 #SPSSTHLM17 Paolo Pialorsi – paolo@pialorsi.com January 25th, 2014 SharePoint Saturday Stockholm
  • 3.
  • 5.
  • 6. _api is new alias for _vti_bin/client.svc Server Client REST OData JSON CSOM JavaScript Library Silverlight Library Custom Client Code .Net CLR Library
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Web Application Hostname API Namespace http(s)://{Host Name}/{site}/_api/{namespace}/ {object} {property} {indexer(index)} {method({parameter},{parameter},…)} Site Collection (Optional) Operation
  • 14.
  • 15.
  • 16.
  • 17. Operator Description Example eq Equal /Suppliers?$filter=Address/City eq 'Redmond' ne Not equal /Suppliers?$filter=Address/City ne 'London' gt Greater than /Products?$filter=Price gt 20 ge Greater than or equal /Products?$filter=Price ge 10 lt Less than /Products?$filter=Price lt 20 le Less than or equal /Products?$filter=Price le 100 and Logical and /Products?$filter=Price le 200 and Price gt 3.5 or Logical or /Products?$filter=Price le 3.5 or Price gt 200 not Logical negation /Products?$filter=not endswith(Description,'milk')
  • 18. Operator Description Example add Addition /Products?$filter=Price add 5 gt 10 sub Subtraction /Products?$filter=Price sub 5 gt 10 mul Multiplication /Products?$filter=Price mul 2 gt 2000 div Division /Products?$filter=Price div 2 gt 4 mod Modulo /Products?$filter=Price mod 2 eq 0
  • 19. Function Description bool substringof(string searchString, string searchInString) Returns a boolean value stating if the value provided in the first argument is a substring of substringof('Alfreds',CompanyName) the second argument. Can be used as a replacement for the contains method. bool endswith(string string, string suffixString) Returns a boolean value declaring if the string endswith(CompanyName,'Futterkiste') provided in the first argument ends with the string provided in the second argument. bool startswith(string string, string prefixString) Returns a boolean value declaring if the string provided in the first argument starts with the startswith(CompanyName,'Alfr') string provided in the second argument. int length(string string) Returns an integer value representing the length of the string provided as argument. int indexof(string searchInString, string searchString) string replace(string searchInString, string searchString, string replaceString) string substring(string string, int pos) Example length(CompanyName) eq 19 Returns an integer value representing the index of the string provided in the second indexof(CompanyName,'lfreds') eq 1 argument, which is searched within the string provided in the first argument. Replaces the string provided in the second argument with the string provided in the third replace(CompanyName,' ', '') eq 'AlfredsFutterkiste' argument, searching within the first string argument. Returns a substring of the string provided in the first argument, starting from the integer position provided in the second argument. substring(CompanyName,1) eq 'lfreds Futterkiste'
  • 20. Function Description string substring(string string, int pos, int length) Returns a substring of the string provided in the first argument, starting from the integer position provided in the second argument and substring(CompanyName,1, 2) eq 'lf' stopping after a number of characters provided in the third integer argument. string tolower(string string) string toupper(string string) Returns a string that is the lowercase conversion of the string provided as the string argument Returns a string that is the uppercase conversion of the string provided as the string argument Example tolower(CompanyName) eq 'alfreds futterkiste' tolower(CompanyName) eq 'alfreds futterkiste' string trim(string string) Returns a string trimmed from spaces, based on the string provided as argument. trim(CompanyName) eq 'Alfreds Futterkiste' string concat(string string1, string string2) Returns a string that is the concatenation of the two string arguments provided. concat(concat(City,', '), Country) eq 'Berlin, Germany' int day(DateTime datetimeValue) int hour(DateTime datetimeValue) int minute(DateTime datetimeValue) int month(DateTime datetimeValue) Returns an integer that corresponds to the day of the datetime value provided as argument. Returns an integer that corresponds to the hours of the datetime value provided as argument. Returns an integer that corresponds to the minutes of the datetime value provided as argument. Returns an integer that corresponds to the month of the datetime value provided as argument. day(BirthDate) eq 8 hour(BirthDate) eq 1 minute(BirthDate) eq 0 month(BirthDate) eq 12
  • 21. Function int second(DateTime datetimeValue) int year(DateTime datetimeValue) double round(double doubleValue) decimal round(decimal decimalValue) double floor(double doubleValue) decimal floor(decimal datetimeValue) double ceiling(double doubleValue) decimal ceiling(decimal datetimeValue) Description Returns an integer that corresponds to the seconds of the datetime value provided as argument. Returns an integer that corresponds to the year of the datetime value provided as argument. Returns a double number that is the rounded value of the double value provided as argument. Returns a decimal number that is the rounded value of the decimal value provided as argument. Returns a double number that is the floor value of the double value provided as argument. Returns a decimal number that is the floor value of the decimal value provided as argument. Returns a double number that is the ceiling value of the double value provided as argument. Returns a decimal number that is the ceiling value of the decimal value provided as argument. Example second(BirthDate) eq 0 year(BirthDate) eq 1948 round(Freight) eq 32 round(Freight) eq 32 floor(Freight) eq 32 floor(Freight) eq 32 ceiling(Freight) eq 33 ceiling(Freight) eq 33 bool IsOf(type value) Returns a boolean value stating if the target entity is of the type provided as argument. bool IsOf(expression value, type targetType) Returns a boolean value stating if the isof(ShipCountry,'Edm.String') expression provided as the first argument, is of the type provided as the second argument. isof('NorthwindModel.Order')
  • 22.
  • 23. http://devbook.sp2013.local/_api/web/lists/GetByTitle(Documents')/RootFol der/Files?$expand=Author&$select=Name,Author,TimeLastModified& $orderby=TimeLastModified%20desc,Name&$skip=20&$top=10& $filter=substringof('Chapter',Name)%20eq%20true Query Part Explanation $expand=Author Expands the related object Author, while retrieving the documents. $select=Name,Author,TimeLastModified Retrieves the fields Name, Author, and TimeLastModified. $sort=TimeLastModified desc,Name Sorts the output descending by TimeLastModified, and ascending by Name. $skip=20 Skips the first 20 items of the resultset (i.e. the first two pages of 10 items). $top=10 Retrieves only the first 10 items of the resultset (i.e. the third page of 10 items). $filter= substringof('Chapter',Name) eq true Retrieves only files with a file name that contains the literla "Chapter".
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. { } "d": { "GetContextWebInformation": { "__metadata": { "type":"SP.ContextWebInformation" }, "FormDigestTimeoutSeconds":1800, "FormDigestValue":"0x8B48E76BAF6C86A17CCEC50F9A29E7CBB85816B883417C52C10C67 FB19760517B774CD71E43517635386DE585E92A0262779824E5E0C7ECA905436A048AC85AC, 08 Jan 2013 01:11:57 -0000", "LibraryVersion":"15.0.4420.1017", "SiteFullUrl":"http://devbook.sp2013.local", "SupportedSchemaVersions": { "results": [ "14.0.0.0", "15.0.0.0" ] }, "WebFullUrl":"http://devbook.sp2013.local" } }
  • 29.
  • 30.
  • 31.
  • 32. SP.RequestExecutor.j s 2) Emit IFrame App Web 3) Download proxy page IFrame (AppWebProxy.ASPX) 6) Get data back to app 4) Make REST/CSOM call 5) Get response data Host Web
  • 33.
  • 34.
  • 35.
  • 36. jQuery.ajax({ url: "http://hostname/_api/contextinfo", type: "POST", headers: { "Authorization": "Bearer " + accessToken, "accept": "application/json;odata=verbose", "contentType": "text/xml" }, })