SlideShare a Scribd company logo
1 of 17
Download to read offline
#SPSMUC
SharePoint and Office 365 Saturday Munich
30 November 2019 ⃒ Microsoft Munich
#SPSMUC
Leveraging APIs from
SharePoint Framework solutions
Microsoft, PFE
Dragan Panjkov
@panjkov
#SPSMUC
PLATINUM
SILVER
GOLD
SharePoint and Office 365
Saturday Munich
Dragan Panjkov
Premier Field Engineer, Microsoft
Website and blog: www.dragan-panjkov.com
Twitter: @panjkov
Github: www.github.com/panjkov
Consume REST APIs in SPFx
• We almost always work with data
• SPFx provides us with APIs for working with external data sources
• APIs are based on HttpClient
SPHttpClient
MSGraphClient
AADHttpClient
HTTPClient
• Provided on the current SharePoint Context
• this.context.httpClient
• Optimized for REST APIs
• Fully configurable HTTP headers & payload
• Can be used for anonymous or secured REST APIs
Calling Anonymous REST APIs
import { HttpClient, HttpClientResponse }
from '@microsoft/sp-http’;
return this.context.httpClient.get(
`http://[rest-endpoint]`,
HttpClient.configurations.v1
)
.then((response: HttpClientResponse) => {
return response.json();
})
.then(jsonResponse => {
return jsonResponse;
}) as Promise<any>;
APIs protected with Azure AD
• Declare API permission request in SPFx manifest
• Initialize AadHttpClient in code
• Perform calls using client
• WARNING: API Permission request has to be approved in Tenant
Administration
Declare Permission Requests
// package-solution.json
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "sp-fx-aad-http-client-side-solution",
"id": "dfb230b7-4f61-431f-9b65-a34e83922663",
"version": "1.0.0.0",
"includeClientSideAssets": true,
"isDomainIsolated": false,
"webApiPermissionRequests": [
{ "resource": "Microsoft Graph", "scope": "User.ReadBasic.All” }
]
},
"paths": {
"zippedPackage": "solution/sp-fx-aad-http.sppkg"
}
}
Using the Azure AD HTTP Client
import { AadHttpClient, HttpClientResponse } from '@microsoft/sp-http';
this.context.aadHttpClientFactory
.getClient([name / URI of target resource])
.then((aadClient: AadHttpClient) => {
const endpoint: string = 'https://secured endpoint'
aadClient.get(endpoint, AadHttpClient.configurations.v1)
.then((rawResponse: HttpClientResponse) => {
return rawResponse.json();
})
.then((jsonResponse: any) => {
// work with result
});
});
});
Approve / Reject with SharePoint Online API
Management Page
Example: Calling a K2 API
"webApiPermissionRequests": [
{
"resource": "K2 API",
"scope": "user_impersonation"
}
]
protected onInit(): Promise {
return new Promise((resolve: () => void,
reject: (error:any) => void): void => {
this.context.aadHttpClientFactory
.getClient('https://api.k2.com/')
.then((client: AadHttpClient): void => {
this.aadClient = client;
resolve();
}, err => reject(err));
});
}
this.aadClient.get(this.properties.k2ServerURL
+ '/api/workflow/preview/tasks',
AadHttpClient.configurations.v1)
Microsoft Graph
• Single endpoint that proxies multiple Microsoft services
• Allows for easy traversal of objects and relationships
• Simplifies token acquisition and management
• Eliminates the need to traditional discovery (using “me” and
“myorganization”)
SharePoint Framework Includes a Microsoft
Graph Client
• MSGraphClient: SharePoint Framework’s Microsoft Graph Client
• Abstracts the token acquisition from the SharePoint Framework’s
support for Azure AD
• Wraps the Microsoft Graph JavaScript SDK and initializes it with one
line that returns a promise
Connecting to Microsoft Graph
• Declare API permission request in SPFx manifest
• Initialize MSGraphClient in code
• Perform calls using client
• WARNING: API Permission request has to be approved in Tenant
Administration
Using the MSGraphClient
this.context.msGraphClientFactory
.getClient()
.then((client: MSGraphClient): void => {
// use MSGraphClient here
client
.api('/me’)
.get((error: any, user: MicrosoftGraph.User, rawResponse?: any) => {
console.log('name: ', user.displayName);
console.log('email: ', user.mail);
console.log('phone: ', user.businessPhones[0]);
});
});
});
Resources
Connect to Anonymous APIs
https://docs.microsoft.com/sharepoint/dev/spfx/connect-to-anonymous-apis
Connect to Azure AD-secured APIs in SharePoint Framework Solutions
https://docs.microsoft.com/sharepoint/dev/spfx/use-aadhttpclient
Use the MSGraphClient to Connect to Microsoft Graph
https://docs.microsoft.com/sharepoint/dev/spfx/use-msgraph
SharePoint Framework web part and K2 Workflow REST API
https://www.dragan-panjkov.com/sharepoint-framework-web-part-and-k2-workflow-rest-api
Lab - Leverage the Microsoft Graph & 3rd Party APIs
https://github.com/SharePoint/sp-dev-training-spfx-graph-3rdpartyapis/blob/master/Lab.md
#SPSMUC
SharePoint and Office 365 Saturday Munich
30 November 2019 ⃒ Microsoft Munich
#SPSMUC
Don‘t forget to
rate the session!
THANK YOU!

More Related Content

What's hot

Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel.NET Conf UY
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesGaston Cruz
 
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019Icinga
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB
 
Hybris Commerce Backoffice CTI Integration Flow
Hybris Commerce Backoffice CTI Integration FlowHybris Commerce Backoffice CTI Integration Flow
Hybris Commerce Backoffice CTI Integration FlowSamuel Yang
 
Developing for Glass & Alfresco
Developing for Glass & AlfrescoDeveloping for Glass & Alfresco
Developing for Glass & AlfrescoJared Ottley
 
Cloud Abstraction Libraries: Implementation and Comparison
Cloud Abstraction Libraries: Implementation and ComparisonCloud Abstraction Libraries: Implementation and Comparison
Cloud Abstraction Libraries: Implementation and ComparisonUdit Agarwal
 
GraphQL, Redux, and React
GraphQL, Redux, and ReactGraphQL, Redux, and React
GraphQL, Redux, and ReactKeon Kim
 
Build effective microservices applications with a serverless architecture and...
Build effective microservices applications with a serverless architecture and...Build effective microservices applications with a serverless architecture and...
Build effective microservices applications with a serverless architecture and...Lorenzo Barbieri
 
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in KubernetesWSO2
 
A serverless IoT story from design to production and monitoring
A serverless IoT story from design to production and monitoringA serverless IoT story from design to production and monitoring
A serverless IoT story from design to production and monitoringCodeValue
 
Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Allen Pike
 
IDX API with Antonio
IDX API with AntonioIDX API with Antonio
IDX API with AntonioIDX Broker
 
Exposing GraphQLs as Managed APIs
Exposing GraphQLs as Managed APIsExposing GraphQLs as Managed APIs
Exposing GraphQLs as Managed APIsWSO2
 
Alfresco Integrations - Alfresco Devcon 2012
Alfresco Integrations - Alfresco Devcon 2012Alfresco Integrations - Alfresco Devcon 2012
Alfresco Integrations - Alfresco Devcon 2012Jared Ottley
 
Google App Engine Developer - Day2
Google App Engine Developer - Day2Google App Engine Developer - Day2
Google App Engine Developer - Day2Simon Su
 
Stateful pattern con Azure Functions
Stateful pattern con Azure FunctionsStateful pattern con Azure Functions
Stateful pattern con Azure FunctionsMassimo Bonanni
 
Custom HTML5-Native Bridge for Android
Custom HTML5-Native Bridge for AndroidCustom HTML5-Native Bridge for Android
Custom HTML5-Native Bridge for Androidmhant
 
Kubernetes and Docker Native Deployment Patterns for WSO2 Enterprise Integrator
Kubernetes and Docker Native Deployment Patterns for WSO2 Enterprise IntegratorKubernetes and Docker Native Deployment Patterns for WSO2 Enterprise Integrator
Kubernetes and Docker Native Deployment Patterns for WSO2 Enterprise IntegratorWSO2
 
[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기
[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기
[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기유리 한
 

What's hot (20)

Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
 
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
 
Hybris Commerce Backoffice CTI Integration Flow
Hybris Commerce Backoffice CTI Integration FlowHybris Commerce Backoffice CTI Integration Flow
Hybris Commerce Backoffice CTI Integration Flow
 
Developing for Glass & Alfresco
Developing for Glass & AlfrescoDeveloping for Glass & Alfresco
Developing for Glass & Alfresco
 
Cloud Abstraction Libraries: Implementation and Comparison
Cloud Abstraction Libraries: Implementation and ComparisonCloud Abstraction Libraries: Implementation and Comparison
Cloud Abstraction Libraries: Implementation and Comparison
 
GraphQL, Redux, and React
GraphQL, Redux, and ReactGraphQL, Redux, and React
GraphQL, Redux, and React
 
Build effective microservices applications with a serverless architecture and...
Build effective microservices applications with a serverless architecture and...Build effective microservices applications with a serverless architecture and...
Build effective microservices applications with a serverless architecture and...
 
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
 
A serverless IoT story from design to production and monitoring
A serverless IoT story from design to production and monitoringA serverless IoT story from design to production and monitoring
A serverless IoT story from design to production and monitoring
 
Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8
 
IDX API with Antonio
IDX API with AntonioIDX API with Antonio
IDX API with Antonio
 
Exposing GraphQLs as Managed APIs
Exposing GraphQLs as Managed APIsExposing GraphQLs as Managed APIs
Exposing GraphQLs as Managed APIs
 
Alfresco Integrations - Alfresco Devcon 2012
Alfresco Integrations - Alfresco Devcon 2012Alfresco Integrations - Alfresco Devcon 2012
Alfresco Integrations - Alfresco Devcon 2012
 
Google App Engine Developer - Day2
Google App Engine Developer - Day2Google App Engine Developer - Day2
Google App Engine Developer - Day2
 
Stateful pattern con Azure Functions
Stateful pattern con Azure FunctionsStateful pattern con Azure Functions
Stateful pattern con Azure Functions
 
Custom HTML5-Native Bridge for Android
Custom HTML5-Native Bridge for AndroidCustom HTML5-Native Bridge for Android
Custom HTML5-Native Bridge for Android
 
Kubernetes and Docker Native Deployment Patterns for WSO2 Enterprise Integrator
Kubernetes and Docker Native Deployment Patterns for WSO2 Enterprise IntegratorKubernetes and Docker Native Deployment Patterns for WSO2 Enterprise Integrator
Kubernetes and Docker Native Deployment Patterns for WSO2 Enterprise Integrator
 
[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기
[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기
[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기
 

Similar to Leveraging APIs from SharePoint Framework solutions

SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...Sébastien Levert
 
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.Cisco DevNet
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...wesley chun
 
An introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersAn introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersMicrosoft 365 Developer
 
SharePoint Conference 2018 - Build an intelligent application by connecting i...
SharePoint Conference 2018 - Build an intelligent application by connecting i...SharePoint Conference 2018 - Build an intelligent application by connecting i...
SharePoint Conference 2018 - Build an intelligent application by connecting i...Sébastien Levert
 
Office 365 Groups and Tasks API - Getting Started
Office 365 Groups and Tasks API - Getting StartedOffice 365 Groups and Tasks API - Getting Started
Office 365 Groups and Tasks API - Getting StartedDragan Panjkov
 
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint FrameworkharePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint FrameworkJenkins NS
 
Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017
Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017
Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017Nilesh Shah
 
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!Sébastien Levert
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!BIWUG
 
Microsoft graph and power platform champ
Microsoft graph and power platform   champMicrosoft graph and power platform   champ
Microsoft graph and power platform champKumton Suttiraksiri
 
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...Codemotion
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'sAntônio Roberto Silva
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020Matt Raible
 
SharePoint for the .NET Developer
SharePoint for the .NET DeveloperSharePoint for the .NET Developer
SharePoint for the .NET DeveloperJohn Calvert
 
Data Microservices In The Cloud + 日本語コメント
Data Microservices In The Cloud + 日本語コメントData Microservices In The Cloud + 日本語コメント
Data Microservices In The Cloud + 日本語コメントTakuya Saeki
 
Connecting the Dots: Kong for GraphQL Endpoints
Connecting the Dots: Kong for GraphQL EndpointsConnecting the Dots: Kong for GraphQL Endpoints
Connecting the Dots: Kong for GraphQL EndpointsJulien Bataillé
 
#CNX14 - Dive Deep into the ExactTarget Fuel APIs
#CNX14 - Dive Deep into the ExactTarget Fuel APIs#CNX14 - Dive Deep into the ExactTarget Fuel APIs
#CNX14 - Dive Deep into the ExactTarget Fuel APIsSalesforce Marketing Cloud
 

Similar to Leveraging APIs from SharePoint Framework solutions (20)

SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
 
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
An introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersAn introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developers
 
SharePoint Conference 2018 - Build an intelligent application by connecting i...
SharePoint Conference 2018 - Build an intelligent application by connecting i...SharePoint Conference 2018 - Build an intelligent application by connecting i...
SharePoint Conference 2018 - Build an intelligent application by connecting i...
 
Developing With Data Technologies
Developing With Data TechnologiesDeveloping With Data Technologies
Developing With Data Technologies
 
Office 365 Groups and Tasks API - Getting Started
Office 365 Groups and Tasks API - Getting StartedOffice 365 Groups and Tasks API - Getting Started
Office 365 Groups and Tasks API - Getting Started
 
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint FrameworkharePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
 
Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017
Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017
Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017
 
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!
 
Microsoft graph and power platform champ
Microsoft graph and power platform   champMicrosoft graph and power platform   champ
Microsoft graph and power platform champ
 
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
 
Angular2 inter3
Angular2 inter3Angular2 inter3
Angular2 inter3
 
SharePoint for the .NET Developer
SharePoint for the .NET DeveloperSharePoint for the .NET Developer
SharePoint for the .NET Developer
 
Data Microservices In The Cloud + 日本語コメント
Data Microservices In The Cloud + 日本語コメントData Microservices In The Cloud + 日本語コメント
Data Microservices In The Cloud + 日本語コメント
 
Connecting the Dots: Kong for GraphQL Endpoints
Connecting the Dots: Kong for GraphQL EndpointsConnecting the Dots: Kong for GraphQL Endpoints
Connecting the Dots: Kong for GraphQL Endpoints
 
#CNX14 - Dive Deep into the ExactTarget Fuel APIs
#CNX14 - Dive Deep into the ExactTarget Fuel APIs#CNX14 - Dive Deep into the ExactTarget Fuel APIs
#CNX14 - Dive Deep into the ExactTarget Fuel APIs
 

More from Dragan Panjkov

NetWork9-Pretvorite svoju poslovnu aplikaciju u Teams Tab u tri jednostavna k...
NetWork9-Pretvorite svoju poslovnu aplikaciju u Teams Tab u tri jednostavna k...NetWork9-Pretvorite svoju poslovnu aplikaciju u Teams Tab u tri jednostavna k...
NetWork9-Pretvorite svoju poslovnu aplikaciju u Teams Tab u tri jednostavna k...Dragan Panjkov
 
Developing with SharePoint Framework (SPFx) on-premises
Developing with SharePoint Framework (SPFx) on-premisesDeveloping with SharePoint Framework (SPFx) on-premises
Developing with SharePoint Framework (SPFx) on-premisesDragan Panjkov
 
Building serverless applications with Microsoft Graph and Azure Functions
Building serverless applications with Microsoft Graph and Azure FunctionsBuilding serverless applications with Microsoft Graph and Azure Functions
Building serverless applications with Microsoft Graph and Azure FunctionsDragan Panjkov
 
Building serverless applications with Microsoft Graph and Azure Functions
Building serverless applications with Microsoft Graph and Azure FunctionsBuilding serverless applications with Microsoft Graph and Azure Functions
Building serverless applications with Microsoft Graph and Azure FunctionsDragan Panjkov
 
How to create custom connector for Microsoft Flow
How to create custom connector for Microsoft FlowHow to create custom connector for Microsoft Flow
How to create custom connector for Microsoft FlowDragan Panjkov
 
Developing with SharePoint Framework (SPFx) on-premises
Developing with SharePoint Framework (SPFx) on-premisesDeveloping with SharePoint Framework (SPFx) on-premises
Developing with SharePoint Framework (SPFx) on-premisesDragan Panjkov
 
How to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft FlowHow to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft FlowDragan Panjkov
 
Building serverless applications with Microsoft Graph and Azure Functions - S...
Building serverless applications with Microsoft Graph and Azure Functions - S...Building serverless applications with Microsoft Graph and Azure Functions - S...
Building serverless applications with Microsoft Graph and Azure Functions - S...Dragan Panjkov
 
How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18Dragan Panjkov
 
Building Serverless Applications with Microsoft Graph - ECS 2018
Building Serverless Applications with Microsoft Graph - ECS 2018Building Serverless Applications with Microsoft Graph - ECS 2018
Building Serverless Applications with Microsoft Graph - ECS 2018Dragan Panjkov
 
How to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft FlowHow to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft FlowDragan Panjkov
 
Microsoft Graph and Azure Functions - SharePoint User Group Frankfurt
Microsoft Graph and Azure Functions - SharePoint User Group FrankfurtMicrosoft Graph and Azure Functions - SharePoint User Group Frankfurt
Microsoft Graph and Azure Functions - SharePoint User Group FrankfurtDragan Panjkov
 
ATD 13 - Enhancing your applications using Microsoft Graph API
ATD 13 - Enhancing your applications using Microsoft Graph APIATD 13 - Enhancing your applications using Microsoft Graph API
ATD 13 - Enhancing your applications using Microsoft Graph APIDragan Panjkov
 
SPS Vienna 2017 - Getting started with APIs for Groups and Planner
SPS Vienna 2017 - Getting started with APIs for Groups and PlannerSPS Vienna 2017 - Getting started with APIs for Groups and Planner
SPS Vienna 2017 - Getting started with APIs for Groups and PlannerDragan Panjkov
 
SPS Lisbon 2017 - Enhancing your applications using Microsoft Graph API
SPS Lisbon 2017 - Enhancing your applications using Microsoft Graph APISPS Lisbon 2017 - Enhancing your applications using Microsoft Graph API
SPS Lisbon 2017 - Enhancing your applications using Microsoft Graph APIDragan Panjkov
 
SPKonferenz 2017 - Planning with Planner
SPKonferenz 2017 - Planning with PlannerSPKonferenz 2017 - Planning with Planner
SPKonferenz 2017 - Planning with PlannerDragan Panjkov
 
MSNetWork 7 - Microsoft Teams Extensibility - bots, connectors, tabs
MSNetWork 7 - Microsoft Teams Extensibility - bots, connectors, tabsMSNetWork 7 - Microsoft Teams Extensibility - bots, connectors, tabs
MSNetWork 7 - Microsoft Teams Extensibility - bots, connectors, tabsDragan Panjkov
 
MSNetWork 7 - Implementacija SharePoint 2016 farme na Azure IAAS
MSNetWork 7 - Implementacija SharePoint 2016 farme na Azure IAASMSNetWork 7 - Implementacija SharePoint 2016 farme na Azure IAAS
MSNetWork 7 - Implementacija SharePoint 2016 farme na Azure IAASDragan Panjkov
 
Planning with Planner - SPS Lisbon 2016
Planning with Planner - SPS Lisbon 2016Planning with Planner - SPS Lisbon 2016
Planning with Planner - SPS Lisbon 2016Dragan Panjkov
 
Office Command Add-ins – New generation of Add-ins
Office Command Add-ins – New generation of Add-insOffice Command Add-ins – New generation of Add-ins
Office Command Add-ins – New generation of Add-insDragan Panjkov
 

More from Dragan Panjkov (20)

NetWork9-Pretvorite svoju poslovnu aplikaciju u Teams Tab u tri jednostavna k...
NetWork9-Pretvorite svoju poslovnu aplikaciju u Teams Tab u tri jednostavna k...NetWork9-Pretvorite svoju poslovnu aplikaciju u Teams Tab u tri jednostavna k...
NetWork9-Pretvorite svoju poslovnu aplikaciju u Teams Tab u tri jednostavna k...
 
Developing with SharePoint Framework (SPFx) on-premises
Developing with SharePoint Framework (SPFx) on-premisesDeveloping with SharePoint Framework (SPFx) on-premises
Developing with SharePoint Framework (SPFx) on-premises
 
Building serverless applications with Microsoft Graph and Azure Functions
Building serverless applications with Microsoft Graph and Azure FunctionsBuilding serverless applications with Microsoft Graph and Azure Functions
Building serverless applications with Microsoft Graph and Azure Functions
 
Building serverless applications with Microsoft Graph and Azure Functions
Building serverless applications with Microsoft Graph and Azure FunctionsBuilding serverless applications with Microsoft Graph and Azure Functions
Building serverless applications with Microsoft Graph and Azure Functions
 
How to create custom connector for Microsoft Flow
How to create custom connector for Microsoft FlowHow to create custom connector for Microsoft Flow
How to create custom connector for Microsoft Flow
 
Developing with SharePoint Framework (SPFx) on-premises
Developing with SharePoint Framework (SPFx) on-premisesDeveloping with SharePoint Framework (SPFx) on-premises
Developing with SharePoint Framework (SPFx) on-premises
 
How to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft FlowHow to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft Flow
 
Building serverless applications with Microsoft Graph and Azure Functions - S...
Building serverless applications with Microsoft Graph and Azure Functions - S...Building serverless applications with Microsoft Graph and Azure Functions - S...
Building serverless applications with Microsoft Graph and Azure Functions - S...
 
How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18
 
Building Serverless Applications with Microsoft Graph - ECS 2018
Building Serverless Applications with Microsoft Graph - ECS 2018Building Serverless Applications with Microsoft Graph - ECS 2018
Building Serverless Applications with Microsoft Graph - ECS 2018
 
How to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft FlowHow to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft Flow
 
Microsoft Graph and Azure Functions - SharePoint User Group Frankfurt
Microsoft Graph and Azure Functions - SharePoint User Group FrankfurtMicrosoft Graph and Azure Functions - SharePoint User Group Frankfurt
Microsoft Graph and Azure Functions - SharePoint User Group Frankfurt
 
ATD 13 - Enhancing your applications using Microsoft Graph API
ATD 13 - Enhancing your applications using Microsoft Graph APIATD 13 - Enhancing your applications using Microsoft Graph API
ATD 13 - Enhancing your applications using Microsoft Graph API
 
SPS Vienna 2017 - Getting started with APIs for Groups and Planner
SPS Vienna 2017 - Getting started with APIs for Groups and PlannerSPS Vienna 2017 - Getting started with APIs for Groups and Planner
SPS Vienna 2017 - Getting started with APIs for Groups and Planner
 
SPS Lisbon 2017 - Enhancing your applications using Microsoft Graph API
SPS Lisbon 2017 - Enhancing your applications using Microsoft Graph APISPS Lisbon 2017 - Enhancing your applications using Microsoft Graph API
SPS Lisbon 2017 - Enhancing your applications using Microsoft Graph API
 
SPKonferenz 2017 - Planning with Planner
SPKonferenz 2017 - Planning with PlannerSPKonferenz 2017 - Planning with Planner
SPKonferenz 2017 - Planning with Planner
 
MSNetWork 7 - Microsoft Teams Extensibility - bots, connectors, tabs
MSNetWork 7 - Microsoft Teams Extensibility - bots, connectors, tabsMSNetWork 7 - Microsoft Teams Extensibility - bots, connectors, tabs
MSNetWork 7 - Microsoft Teams Extensibility - bots, connectors, tabs
 
MSNetWork 7 - Implementacija SharePoint 2016 farme na Azure IAAS
MSNetWork 7 - Implementacija SharePoint 2016 farme na Azure IAASMSNetWork 7 - Implementacija SharePoint 2016 farme na Azure IAAS
MSNetWork 7 - Implementacija SharePoint 2016 farme na Azure IAAS
 
Planning with Planner - SPS Lisbon 2016
Planning with Planner - SPS Lisbon 2016Planning with Planner - SPS Lisbon 2016
Planning with Planner - SPS Lisbon 2016
 
Office Command Add-ins – New generation of Add-ins
Office Command Add-ins – New generation of Add-insOffice Command Add-ins – New generation of Add-ins
Office Command Add-ins – New generation of Add-ins
 

Recently uploaded

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 

Recently uploaded (20)

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 

Leveraging APIs from SharePoint Framework solutions

  • 1. #SPSMUC SharePoint and Office 365 Saturday Munich 30 November 2019 ⃒ Microsoft Munich #SPSMUC Leveraging APIs from SharePoint Framework solutions Microsoft, PFE Dragan Panjkov @panjkov
  • 3. Dragan Panjkov Premier Field Engineer, Microsoft Website and blog: www.dragan-panjkov.com Twitter: @panjkov Github: www.github.com/panjkov
  • 4. Consume REST APIs in SPFx • We almost always work with data • SPFx provides us with APIs for working with external data sources • APIs are based on HttpClient SPHttpClient MSGraphClient AADHttpClient
  • 5. HTTPClient • Provided on the current SharePoint Context • this.context.httpClient • Optimized for REST APIs • Fully configurable HTTP headers & payload • Can be used for anonymous or secured REST APIs
  • 6. Calling Anonymous REST APIs import { HttpClient, HttpClientResponse } from '@microsoft/sp-http’; return this.context.httpClient.get( `http://[rest-endpoint]`, HttpClient.configurations.v1 ) .then((response: HttpClientResponse) => { return response.json(); }) .then(jsonResponse => { return jsonResponse; }) as Promise<any>;
  • 7. APIs protected with Azure AD • Declare API permission request in SPFx manifest • Initialize AadHttpClient in code • Perform calls using client • WARNING: API Permission request has to be approved in Tenant Administration
  • 8. Declare Permission Requests // package-solution.json { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "sp-fx-aad-http-client-side-solution", "id": "dfb230b7-4f61-431f-9b65-a34e83922663", "version": "1.0.0.0", "includeClientSideAssets": true, "isDomainIsolated": false, "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "User.ReadBasic.All” } ] }, "paths": { "zippedPackage": "solution/sp-fx-aad-http.sppkg" } }
  • 9. Using the Azure AD HTTP Client import { AadHttpClient, HttpClientResponse } from '@microsoft/sp-http'; this.context.aadHttpClientFactory .getClient([name / URI of target resource]) .then((aadClient: AadHttpClient) => { const endpoint: string = 'https://secured endpoint' aadClient.get(endpoint, AadHttpClient.configurations.v1) .then((rawResponse: HttpClientResponse) => { return rawResponse.json(); }) .then((jsonResponse: any) => { // work with result }); }); });
  • 10. Approve / Reject with SharePoint Online API Management Page
  • 11. Example: Calling a K2 API "webApiPermissionRequests": [ { "resource": "K2 API", "scope": "user_impersonation" } ] protected onInit(): Promise { return new Promise((resolve: () => void, reject: (error:any) => void): void => { this.context.aadHttpClientFactory .getClient('https://api.k2.com/') .then((client: AadHttpClient): void => { this.aadClient = client; resolve(); }, err => reject(err)); }); } this.aadClient.get(this.properties.k2ServerURL + '/api/workflow/preview/tasks', AadHttpClient.configurations.v1)
  • 12. Microsoft Graph • Single endpoint that proxies multiple Microsoft services • Allows for easy traversal of objects and relationships • Simplifies token acquisition and management • Eliminates the need to traditional discovery (using “me” and “myorganization”)
  • 13. SharePoint Framework Includes a Microsoft Graph Client • MSGraphClient: SharePoint Framework’s Microsoft Graph Client • Abstracts the token acquisition from the SharePoint Framework’s support for Azure AD • Wraps the Microsoft Graph JavaScript SDK and initializes it with one line that returns a promise
  • 14. Connecting to Microsoft Graph • Declare API permission request in SPFx manifest • Initialize MSGraphClient in code • Perform calls using client • WARNING: API Permission request has to be approved in Tenant Administration
  • 15. Using the MSGraphClient this.context.msGraphClientFactory .getClient() .then((client: MSGraphClient): void => { // use MSGraphClient here client .api('/me’) .get((error: any, user: MicrosoftGraph.User, rawResponse?: any) => { console.log('name: ', user.displayName); console.log('email: ', user.mail); console.log('phone: ', user.businessPhones[0]); }); }); });
  • 16. Resources Connect to Anonymous APIs https://docs.microsoft.com/sharepoint/dev/spfx/connect-to-anonymous-apis Connect to Azure AD-secured APIs in SharePoint Framework Solutions https://docs.microsoft.com/sharepoint/dev/spfx/use-aadhttpclient Use the MSGraphClient to Connect to Microsoft Graph https://docs.microsoft.com/sharepoint/dev/spfx/use-msgraph SharePoint Framework web part and K2 Workflow REST API https://www.dragan-panjkov.com/sharepoint-framework-web-part-and-k2-workflow-rest-api Lab - Leverage the Microsoft Graph & 3rd Party APIs https://github.com/SharePoint/sp-dev-training-spfx-graph-3rdpartyapis/blob/master/Lab.md
  • 17. #SPSMUC SharePoint and Office 365 Saturday Munich 30 November 2019 ⃒ Microsoft Munich #SPSMUC Don‘t forget to rate the session! THANK YOU!