SlideShare a Scribd company logo
1 of 10
Implementing Web APIs
 Zeeshan Ahmed Khalil (Quantum LHE –Sr. Software engineer)
Lesson 1: Developing a Web API
 What Is a Web API?
 Routing in Web API
 Real time Architecture
 WCF VS Web API
 RESTful Services
 Data Return Formats
 Using Routes and Controllers in Web API
 Demonstration: Web API with tool and Data.
What Is a Web API?
 Web API:
 Helps create REST-style APIs
 Enables external systems to use the business logics implemented in your
application
 Uses URLs in requests and helps obtain results in the JSON format
 Is ideal for mobile application integration
Routing in Web API
Characteristics of routing in Web API:
 You can use API controller names and a naming convention for actions to route
Web API requests
 Alternatively you can use the following attributes to control the mapping of
HTTP requests (HTTP Verb+URL) to actions in the controller:
 The HttpGet, HttpPut, HttpPost, or HttpDelete attributes
 The AcceptVerbs attribute
 The ActionName attribute
Real time Architecture
RESTful Services
Characteristics of a RESTful Service:
 Can be called to retrieve business information from the server
 Can create, update, and delete information in a database through HTTP operations
 Uses URLs to uniquely identify the entity that it operates on
 Uses HTTP verbs to identify the operation that the application needs to perform.
The HTTP verbs include:
 GET
 POST
 PUT
 DELETE
Data Return Formats
 Web API can return data in JSON or XML formats
 Web API uses the media formatter to:
 Format or serialize the information that a Web API REST service returns
 Control the media type in the HTTP header
 Format all content that the server renders to client systems
 Media formatter classes inherit from the MediaTypeFormatter class and the
BufferedMediaTypeFormatter class
Using Routes and Controllers in Web APIs
Routing in ASP.NET MVC4 applications involves the following:
 ASP.NET adds a default route to:
 Map a URL and a controller
 Support the operations of the REST-style Web APIs
 You can modify the default route to include multiple actions in the same
HTTP method
 You can use the WebApiConfig class to:
 Modify the routing
 Enable multiple versions of API to coexist in the same project
Demo
 Web Api and Request and Response

More Related Content

What's hot

Mule api and service management
Mule api and service managementMule api and service management
Mule api and service managementD.Rajesh Kumar
 
Best practices for multi saa s integrations
Best practices for multi saa s integrationsBest practices for multi saa s integrations
Best practices for multi saa s integrationsD.Rajesh Kumar
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Vibhawa Nirmal
 
The anypoint platform for API's
The anypoint platform for API'sThe anypoint platform for API's
The anypoint platform for API'sAchyuta Lakshmi
 
Create folder in microsoft office 365 share point using mule esb
Create folder in microsoft office 365 share point using mule esbCreate folder in microsoft office 365 share point using mule esb
Create folder in microsoft office 365 share point using mule esbSanjeet Pandey
 
Update of line live over the past year
Update of line live over the past yearUpdate of line live over the past year
Update of line live over the past yearLINE Corporation
 
Integration with Microsoft CRM using Mule ESB
Integration with Microsoft CRM using Mule ESBIntegration with Microsoft CRM using Mule ESB
Integration with Microsoft CRM using Mule ESBSanjeet Pandey
 
Netsuite open air connector
Netsuite open air connectorNetsuite open air connector
Netsuite open air connectorD.Rajesh Kumar
 
Mule api gateway overview
Mule api gateway overviewMule api gateway overview
Mule api gateway overviewSanjeet Pandey
 
Query Operation in Microsoft SharePoint using Mule ESB
Query Operation in Microsoft SharePoint using Mule ESBQuery Operation in Microsoft SharePoint using Mule ESB
Query Operation in Microsoft SharePoint using Mule ESBSanjeet Pandey
 
Token Management using Stormpath inside Mule
Token Management using Stormpath inside MuleToken Management using Stormpath inside Mule
Token Management using Stormpath inside MuleRaviShankar Mishra
 
Mule architecture
Mule architectureMule architecture
Mule architecturePhaniu
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGSiddharth Sharma
 
Telling the world why we love mule soft!
Telling the world why we love mule soft!Telling the world why we love mule soft!
Telling the world why we love mule soft!Sudha Ch
 

What's hot (17)

Mule api and service management
Mule api and service managementMule api and service management
Mule api and service management
 
Best practices for multi saa s integrations
Best practices for multi saa s integrationsBest practices for multi saa s integrations
Best practices for multi saa s integrations
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface)
 
The anypoint platform for API's
The anypoint platform for API'sThe anypoint platform for API's
The anypoint platform for API's
 
Create folder in microsoft office 365 share point using mule esb
Create folder in microsoft office 365 share point using mule esbCreate folder in microsoft office 365 share point using mule esb
Create folder in microsoft office 365 share point using mule esb
 
Update of line live over the past year
Update of line live over the past yearUpdate of line live over the past year
Update of line live over the past year
 
Integration with Microsoft CRM using Mule ESB
Integration with Microsoft CRM using Mule ESBIntegration with Microsoft CRM using Mule ESB
Integration with Microsoft CRM using Mule ESB
 
Salesforce APIs
Salesforce APIsSalesforce APIs
Salesforce APIs
 
Netsuite open air connector
Netsuite open air connectorNetsuite open air connector
Netsuite open air connector
 
Mule api gateway overview
Mule api gateway overviewMule api gateway overview
Mule api gateway overview
 
Api Layer
Api LayerApi Layer
Api Layer
 
Query Operation in Microsoft SharePoint using Mule ESB
Query Operation in Microsoft SharePoint using Mule ESBQuery Operation in Microsoft SharePoint using Mule ESB
Query Operation in Microsoft SharePoint using Mule ESB
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Token Management using Stormpath inside Mule
Token Management using Stormpath inside MuleToken Management using Stormpath inside Mule
Token Management using Stormpath inside Mule
 
Mule architecture
Mule architectureMule architecture
Mule architecture
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
Telling the world why we love mule soft!
Telling the world why we love mule soft!Telling the world why we love mule soft!
Telling the world why we love mule soft!
 

Similar to Implementation web api

Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST AssuredTO THE NEW Pvt. Ltd.
 
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryIBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryKaren Broughton-Mabbitt
 
Integration on Force.com Platform
Integration on Force.com PlatformIntegration on Force.com Platform
Integration on Force.com PlatformAmit Jain
 
RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHPAndru Weir
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using PhpSudheer Satyanarayana
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend IntegrationElewayte
 
ASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web applicationASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web applicationAMARAAHMED7
 
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...Jitendra Bafna
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptxTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptxkmani5
 

Similar to Implementation web api (20)

Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
 
Web API with ASP.NET MVC by Software development company in india
Web API with ASP.NET  MVC  by Software development company in indiaWeb API with ASP.NET  MVC  by Software development company in india
Web API with ASP.NET MVC by Software development company in india
 
Web api
Web apiWeb api
Web api
 
C# web api
C# web apiC# web api
C# web api
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
 
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryIBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
 
Integration on Force.com Platform
Integration on Force.com PlatformIntegration on Force.com Platform
Integration on Force.com Platform
 
Play with force.com metadata
Play with force.com metadataPlay with force.com metadata
Play with force.com metadata
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHP
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend Integration
 
Introduction to asp.net web api
Introduction to asp.net web apiIntroduction to asp.net web api
Introduction to asp.net web api
 
Standards of rest api
Standards of rest apiStandards of rest api
Standards of rest api
 
ASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web applicationASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web application
 
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptxTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
 

Recently uploaded

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 

Recently uploaded (20)

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 

Implementation web api

  • 1. Implementing Web APIs  Zeeshan Ahmed Khalil (Quantum LHE –Sr. Software engineer)
  • 2. Lesson 1: Developing a Web API  What Is a Web API?  Routing in Web API  Real time Architecture  WCF VS Web API  RESTful Services  Data Return Formats  Using Routes and Controllers in Web API  Demonstration: Web API with tool and Data.
  • 3. What Is a Web API?  Web API:  Helps create REST-style APIs  Enables external systems to use the business logics implemented in your application  Uses URLs in requests and helps obtain results in the JSON format  Is ideal for mobile application integration
  • 4. Routing in Web API Characteristics of routing in Web API:  You can use API controller names and a naming convention for actions to route Web API requests  Alternatively you can use the following attributes to control the mapping of HTTP requests (HTTP Verb+URL) to actions in the controller:  The HttpGet, HttpPut, HttpPost, or HttpDelete attributes  The AcceptVerbs attribute  The ActionName attribute
  • 6.
  • 7. RESTful Services Characteristics of a RESTful Service:  Can be called to retrieve business information from the server  Can create, update, and delete information in a database through HTTP operations  Uses URLs to uniquely identify the entity that it operates on  Uses HTTP verbs to identify the operation that the application needs to perform. The HTTP verbs include:  GET  POST  PUT  DELETE
  • 8. Data Return Formats  Web API can return data in JSON or XML formats  Web API uses the media formatter to:  Format or serialize the information that a Web API REST service returns  Control the media type in the HTTP header  Format all content that the server renders to client systems  Media formatter classes inherit from the MediaTypeFormatter class and the BufferedMediaTypeFormatter class
  • 9. Using Routes and Controllers in Web APIs Routing in ASP.NET MVC4 applications involves the following:  ASP.NET adds a default route to:  Map a URL and a controller  Support the operations of the REST-style Web APIs  You can modify the default route to include multiple actions in the same HTTP method  You can use the WebApiConfig class to:  Modify the routing  Enable multiple versions of API to coexist in the same project
  • 10. Demo  Web Api and Request and Response

Editor's Notes

  1. Question: What is the key benefit of using REST with Web APIs? Answer: REST helps minimize data transfers between the client system and the server, thereby making it ideal for mobile applications. Web API provides the framework for developers to build API access with a lot less effort Developers can use REST for interactions between server and mobile applications. For applications that require complex interactions, developers can use Windows Communication Foundation (WCF), instead of REST, because WCF supports additional functionalities such as sending attachments.
  2. Question: What is the purpose of using the HTTP attributes? Answer: The attributes help control the routing and mapping between HTTP requests and action functions in the MVC controller. You can describe how you can combine the attributes together. For example, you can use HttpGet together with ActionName to map the action to the GET method by using the specified action name.
  3. Question: What is the key benefit of using the routing map? Answer: The routing map enables you to map the action functions to the HTTP method and URL combination. You can provide some real-world examples on how developers modify the routing table, when they include multiple versions of the API. But, this is often not required in most applications.