SlideShare a Scribd company logo
1 of 32
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Web API Intro
 Web API is a new Web Service end-point available to access data and
metadata.
 Microsoft incorporated Web API in Dynamics 365 release 2.0.
 Web API provides a platform agnostic development experience which
can be used across a wide variety of programming languages, platforms,
and devices.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
How Web API is Implemented?
 Web API implements OData (Open Data Protocol), version 4.0.
 OData is an OASIS standard for building and consuming Restful APIs.
 Web API combines functionality of SOAP and REST endpoints which is easy
to use regardless of the language used.
 Its previous implementation - REST endpoint (Odata 2.0) was limited in
functionality – only CRUD operations were possible.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Web API Operations
With the help of Web API you can perform following operation.
 Create
 Update
 Delete
 Retrieve
 Retrieve multiple( using odata query and fetch)
 Execute Web API functions
 Execute Web API Actions
 Execute Web API Query Functions
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
How to Use Web API
 Web API is built on open standards.
 Microsoft doesn’t provide assemblies for a specific developer experience.
 You can compose HTTP requests for specific operations or use third-party
libraries to generate classes for whatever language or platform you want.
 You can find a list of libraries that support OData version 4.0
at http://www.odata.org/libraries/.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Web API Limitations
 Using Web API a maximum of 5000 entities will be returned for each
request ( unless you specify a smaller page size).
 If there are more entities that match the query filter criteria, a
@odata.nextLink property will be returned with the results.
 Use the value of the @odata.nextLink property with a new GET request to
return the next page of data.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Web API Authentication
 There are 3 different ways to manage authentication when using Web API.
 And the code you write to manage authentication with Web API depends on
the type of deployment and where your code is.
1. Within JScript web Resources – No specific authentication
2. With Dynamics 365 On-premise – using HttpClient using user credentials.
3. Dynamics 365 online / IFD : Using OAuth.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Authentication for CRM Organization Service
Authentication methods for the Organization Service:
 Active Directory authentication:
 Azure Active Directory Authentication Library (ADAL) – 2 Factor
authentication.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Authenticate using ADAL
// TODO Substitute your correct CRM root service address,
string resource = "https://mydomain.crm.dynamics.com";
// TODO Substitute your app registration values that can be obtained after
you // register the app in Active Directory on the Microsoft Azure portal.
string clientId = "e5cf0024-a66a-4f16-85ce-99ba97a24bb2";
string redirectUrl = "http://localhost/SdkSample";
// Authenticate the registered application with Azure Active Directory.
AuthenticationContext authContext = new
AuthenticationContext("https://login.windows.net/common", false);
AuthenticationResult result = authContext.AcquireToken(resource, clientId,
new Uri(redirectUrl));
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Query Data using Web API
To retrieve data for an entity set, use GET request.
To set criteria for the data you want to retrieve, you can apply query options.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Query Data using Web API…
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Query Options with Web API
 We can use Query Options to send parameters to Web API Query.
 The first is appended after [?] and subsequent query options are
separated using [&].
 All query options are case-sensitive as shown in the following example.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Filter Results
Use $filter system
query option to set
criteria for which
entities will be
returned.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Connect to Dynamics 365 CRM Web API
There are 2 major steps involved in the process.
 Register the application with your Azure subscription
 Build the Console Application – Use the Client Id & Authority URL to connect
to WebApi and do your “stuff”.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Prerequisites – Dynamics 365 Online
For a Microsoft Dynamics 365 (online) deployment:
 User must have a Microsoft Dynamics 365 (online) system user account
with administrator role for the Microsoft Office 365 subscription.
 A Microsoft Azure subscription for application registration.
 A trial account will also work.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Prerequisites – On Premise / IFD
For an on-premises or Internet-facing deployment (IFD):
 Server must be configured to use claims authentication and have OAuth
authentication enabled.
 A Microsoft Azure subscription for application registration. A trial account
will also work.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Register Dynamics 365 app with Azure AD
 Once registered we can connect to Dynamics 365 server, authenticate using
OAuth, and access the web services.
 Your application can access CRM web services using HTTP requests with
Web API or web client proxy classes of the Organization Service.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Register A New Application with Azure AD
 Login into Azure
Subscription
 Register a new App.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Register A New Application with Azure AD…
Mention the following
 Name
 Application Type: Native /
Non- native
 Redirect URL
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Register A New Application with Azure AD…
Note down the following:
 Application ID
 Client ID
 Redirect URL
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Set Required Privileges for the App
 Set required Privileges
for the application
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Set Required Privileges for the App…
 Enable Access.
 Set Permission - Access
CRM Online Organization
Users for Dynamics 365
Online.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Authentication with JavaScript Web Resources
 When you use Web API with JavaScript you don’t need to include any code
for authentication.
 Within HTML web resources, form scripts, or ribbon commands
 In each of these cases the user is already authenticated by the application
and authentication is managed by the application.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Retrieve Data using REST ( OData 2.0)
 Web API Endpoint is the updated version of REST ( Odata 2.0 ) end
point
 Web API Endpoint URL is bit different from Odata End Point and has
limited functionality.
 accountsSet?$select=accountnumber,address1_city
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Retrieve Data using REST ( OData 2.0)
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Practice: Retrieve Account Data Using Odata 2.0
var account="$select=Name, Address1_Line1,
WebSiteURL,Address1_StateOrProvince &$filter=AccountId eq guid'"
+ accountId + "'");
var query = new XMLHttpRequest();
var oDataSelect = Xrm.Page.context.getClientUrl() +
"/XRMServices/2011/OrganizationData.svc/" + “AccountSet”+
acccount;
query.open('GET', oDataSelect, false);
query.setRequestHeader("Accept", "application/json");
query.setRequestHeader("Content-Type", "application/json;
charset=utf-8");
query.send(null);
return (JSON.parse(query.responseText).d.results);
Scenario: Select Account Name, Address,
Website URL, State/Province of a
particular Account record using web API
in Javascript.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446
Retrieve Data using Web API ( Odata 4.0)
Web API Endpoint URL is bit
different from Odata End Point.
Magnifez Technologies| training@magnifez.com | +91 8008 048 446

More Related Content

What's hot

People code events 1
People code events 1People code events 1
People code events 1Samarth Arora
 
An Introduction to the Dynamics AX Application Integration Framework
An Introduction to the Dynamics AX Application Integration FrameworkAn Introduction to the Dynamics AX Application Integration Framework
An Introduction to the Dynamics AX Application Integration FrameworkFolio3-Dynamics-Services
 
XMLPublisher
XMLPublisherXMLPublisher
XMLPublisherJAYAARC
 
abap list viewer (alv)
abap list viewer (alv)abap list viewer (alv)
abap list viewer (alv)Kranthi Kumar
 
ABAP Object oriented concepts
ABAP Object oriented conceptsABAP Object oriented concepts
ABAP Object oriented conceptsDharmeshKumar49
 
Getting started with Microsoft dynamics crm 2016
Getting started with Microsoft dynamics crm 2016Getting started with Microsoft dynamics crm 2016
Getting started with Microsoft dynamics crm 2016Firoz Muhammed
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPNoman Mohamed Hanif
 
Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce Associates
 
SAP ABAP - Needed Notes
SAP   ABAP - Needed NotesSAP   ABAP - Needed Notes
SAP ABAP - Needed NotesAkash Bhavsar
 
Salesforce Winter ’23 Release Highlights
Salesforce Winter ’23 Release HighlightsSalesforce Winter ’23 Release Highlights
Salesforce Winter ’23 Release HighlightsSkyPlanner
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overviewsapdocs. info
 
SAP Fiori Interview Q& A - IQ Online Training
SAP Fiori Interview Q& A - IQ Online TrainingSAP Fiori Interview Q& A - IQ Online Training
SAP Fiori Interview Q& A - IQ Online TrainingIQ Online Training
 
Dynamics 365 introduction and functional
Dynamics 365 introduction and functionalDynamics 365 introduction and functional
Dynamics 365 introduction and functionalSatish Reddy
 
People soft application-designer-practice-8.43
People soft application-designer-practice-8.43People soft application-designer-practice-8.43
People soft application-designer-practice-8.43cesarvii
 
Developing ssrs-reports-for-dynamics-ax
Developing ssrs-reports-for-dynamics-axDeveloping ssrs-reports-for-dynamics-ax
Developing ssrs-reports-for-dynamics-axNicc Ngo
 
ATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsKeyur Shah
 

What's hot (20)

People code events 1
People code events 1People code events 1
People code events 1
 
An Introduction to the Dynamics AX Application Integration Framework
An Introduction to the Dynamics AX Application Integration FrameworkAn Introduction to the Dynamics AX Application Integration Framework
An Introduction to the Dynamics AX Application Integration Framework
 
XMLPublisher
XMLPublisherXMLPublisher
XMLPublisher
 
abap list viewer (alv)
abap list viewer (alv)abap list viewer (alv)
abap list viewer (alv)
 
SAP ABAP data dictionary
SAP ABAP data dictionarySAP ABAP data dictionary
SAP ABAP data dictionary
 
ABAP Object oriented concepts
ABAP Object oriented conceptsABAP Object oriented concepts
ABAP Object oriented concepts
 
Getting started with Microsoft dynamics crm 2016
Getting started with Microsoft dynamics crm 2016Getting started with Microsoft dynamics crm 2016
Getting started with Microsoft dynamics crm 2016
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce administrator training presentation slides
Salesforce administrator training presentation slides
 
Introduction Dynamics 365 CRM
Introduction Dynamics 365 CRMIntroduction Dynamics 365 CRM
Introduction Dynamics 365 CRM
 
SAP ABAP - Needed Notes
SAP   ABAP - Needed NotesSAP   ABAP - Needed Notes
SAP ABAP - Needed Notes
 
Oracle R12 iProcurement Reference Guide
Oracle R12 iProcurement Reference GuideOracle R12 iProcurement Reference Guide
Oracle R12 iProcurement Reference Guide
 
Salesforce Winter ’23 Release Highlights
Salesforce Winter ’23 Release HighlightsSalesforce Winter ’23 Release Highlights
Salesforce Winter ’23 Release Highlights
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overview
 
SAP Fiori Interview Q& A - IQ Online Training
SAP Fiori Interview Q& A - IQ Online TrainingSAP Fiori Interview Q& A - IQ Online Training
SAP Fiori Interview Q& A - IQ Online Training
 
Dynamics 365 introduction and functional
Dynamics 365 introduction and functionalDynamics 365 introduction and functional
Dynamics 365 introduction and functional
 
People soft application-designer-practice-8.43
People soft application-designer-practice-8.43People soft application-designer-practice-8.43
People soft application-designer-practice-8.43
 
Abap reports
Abap reportsAbap reports
Abap reports
 
Developing ssrs-reports-for-dynamics-ax
Developing ssrs-reports-for-dynamics-axDeveloping ssrs-reports-for-dynamics-ax
Developing ssrs-reports-for-dynamics-ax
 
ATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your Figertips
 

Similar to Intro to web api with dynamics 365

Azure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish KalamatiAzure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish KalamatiGirish Kalamati
 
PowerApps, the Developer Story: Build an API to Integrate Corporate Data
PowerApps, the Developer Story: Build an API to Integrate Corporate DataPowerApps, the Developer Story: Build an API to Integrate Corporate Data
PowerApps, the Developer Story: Build an API to Integrate Corporate DataBram de Jager
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesGaston Cruz
 
Microsoft identity manoj mittal
Microsoft identity manoj mittalMicrosoft identity manoj mittal
Microsoft identity manoj mittalManoj Mittal
 
Community call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformCommunity call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformMicrosoft 365 Developer
 
New Feature in CRM 2016
New Feature in CRM 2016New Feature in CRM 2016
New Feature in CRM 2016Naveen Kumar
 
Resume new it_format
Resume new it_formatResume new it_format
Resume new it_formatRajiv Saini
 
June 2023 Architect Group FTW.pdf
June 2023 Architect Group FTW.pdfJune 2023 Architect Group FTW.pdf
June 2023 Architect Group FTW.pdfAmeyKulkarni84
 
Microsoft Graph API Webinar Application Permissions
Microsoft Graph API Webinar Application PermissionsMicrosoft Graph API Webinar Application Permissions
Microsoft Graph API Webinar Application PermissionsStefan Weber
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound IntegrationsSujit Kumar
 
APIs_ An Introduction.pptx
APIs_ An Introduction.pptxAPIs_ An Introduction.pptx
APIs_ An Introduction.pptxAkashThorat25
 
"Secure Mobile Apps with the Microsoft Identity Platform", Christos Matskas, ...
"Secure Mobile Apps with the Microsoft Identity Platform", Christos Matskas, ..."Secure Mobile Apps with the Microsoft Identity Platform", Christos Matskas, ...
"Secure Mobile Apps with the Microsoft Identity Platform", Christos Matskas, ...Fwdays
 
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...Amazon Web Services
 
Microsoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsMicrosoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsStudy Material
 
Introduction to the Microsoft identity platform for developers
Introduction to the Microsoft identity platform for developersIntroduction to the Microsoft identity platform for developers
Introduction to the Microsoft identity platform for developersChristos Matskas
 
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...CA Technologies
 
What's new in Azure Active Directory and what's coming new ?
What's new in Azure Active Directory and what's coming new ?What's new in Azure Active Directory and what's coming new ?
What's new in Azure Active Directory and what's coming new ?Vignesh Ganesan I Microsoft MVP
 
Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Kris Wagner
 

Similar to Intro to web api with dynamics 365 (20)

Azure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish KalamatiAzure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish Kalamati
 
PowerApps, the Developer Story: Build an API to Integrate Corporate Data
PowerApps, the Developer Story: Build an API to Integrate Corporate DataPowerApps, the Developer Story: Build an API to Integrate Corporate Data
PowerApps, the Developer Story: Build an API to Integrate Corporate Data
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
 
Microsoft identity manoj mittal
Microsoft identity manoj mittalMicrosoft identity manoj mittal
Microsoft identity manoj mittal
 
Community call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformCommunity call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platform
 
New Feature in CRM 2016
New Feature in CRM 2016New Feature in CRM 2016
New Feature in CRM 2016
 
Resume new it_format
Resume new it_formatResume new it_format
Resume new it_format
 
M365 Teams Automation
M365 Teams AutomationM365 Teams Automation
M365 Teams Automation
 
June 2023 Architect Group FTW.pdf
June 2023 Architect Group FTW.pdfJune 2023 Architect Group FTW.pdf
June 2023 Architect Group FTW.pdf
 
Microsoft Graph API Webinar Application Permissions
Microsoft Graph API Webinar Application PermissionsMicrosoft Graph API Webinar Application Permissions
Microsoft Graph API Webinar Application Permissions
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound Integrations
 
APIs_ An Introduction.pptx
APIs_ An Introduction.pptxAPIs_ An Introduction.pptx
APIs_ An Introduction.pptx
 
"Secure Mobile Apps with the Microsoft Identity Platform", Christos Matskas, ...
"Secure Mobile Apps with the Microsoft Identity Platform", Christos Matskas, ..."Secure Mobile Apps with the Microsoft Identity Platform", Christos Matskas, ...
"Secure Mobile Apps with the Microsoft Identity Platform", Christos Matskas, ...
 
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
 
Microsoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsMicrosoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam Dumps
 
Introduction to the Microsoft identity platform for developers
Introduction to the Microsoft identity platform for developersIntroduction to the Microsoft identity platform for developers
Introduction to the Microsoft identity platform for developers
 
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...
 
Is BCS Dead?
Is BCS Dead?Is BCS Dead?
Is BCS Dead?
 
What's new in Azure Active Directory and what's coming new ?
What's new in Azure Active Directory and what's coming new ?What's new in Azure Active Directory and what's coming new ?
What's new in Azure Active Directory and what's coming new ?
 
Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Microsoft Azure Identity and O365
Microsoft Azure Identity and O365
 

Recently uploaded

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Intro to web api with dynamics 365

  • 2. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Web API Intro  Web API is a new Web Service end-point available to access data and metadata.  Microsoft incorporated Web API in Dynamics 365 release 2.0.  Web API provides a platform agnostic development experience which can be used across a wide variety of programming languages, platforms, and devices.
  • 3. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 How Web API is Implemented?  Web API implements OData (Open Data Protocol), version 4.0.  OData is an OASIS standard for building and consuming Restful APIs.  Web API combines functionality of SOAP and REST endpoints which is easy to use regardless of the language used.  Its previous implementation - REST endpoint (Odata 2.0) was limited in functionality – only CRUD operations were possible.
  • 4. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Web API Operations With the help of Web API you can perform following operation.  Create  Update  Delete  Retrieve  Retrieve multiple( using odata query and fetch)  Execute Web API functions  Execute Web API Actions  Execute Web API Query Functions
  • 5. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 How to Use Web API  Web API is built on open standards.  Microsoft doesn’t provide assemblies for a specific developer experience.  You can compose HTTP requests for specific operations or use third-party libraries to generate classes for whatever language or platform you want.  You can find a list of libraries that support OData version 4.0 at http://www.odata.org/libraries/.
  • 6. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Web API Limitations  Using Web API a maximum of 5000 entities will be returned for each request ( unless you specify a smaller page size).  If there are more entities that match the query filter criteria, a @odata.nextLink property will be returned with the results.  Use the value of the @odata.nextLink property with a new GET request to return the next page of data.
  • 8. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Web API Authentication  There are 3 different ways to manage authentication when using Web API.  And the code you write to manage authentication with Web API depends on the type of deployment and where your code is. 1. Within JScript web Resources – No specific authentication 2. With Dynamics 365 On-premise – using HttpClient using user credentials. 3. Dynamics 365 online / IFD : Using OAuth.
  • 9. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Authentication for CRM Organization Service Authentication methods for the Organization Service:  Active Directory authentication:  Azure Active Directory Authentication Library (ADAL) – 2 Factor authentication.
  • 10. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Authenticate using ADAL // TODO Substitute your correct CRM root service address, string resource = "https://mydomain.crm.dynamics.com"; // TODO Substitute your app registration values that can be obtained after you // register the app in Active Directory on the Microsoft Azure portal. string clientId = "e5cf0024-a66a-4f16-85ce-99ba97a24bb2"; string redirectUrl = "http://localhost/SdkSample"; // Authenticate the registered application with Azure Active Directory. AuthenticationContext authContext = new AuthenticationContext("https://login.windows.net/common", false); AuthenticationResult result = authContext.AcquireToken(resource, clientId, new Uri(redirectUrl));
  • 12. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Query Data using Web API To retrieve data for an entity set, use GET request. To set criteria for the data you want to retrieve, you can apply query options.
  • 13. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Query Data using Web API…
  • 14. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Query Options with Web API  We can use Query Options to send parameters to Web API Query.  The first is appended after [?] and subsequent query options are separated using [&].  All query options are case-sensitive as shown in the following example.
  • 15. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Filter Results Use $filter system query option to set criteria for which entities will be returned.
  • 17. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Connect to Dynamics 365 CRM Web API There are 2 major steps involved in the process.  Register the application with your Azure subscription  Build the Console Application – Use the Client Id & Authority URL to connect to WebApi and do your “stuff”.
  • 18. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Prerequisites – Dynamics 365 Online For a Microsoft Dynamics 365 (online) deployment:  User must have a Microsoft Dynamics 365 (online) system user account with administrator role for the Microsoft Office 365 subscription.  A Microsoft Azure subscription for application registration.  A trial account will also work.
  • 19. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Prerequisites – On Premise / IFD For an on-premises or Internet-facing deployment (IFD):  Server must be configured to use claims authentication and have OAuth authentication enabled.  A Microsoft Azure subscription for application registration. A trial account will also work.
  • 20. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Register Dynamics 365 app with Azure AD  Once registered we can connect to Dynamics 365 server, authenticate using OAuth, and access the web services.  Your application can access CRM web services using HTTP requests with Web API or web client proxy classes of the Organization Service.
  • 21. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Register A New Application with Azure AD  Login into Azure Subscription  Register a new App.
  • 22. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Register A New Application with Azure AD… Mention the following  Name  Application Type: Native / Non- native  Redirect URL
  • 23. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Register A New Application with Azure AD… Note down the following:  Application ID  Client ID  Redirect URL
  • 24. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Set Required Privileges for the App  Set required Privileges for the application
  • 25. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Set Required Privileges for the App…  Enable Access.  Set Permission - Access CRM Online Organization Users for Dynamics 365 Online.
  • 27. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Authentication with JavaScript Web Resources  When you use Web API with JavaScript you don’t need to include any code for authentication.  Within HTML web resources, form scripts, or ribbon commands  In each of these cases the user is already authenticated by the application and authentication is managed by the application.
  • 28. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Retrieve Data using REST ( OData 2.0)  Web API Endpoint is the updated version of REST ( Odata 2.0 ) end point  Web API Endpoint URL is bit different from Odata End Point and has limited functionality.  accountsSet?$select=accountnumber,address1_city
  • 29. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Retrieve Data using REST ( OData 2.0)
  • 30. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Practice: Retrieve Account Data Using Odata 2.0 var account="$select=Name, Address1_Line1, WebSiteURL,Address1_StateOrProvince &$filter=AccountId eq guid'" + accountId + "'"); var query = new XMLHttpRequest(); var oDataSelect = Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/" + “AccountSet”+ acccount; query.open('GET', oDataSelect, false); query.setRequestHeader("Accept", "application/json"); query.setRequestHeader("Content-Type", "application/json; charset=utf-8"); query.send(null); return (JSON.parse(query.responseText).d.results); Scenario: Select Account Name, Address, Website URL, State/Province of a particular Account record using web API in Javascript.
  • 31. Magnifez Technologies| training@magnifez.com | +91 8008 048 446 Retrieve Data using Web API ( Odata 4.0) Web API Endpoint URL is bit different from Odata End Point.