SlideShare a Scribd company logo
Webinar Series: Getting Started with SharePoint Framework
Getting Started with
SharePoint Framework
Webinar Series
Webinar Series: Getting Started with SharePoint Framework
Loading SharePoint Data
in a SPFx web part
Webinar Series: Getting Started with SharePoint Framework
Jenkins NS
Modern Workplace Solution Architect | Consultant
Founder & Director @
Microsoft Teams, Power Platform and SPFx Specialist
International Speaker | Blogger | Trainer
SPS Bangalore Organizer
aOS Ambassador
@jenkinsns
https://www.facebook.com/msteamsinfo
in/jenkinsns
jenkinsns@gmail.com
http://www.jenkinsblogs.com
jenkinsns
https://www.facebook.com/spfxinfo/
Webinar Series: Getting Started with SharePoint Framework
Agenda
Page Context
Web Services Overview
SharePoint REST API’s
Using HttpClient
Loading SharePoint data
Demo
- Using No JavaScript Framework
- Using React
Webinar Series: Getting Started with SharePoint Framework
Page Context
• The page context provides standard definitions for common SharePoint objects that need to be shared between the client-side
application, web parts, and other components. Typically the data is fetched via REST queries when navigating to a new page, but it can
also be preloaded by the web server or filled from a custom application cache.
 Provides access to information about current context
 Greatly extended version of _spPageContextinfo
Property Description
aadInfo If the current page doesn't have an associated Azure Active Directory tenant, this property will be undefined
cultureInfo It provides culture info for the current user of the application
isInitialized Returns whether the PageContext has been initialized
list Contextual information for the SharePoint list that is hosting the page. If there is no list associated to the current page, this property
will be undefined
listItem Contextual information for the SharePoint list item that is hosting the page. If there is no list item associated to the current page, this
property will be undefined
site Contextual information for the SharePoint site collection ("SPSite") that is hosting the page.
user It provides contextual information for the SharePoint user that is accessing the page. This class is primarily used with the
PageContext class.
web Contextual information for the SharePoint site ("SPWeb") that is hosting the page.
Webinar Series: Getting Started with SharePoint Framework
Page Context …
Examples
import { SPPermission } from '@microsoft/sp-page-context’;
 this.context.pageContext.web.absoluteUrl
 this.context.pageContext.web.permissions.hasAllPermissions(SPPermission.fullMask);
 hasAllPermissions : Checks if the user has all the permissions
 this.context.pageContext.web.permissions.hasAnyPermissions(SPPermission.manageWeb);
 hasAnyPermissions: Checks if the user has any permission from the collection of permissions
 this.context.pageContext.web.permissions.hasPermission(SPPermission.viewPages);
 has Permission: Checks if the user has given permission
Webinar Series: Getting Started with SharePoint Framework
Web Services Overview
Scenario: Customer is having existing web service which is developed into
ASP.NET. Currently, we need to develop SPFx web part for SharePoint
application. We want to fetch some information using this web service and
need to populate into this webpart.
How is authentication handled in the ASP.NET web service?
Answer: By using the AadHttpClient, you can easily connect to APIs secured
by using Azure AD without having to implement the OAuth flow yourself
 Developers building client-side solutions are responsible for implementing
authorization by using the OAuth implicit flow in their application. In
SharePoint Framework solutions, that's already done as part of the
framework through MSGraphClient and AadHttpClient, both of which are
introduced in SharePoint Framework v1.4.1.
 Note : If you build solutions on a version of the SharePoint Framework
earlier than v1.4.1, you can still connect to resources secured with Azure
AD. In this case, you need to implement the OAuth implicit flow by using
ADAL JS.
Webinar Series: Getting Started with SharePoint Framework
SharePoint REST API’s
 SharePoint includes a Representational State Transfer (REST) service that is comparable to the
existing SharePoint client object models. Developers can interact remotely with SharePoint data
by using any technology that supports REST web requests. This means that developers can
perform Create, Read, Update, and Delete (CRUD) operations from their SharePoint Add-ins,
solutions, and client applications, using REST web technologies and standard Open Data
Protocol (OData) syntax.
 To access SharePoint resources using REST, construct a RESTful HTTP request by using the
OData standard, which corresponds to the desired client object model API.
 https://{site_url}/_api/web
 https://{site_url}/_api/site
 Example
 https://jpower4dev.sharepoint.com/_api/web/lists/GetByTitle('Contactlist')/Items
URL end Points – Some exaples Description
web/title Retrieves the title of a list
Lists Retrieves all lists on a site
lists/getbytitle('listname') Retrieves a single list's metadata
lists/getbytitle('listname')/items Retrieves items within a list
lists/getbytitle('listname')?select=Title Retrieves a specific property of a document
Webinar Series: Getting Started with SharePoint Framework
Using HttpClient
 HttpClient implements a basic set of features for performing REST operations against a generic service.
 import { HttpClient, IHttpClientOptions, HttpClientResponse } from '@microsoft/sp-http’
 If you already used the HttpClient and SPHttpClient in your SharePoint Framework projects, you might have noticed that you have two types of request methods options:
GET and POST. These two types of requests are the most used ones, but what if you want to use other HTTP methods like PUT, PATCH, DELETE?
 If you need to make calls with other HTTP methods, you can make use of the fetch which is available on both the HttpClient and SPHttpClient classes. The fetch method
allows you to specify the HTTP method type per request yourself. Fetch is also used behind the scenes when you are using the GET and POST methods.
1. how you can make use of the fetch method and specifying the request method to perform: spHttpClient
this.props.context.spHttpClient.fetch(restUrl, SPHttpClient.configurations.v1, {
method: "PATCH",
body: JSON.stringify({
"Something": "Some content to patch" })
}).then((response: SPHttpClientResponse) => { // Do your thing});
2. with the HttpClient, but you will notice that is not that different to use:
this.props.context.httpClient.fetch(restUrl, HttpClient.configurations.v1,
{ method: "DELETE"})
.then((response: HttpClientResponse) => { // Do your thing
});zax
Webinar Series: Getting Started with SharePoint Framework
Loading SharePoint data
 SharePoint Framework is the new development model and it is a page and Web part model which provides full support for client-side SharePoint development,
easy integration with SharePoint data, and support for open-source tooling.
Standard “features” of SPFx
 ToolchainAuthenticationSP
 GraphAPI and WebAPI Access
 CDN hosting
 Config experience
 Solution hosting
 Component is able to get the right application context
 Tenant-wide Deployment
Webinar Series: Getting Started with SharePoint Framework
Demo
https://github.com/jenkinsns/spfx-demo-webparts
Download the code
Webinar Series: Getting Started with SharePoint Framework
References…
 http://jenkinsblogs.com/2016/08/24/create-a-sharepoint-framework-client-webpart-retrive-list-items/
 https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part
 https://www.youtube.com/channel/UC4JieFHDrN0elIYtZDktZSg
 https://www.youtube.com/channel/UC_mKdhw-V6CeCM7gTo_Iy7w
Webinar Series: Getting Started with SharePoint Framework
Thank You
Webinar Series: Getting Started with SharePoint Framework
Next up…
SPFx with React
Siddharth Vaghasia

More Related Content

What's hot (20)

PPTX
SharePoint 2010 Application Development Overview
Rob Windsor
 
PPTX
ASP.NET Web API
habib_786
 
PPTX
40+ tips to use Postman more efficiently
postmanclient
 
PPTX
Introduction to the SharePoint 2013 REST API
Sparkhound Inc.
 
PPTX
Overview of RESTful web services
nbuddharaju
 
PPTX
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote
 
PPTX
An introduction to consuming remote APIs with Drupal 7
Josh Kopel
 
PPTX
Advanced SharePoint Web Part Development
Rob Windsor
 
PPTX
Data Access Options in SharePoint 2010
Rob Windsor
 
KEY
CakePHP REST Plugin
Kevin van Zonneveld
 
PPT
Understanding REST
Nitin Pande
 
PDF
Progressive EPiServer Development
joelabrahamsson
 
PPTX
EPiServer Deployment Tips & Tricks
EPiServer Meetup Oslo
 
PPTX
Automated Testing Of EPiServer CMS Sites
joelabrahamsson
 
PPTX
Implementation advantages of rest
Balamurugan Easwaran
 
PPTX
ASP.NET Mvc 4 web api
Tiago Knoch
 
PPTX
The Full Power of ASP.NET Web API
Eyal Vardi
 
PDF
The never-ending REST API design debate
Restlet
 
PPTX
Introduction to SharePoint 2013 REST API
QUONTRASOLUTIONS
 
PPTX
Understanding and programming the SharePoint REST API
Chris Beckett
 
SharePoint 2010 Application Development Overview
Rob Windsor
 
ASP.NET Web API
habib_786
 
40+ tips to use Postman more efficiently
postmanclient
 
Introduction to the SharePoint 2013 REST API
Sparkhound Inc.
 
Overview of RESTful web services
nbuddharaju
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote
 
An introduction to consuming remote APIs with Drupal 7
Josh Kopel
 
Advanced SharePoint Web Part Development
Rob Windsor
 
Data Access Options in SharePoint 2010
Rob Windsor
 
CakePHP REST Plugin
Kevin van Zonneveld
 
Understanding REST
Nitin Pande
 
Progressive EPiServer Development
joelabrahamsson
 
EPiServer Deployment Tips & Tricks
EPiServer Meetup Oslo
 
Automated Testing Of EPiServer CMS Sites
joelabrahamsson
 
Implementation advantages of rest
Balamurugan Easwaran
 
ASP.NET Mvc 4 web api
Tiago Knoch
 
The Full Power of ASP.NET Web API
Eyal Vardi
 
The never-ending REST API design debate
Restlet
 
Introduction to SharePoint 2013 REST API
QUONTRASOLUTIONS
 
Understanding and programming the SharePoint REST API
Chris Beckett
 

Similar to SPFx Webinar Loading SharePoint data in a SPFx Webpart (20)

PPTX
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
Jenkins NS
 
PPTX
APIs, APIs Everywhere!
BIWUG
 
PPTX
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
Sébastien Levert
 
PPTX
Sps mad2018 joel rodrigues - pn-p reusable controls and pnpjs
Joel Rodrigues
 
PPTX
SharePoint Conference 2018 - APIs, APIs everywhere!
Sébastien Levert
 
PPTX
#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX
Vincent Biret
 
PPTX
SharePoint Saturday Vienna Slides
David Opdendries
 
PPTX
The Greatest Introduction to SharePoint Framework (SPFx) on earth!
Małgorzata Borzęcka
 
PPTX
SharePoint Object Model, Web Services and Events
Mohan Arumugam
 
PDF
Leveraging APIs from SharePoint Framework solutions
Dragan Panjkov
 
PPTX
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
European Collaboration Summit
 
PPTX
Introduction to SharePoint Framework
Małgorzata Borzęcka
 
PPTX
#SPSToronto 2018 migrate you custom development to the SharePoint Framework
Vincent Biret
 
PPTX
Developing SharePoint Framework Solutions for the Enterprise - SEF 2019
Eric Shupps
 
PPTX
Spsbcn2018 joel rodrigues - pn p reusable controls and pnpjs
Joel Rodrigues
 
PPTX
SPS Bremen 2020 The happy developer - SharePoint Framework - React - Mindfulness
Olli Jääskeläinen
 
PPTX
Create the Modern Workplace with the SharePoint Framework
SharePoint Patterns and Practices
 
PPTX
#SPSOttawa 2017 migrate to the #SharePoint Framework #spfx
Vincent Biret
 
PDF
Navigating SharePoint Integration: From Seamless Configuration to Workflow Au...
Safe Software
 
PDF
Real World SharePoint Framework and Azure Services
Brian Culver
 
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
Jenkins NS
 
APIs, APIs Everywhere!
BIWUG
 
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
Sébastien Levert
 
Sps mad2018 joel rodrigues - pn-p reusable controls and pnpjs
Joel Rodrigues
 
SharePoint Conference 2018 - APIs, APIs everywhere!
Sébastien Levert
 
#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX
Vincent Biret
 
SharePoint Saturday Vienna Slides
David Opdendries
 
The Greatest Introduction to SharePoint Framework (SPFx) on earth!
Małgorzata Borzęcka
 
SharePoint Object Model, Web Services and Events
Mohan Arumugam
 
Leveraging APIs from SharePoint Framework solutions
Dragan Panjkov
 
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
European Collaboration Summit
 
Introduction to SharePoint Framework
Małgorzata Borzęcka
 
#SPSToronto 2018 migrate you custom development to the SharePoint Framework
Vincent Biret
 
Developing SharePoint Framework Solutions for the Enterprise - SEF 2019
Eric Shupps
 
Spsbcn2018 joel rodrigues - pn p reusable controls and pnpjs
Joel Rodrigues
 
SPS Bremen 2020 The happy developer - SharePoint Framework - React - Mindfulness
Olli Jääskeläinen
 
Create the Modern Workplace with the SharePoint Framework
SharePoint Patterns and Practices
 
#SPSOttawa 2017 migrate to the #SharePoint Framework #spfx
Vincent Biret
 
Navigating SharePoint Integration: From Seamless Configuration to Workflow Au...
Safe Software
 
Real World SharePoint Framework and Azure Services
Brian Culver
 
Ad

More from Jenkins NS (20)

PPTX
All about Send proactive messages in Microsoft Teams BOT
Jenkins NS
 
PPTX
Surfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-in
Jenkins NS
 
PPTX
Global M365 Developer Bootcamp 2020 Hyderabad: KEYNOTE
Jenkins NS
 
PPTX
Global M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTE
Jenkins NS
 
PPTX
SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...
Jenkins NS
 
PDF
Extend the unextended in microsoft teams
Jenkins NS
 
PPTX
Power Automate integration with SPFX webpart
Jenkins NS
 
PPTX
Task-oriented interactions in Microsoft Teams with messaging extensions
Jenkins NS
 
PPTX
Microsoft power platform
Jenkins NS
 
PPTX
Introduction to microsoft teams app templates
Jenkins NS
 
PPTX
Build an app from scratch using teams app studio for ms teams
Jenkins NS
 
PPTX
Empowering citizen developers using power apps
Jenkins NS
 
PPTX
Ms teams webinar-getting started with microsoft teams development
Jenkins NS
 
PPTX
M365 virtual marathon build your first power virtual agents bot
Jenkins NS
 
PPTX
SPSChennai2020
Jenkins NS
 
PPTX
Trivandrumtechcon20
Jenkins NS
 
PPTX
Governance and administration for teams app development
Jenkins NS
 
PPTX
Getting started with spfx
Jenkins NS
 
PPTX
Architecting your Intranet with SharePoint Modernization
Jenkins NS
 
PPTX
Bots, adaptive cards, task module, message extensions in microsoft teams
Jenkins NS
 
All about Send proactive messages in Microsoft Teams BOT
Jenkins NS
 
Surfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-in
Jenkins NS
 
Global M365 Developer Bootcamp 2020 Hyderabad: KEYNOTE
Jenkins NS
 
Global M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTE
Jenkins NS
 
SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...
Jenkins NS
 
Extend the unextended in microsoft teams
Jenkins NS
 
Power Automate integration with SPFX webpart
Jenkins NS
 
Task-oriented interactions in Microsoft Teams with messaging extensions
Jenkins NS
 
Microsoft power platform
Jenkins NS
 
Introduction to microsoft teams app templates
Jenkins NS
 
Build an app from scratch using teams app studio for ms teams
Jenkins NS
 
Empowering citizen developers using power apps
Jenkins NS
 
Ms teams webinar-getting started with microsoft teams development
Jenkins NS
 
M365 virtual marathon build your first power virtual agents bot
Jenkins NS
 
SPSChennai2020
Jenkins NS
 
Trivandrumtechcon20
Jenkins NS
 
Governance and administration for teams app development
Jenkins NS
 
Getting started with spfx
Jenkins NS
 
Architecting your Intranet with SharePoint Modernization
Jenkins NS
 
Bots, adaptive cards, task module, message extensions in microsoft teams
Jenkins NS
 
Ad

Recently uploaded (20)

PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Python basic programing language for automation
DanialHabibi2
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
July Patch Tuesday
Ivanti
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 

SPFx Webinar Loading SharePoint data in a SPFx Webpart

  • 1. Webinar Series: Getting Started with SharePoint Framework Getting Started with SharePoint Framework Webinar Series
  • 2. Webinar Series: Getting Started with SharePoint Framework Loading SharePoint Data in a SPFx web part
  • 3. Webinar Series: Getting Started with SharePoint Framework Jenkins NS Modern Workplace Solution Architect | Consultant Founder & Director @ Microsoft Teams, Power Platform and SPFx Specialist International Speaker | Blogger | Trainer SPS Bangalore Organizer aOS Ambassador @jenkinsns https://www.facebook.com/msteamsinfo in/jenkinsns [email protected] http://www.jenkinsblogs.com jenkinsns https://www.facebook.com/spfxinfo/
  • 4. Webinar Series: Getting Started with SharePoint Framework Agenda Page Context Web Services Overview SharePoint REST API’s Using HttpClient Loading SharePoint data Demo - Using No JavaScript Framework - Using React
  • 5. Webinar Series: Getting Started with SharePoint Framework Page Context • The page context provides standard definitions for common SharePoint objects that need to be shared between the client-side application, web parts, and other components. Typically the data is fetched via REST queries when navigating to a new page, but it can also be preloaded by the web server or filled from a custom application cache.  Provides access to information about current context  Greatly extended version of _spPageContextinfo Property Description aadInfo If the current page doesn't have an associated Azure Active Directory tenant, this property will be undefined cultureInfo It provides culture info for the current user of the application isInitialized Returns whether the PageContext has been initialized list Contextual information for the SharePoint list that is hosting the page. If there is no list associated to the current page, this property will be undefined listItem Contextual information for the SharePoint list item that is hosting the page. If there is no list item associated to the current page, this property will be undefined site Contextual information for the SharePoint site collection ("SPSite") that is hosting the page. user It provides contextual information for the SharePoint user that is accessing the page. This class is primarily used with the PageContext class. web Contextual information for the SharePoint site ("SPWeb") that is hosting the page.
  • 6. Webinar Series: Getting Started with SharePoint Framework Page Context … Examples import { SPPermission } from '@microsoft/sp-page-context’;  this.context.pageContext.web.absoluteUrl  this.context.pageContext.web.permissions.hasAllPermissions(SPPermission.fullMask);  hasAllPermissions : Checks if the user has all the permissions  this.context.pageContext.web.permissions.hasAnyPermissions(SPPermission.manageWeb);  hasAnyPermissions: Checks if the user has any permission from the collection of permissions  this.context.pageContext.web.permissions.hasPermission(SPPermission.viewPages);  has Permission: Checks if the user has given permission
  • 7. Webinar Series: Getting Started with SharePoint Framework Web Services Overview Scenario: Customer is having existing web service which is developed into ASP.NET. Currently, we need to develop SPFx web part for SharePoint application. We want to fetch some information using this web service and need to populate into this webpart. How is authentication handled in the ASP.NET web service? Answer: By using the AadHttpClient, you can easily connect to APIs secured by using Azure AD without having to implement the OAuth flow yourself  Developers building client-side solutions are responsible for implementing authorization by using the OAuth implicit flow in their application. In SharePoint Framework solutions, that's already done as part of the framework through MSGraphClient and AadHttpClient, both of which are introduced in SharePoint Framework v1.4.1.  Note : If you build solutions on a version of the SharePoint Framework earlier than v1.4.1, you can still connect to resources secured with Azure AD. In this case, you need to implement the OAuth implicit flow by using ADAL JS.
  • 8. Webinar Series: Getting Started with SharePoint Framework SharePoint REST API’s  SharePoint includes a Representational State Transfer (REST) service that is comparable to the existing SharePoint client object models. Developers can interact remotely with SharePoint data by using any technology that supports REST web requests. This means that developers can perform Create, Read, Update, and Delete (CRUD) operations from their SharePoint Add-ins, solutions, and client applications, using REST web technologies and standard Open Data Protocol (OData) syntax.  To access SharePoint resources using REST, construct a RESTful HTTP request by using the OData standard, which corresponds to the desired client object model API.  https://{site_url}/_api/web  https://{site_url}/_api/site  Example  https://jpower4dev.sharepoint.com/_api/web/lists/GetByTitle('Contactlist')/Items URL end Points – Some exaples Description web/title Retrieves the title of a list Lists Retrieves all lists on a site lists/getbytitle('listname') Retrieves a single list's metadata lists/getbytitle('listname')/items Retrieves items within a list lists/getbytitle('listname')?select=Title Retrieves a specific property of a document
  • 9. Webinar Series: Getting Started with SharePoint Framework Using HttpClient  HttpClient implements a basic set of features for performing REST operations against a generic service.  import { HttpClient, IHttpClientOptions, HttpClientResponse } from '@microsoft/sp-http’  If you already used the HttpClient and SPHttpClient in your SharePoint Framework projects, you might have noticed that you have two types of request methods options: GET and POST. These two types of requests are the most used ones, but what if you want to use other HTTP methods like PUT, PATCH, DELETE?  If you need to make calls with other HTTP methods, you can make use of the fetch which is available on both the HttpClient and SPHttpClient classes. The fetch method allows you to specify the HTTP method type per request yourself. Fetch is also used behind the scenes when you are using the GET and POST methods. 1. how you can make use of the fetch method and specifying the request method to perform: spHttpClient this.props.context.spHttpClient.fetch(restUrl, SPHttpClient.configurations.v1, { method: "PATCH", body: JSON.stringify({ "Something": "Some content to patch" }) }).then((response: SPHttpClientResponse) => { // Do your thing}); 2. with the HttpClient, but you will notice that is not that different to use: this.props.context.httpClient.fetch(restUrl, HttpClient.configurations.v1, { method: "DELETE"}) .then((response: HttpClientResponse) => { // Do your thing });zax
  • 10. Webinar Series: Getting Started with SharePoint Framework Loading SharePoint data  SharePoint Framework is the new development model and it is a page and Web part model which provides full support for client-side SharePoint development, easy integration with SharePoint data, and support for open-source tooling. Standard “features” of SPFx  ToolchainAuthenticationSP  GraphAPI and WebAPI Access  CDN hosting  Config experience  Solution hosting  Component is able to get the right application context  Tenant-wide Deployment
  • 11. Webinar Series: Getting Started with SharePoint Framework Demo https://github.com/jenkinsns/spfx-demo-webparts Download the code
  • 12. Webinar Series: Getting Started with SharePoint Framework References…  http://jenkinsblogs.com/2016/08/24/create-a-sharepoint-framework-client-webpart-retrive-list-items/  https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part  https://www.youtube.com/channel/UC4JieFHDrN0elIYtZDktZSg  https://www.youtube.com/channel/UC_mKdhw-V6CeCM7gTo_Iy7w
  • 13. Webinar Series: Getting Started with SharePoint Framework Thank You
  • 14. Webinar Series: Getting Started with SharePoint Framework Next up… SPFx with React Siddharth Vaghasia

Editor's Notes

  • #8: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aadhttpclient