SlideShare a Scribd company logo
API
APPLICATION
PROGRAMMING
INTERFACE
BY ZUHDI@BERRYBENKA.COM
1
WHAT IS AN API?
In computer programming, an application programming
interface (API) is a set of routines, protocols, and tools for
building software applications. An API expresses a software
component in terms of its operations, inputs, outputs, and
underlying types.
2
WEB APIS
 Web APIs are the defined interfaces through which
interactions happen between an enterprise and
applications that use its assets. Usually in Extensible
Markup Language (XML) or JavaScript Object Notation
(JSON) format.
 API is typically defined as a set of Hypertext Transfer
Protocol (HTTP) request messages.
3
USABILITY OF WEB APIS
Photos can be
shared from sites
like Flickr and
Photobucket to social
network sites like
Facebook and
MySpace.
4
USABILITY OF WEB APIS [2]
Content can be
embedded, e.g.
embedding a
presentation from
SlideShare on a
LinkedIn profile.
5
USABILITY OF WEB APIS [3]
Content can be
dynamically posted.
Sharing live comments
made on Twitter with a
Facebook account, for
example, is enabled
by their APIs. Etc.
6
WEB SERVICES
The two approaches for
interfacing to the web with web
services, namely:
• SOAP (Simple Object
Access Protocol)
• REST (Representational
State Transfer)
7
SOAP VS REST
8
SOAP works on a standard
set of rules based on XML
(eg. HTTP) otherwise REST
supports many format
(JSON, XML,etc) and
doesn’t employ any
additional messaging layer.
SOAP VS REST (USERS)
9
WHAT IS SOAP?
Simple Object Access Protocol (SOAP) is a protocol for
exchange of structured information on a decentralized and
distributed platform using XML (eXtensible Markup
Language).
10
SOAP SIMPLE REQUEST
11
SOAP SIMPLE RESPONSE
12
WHAT IS REST?
Representational State Transfer or REST basically
means that each unique URL is a representation of some
object and supports format like JSON, XML etc.
13
HOW REST WORKS?
14
Using REST, you can get the contents of that object using
an HTTP using some methods like GET, POST, PUT,
DELETE or POST to modify the object.
REST API WITH CURL
 cURL allows you to
connect and communicate
to many different types of
servers with many different
types of protocols.
 cURL currently supports
the http, https, ftp etc.
15
HTTP POST THROUGH CURL
16
HTTP POST THROUGH CURL
[2]
cURL functions:
 curl_init — Initialize a cURL session
 curl_setopt — Set an option for a cURL transfer
• Ch — A cURL handle returned by curl_init().
• Option — The CURLOPT_XXX option to set.
 CURLOPT_URL
 CURLOPT_CUSTOMREQUEST
 CURLOPT_POSTFIELDS
 CURLOPT_RETURNTRANSFER
 CURLOPT_HTTPHEADER
• Value — The value to be set on option.
 curl_exec — Perform a cURL session
 curl_error — Return a string containing the last error for the current
session
 curl_close — Close a cURL session
17
REST CURL SIMPLE REQUEST
18
 URL: http://localhost:8080/api/users/1
 Method: POST
 Content-Type: application/json
REQUEST
REST CURL SIMPLE RESPONSE
19
RESPONSE
SOAP VS REST (2)
20
SOAP VS REST (3)
21
WHY USING SOAP?
22
The main advantages of SOAP web services are:
 Easy to consume – sometimes.
 Rigid – type checking, adheres to a contract (provider and
consumer) have to agree on the exchange format.
 Development tools – using tools
 Can use almost any transport to send the request — SMTP
(Simple Mail Transfer Protocol), JMS (Java Messaging Service).
 Asynchronous processing and invocation—guaranteed level
of reliability and security then ensure this type of operation.
 Stateful operations—provide support to contextual information
and conversational state management. (Security, Transactions,
Coordination, etc).
WHY USING REST?
The main advantages of REST web services are:
1. Lightweight – The requests and responses can be short.
2. Human Readable Results – Flexible & Simple, URIs for Identification
3. Easy to build – No toolkits required
4. Totally stateless operations – Stateless CRUD (Create, Read,
Update, and Delete) operations.
5. Caching situations – Information can be cached because of the totally
stateless operation.
23
URIS FOR IDENTIFICATION
The components of a URI (Uniform Resource Identifier) include:
• Scheme Name—Identifies the protocol (e.g., FTP:, HTTP:,
HTTPS:, IRC:)
• Hierarchical Part—Intended to hold information hierarchical in
nature.
• Query—contains additional identification information that is non-
hierarchical in nature and often separated by a question mark (“?”)
• Fragment—provides direction to a secondary resource within the
primary one identified by the Authority and Path and separated from
the rest by a hash (“#”)
24
SOAP AND REST COMPARISON
25
CONCLUSION
 SOAP requests use POST and require a complex XML while REST
doesn’t.
 SOAP reads cannot be cached on other hand REST could do by a
proxy server.
 REST allows different data formats where SOAP only allows XML.
 REST better performance and scalability.
Continue operations? SOAP it. Stateless operations? REST it.
26
REFERENCES
1. http://www.marutitech.com/soap-vs-rest-a-case-of-
disruptive-innovation/
2. http://carminedimascio.com/2013/09/restful-design-
principles/
3. http://php.net/manual/en/book.curl.php
4. https://en.wikipedia.org/wiki/Application_programming_in
terface
5. http://geeknizer.com/rest-vs-soap-using-http-choosing-
the-right-webservice-protocol/
27
28

More Related Content

What's hot

REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
Ashok Pundit
 
Api testing
Api testingApi testing
Api testing
Keshav Kashyap
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
 
REST API
REST APIREST API
REST API
Tofazzal Ahmed
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
Tessa Mero
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
Patrick Savalle
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
What's an api
What's an apiWhat's an api
What's an api
Jacques Ledoux
 
Restful api
Restful apiRestful api
Restful api
Anurag Srivastava
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
Pricilla Bilavendran
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
Knoldus Inc.
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
Tricode (part of Dept)
 
Webservices
WebservicesWebservices
Webservices
Gerard Sylvester
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
Aiste Stikliute
 
API Best Practices
API Best PracticesAPI Best Practices
API Best Practices
Sai Koppala
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Angular 8
Angular 8 Angular 8
Angular 8
Sunil OS
 
Restful api design
Restful api designRestful api design
Restful api design
Mizan Riqzia
 
API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
Prakash Bhandari
 

What's hot (20)

REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
Api testing
Api testingApi testing
Api testing
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
REST API
REST APIREST API
REST API
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
What's an api
What's an apiWhat's an api
What's an api
 
Restful api
Restful apiRestful api
Restful api
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
Webservices
WebservicesWebservices
Webservices
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
API Best Practices
API Best PracticesAPI Best Practices
API Best Practices
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Restful api design
Restful api designRestful api design
Restful api design
 
API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
 

Similar to What is an API?

Build your APIs with apigility
Build your APIs with apigilityBuild your APIs with apigility
Build your APIs with apigility
Christian Varela
 
A RESTful Extension Of OPC UA
A RESTful Extension Of OPC UAA RESTful Extension Of OPC UA
A RESTful Extension Of OPC UA
Gina Rizzo
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
IRJET Journal
 
Api 101
Api 101Api 101
Api 101
DrSimoneDiCola
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
Charlin Agramonte
 
REST != WebAPI
REST != WebAPIREST != WebAPI
REST != WebAPI
Dan (Danut) Prisacaru
 
Web Service
Web ServiceWeb Service
Web Service
Ashwani kumar
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
Tim Burks
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
Michael Koster
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling ResolutionDEEPAK KHETAWAT
 
Hypermedia for Machine APIs
Hypermedia for Machine APIsHypermedia for Machine APIs
Hypermedia for Machine APIs
Michael Koster
 
Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0
Aravindharamanan S
 
API Testing Basics.pptx
API Testing Basics.pptxAPI Testing Basics.pptx
API Testing Basics.pptx
VikasGupta92111
 
Soap Standard
Soap StandardSoap Standard
Soap Standard
Kumar
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
Payal Jain
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
Jean Michel
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
Betclic Everest Group Tech Team
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
Sudheer Satyanarayana
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHP
Zoran Jeremic
 

Similar to What is an API? (20)

Build your APIs with apigility
Build your APIs with apigilityBuild your APIs with apigility
Build your APIs with apigility
 
A RESTful Extension Of OPC UA
A RESTful Extension Of OPC UAA RESTful Extension Of OPC UA
A RESTful Extension Of OPC UA
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
 
Api 101
Api 101Api 101
Api 101
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
 
REST != WebAPI
REST != WebAPIREST != WebAPI
REST != WebAPI
 
Web Service
Web ServiceWeb Service
Web Service
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 
Hypermedia for Machine APIs
Hypermedia for Machine APIsHypermedia for Machine APIs
Hypermedia for Machine APIs
 
Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0
 
API Testing Basics.pptx
API Testing Basics.pptxAPI Testing Basics.pptx
API Testing Basics.pptx
 
Soap Standard
Soap StandardSoap Standard
Soap Standard
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHP
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 

What is an API?

  • 2. WHAT IS AN API? In computer programming, an application programming interface (API) is a set of routines, protocols, and tools for building software applications. An API expresses a software component in terms of its operations, inputs, outputs, and underlying types. 2
  • 3. WEB APIS  Web APIs are the defined interfaces through which interactions happen between an enterprise and applications that use its assets. Usually in Extensible Markup Language (XML) or JavaScript Object Notation (JSON) format.  API is typically defined as a set of Hypertext Transfer Protocol (HTTP) request messages. 3
  • 4. USABILITY OF WEB APIS Photos can be shared from sites like Flickr and Photobucket to social network sites like Facebook and MySpace. 4
  • 5. USABILITY OF WEB APIS [2] Content can be embedded, e.g. embedding a presentation from SlideShare on a LinkedIn profile. 5
  • 6. USABILITY OF WEB APIS [3] Content can be dynamically posted. Sharing live comments made on Twitter with a Facebook account, for example, is enabled by their APIs. Etc. 6
  • 7. WEB SERVICES The two approaches for interfacing to the web with web services, namely: • SOAP (Simple Object Access Protocol) • REST (Representational State Transfer) 7
  • 8. SOAP VS REST 8 SOAP works on a standard set of rules based on XML (eg. HTTP) otherwise REST supports many format (JSON, XML,etc) and doesn’t employ any additional messaging layer.
  • 9. SOAP VS REST (USERS) 9
  • 10. WHAT IS SOAP? Simple Object Access Protocol (SOAP) is a protocol for exchange of structured information on a decentralized and distributed platform using XML (eXtensible Markup Language). 10
  • 13. WHAT IS REST? Representational State Transfer or REST basically means that each unique URL is a representation of some object and supports format like JSON, XML etc. 13
  • 14. HOW REST WORKS? 14 Using REST, you can get the contents of that object using an HTTP using some methods like GET, POST, PUT, DELETE or POST to modify the object.
  • 15. REST API WITH CURL  cURL allows you to connect and communicate to many different types of servers with many different types of protocols.  cURL currently supports the http, https, ftp etc. 15
  • 16. HTTP POST THROUGH CURL 16
  • 17. HTTP POST THROUGH CURL [2] cURL functions:  curl_init — Initialize a cURL session  curl_setopt — Set an option for a cURL transfer • Ch — A cURL handle returned by curl_init(). • Option — The CURLOPT_XXX option to set.  CURLOPT_URL  CURLOPT_CUSTOMREQUEST  CURLOPT_POSTFIELDS  CURLOPT_RETURNTRANSFER  CURLOPT_HTTPHEADER • Value — The value to be set on option.  curl_exec — Perform a cURL session  curl_error — Return a string containing the last error for the current session  curl_close — Close a cURL session 17
  • 18. REST CURL SIMPLE REQUEST 18  URL: http://localhost:8080/api/users/1  Method: POST  Content-Type: application/json REQUEST
  • 19. REST CURL SIMPLE RESPONSE 19 RESPONSE
  • 20. SOAP VS REST (2) 20
  • 21. SOAP VS REST (3) 21
  • 22. WHY USING SOAP? 22 The main advantages of SOAP web services are:  Easy to consume – sometimes.  Rigid – type checking, adheres to a contract (provider and consumer) have to agree on the exchange format.  Development tools – using tools  Can use almost any transport to send the request — SMTP (Simple Mail Transfer Protocol), JMS (Java Messaging Service).  Asynchronous processing and invocation—guaranteed level of reliability and security then ensure this type of operation.  Stateful operations—provide support to contextual information and conversational state management. (Security, Transactions, Coordination, etc).
  • 23. WHY USING REST? The main advantages of REST web services are: 1. Lightweight – The requests and responses can be short. 2. Human Readable Results – Flexible & Simple, URIs for Identification 3. Easy to build – No toolkits required 4. Totally stateless operations – Stateless CRUD (Create, Read, Update, and Delete) operations. 5. Caching situations – Information can be cached because of the totally stateless operation. 23
  • 24. URIS FOR IDENTIFICATION The components of a URI (Uniform Resource Identifier) include: • Scheme Name—Identifies the protocol (e.g., FTP:, HTTP:, HTTPS:, IRC:) • Hierarchical Part—Intended to hold information hierarchical in nature. • Query—contains additional identification information that is non- hierarchical in nature and often separated by a question mark (“?”) • Fragment—provides direction to a secondary resource within the primary one identified by the Authority and Path and separated from the rest by a hash (“#”) 24
  • 25. SOAP AND REST COMPARISON 25
  • 26. CONCLUSION  SOAP requests use POST and require a complex XML while REST doesn’t.  SOAP reads cannot be cached on other hand REST could do by a proxy server.  REST allows different data formats where SOAP only allows XML.  REST better performance and scalability. Continue operations? SOAP it. Stateless operations? REST it. 26
  • 27. REFERENCES 1. http://www.marutitech.com/soap-vs-rest-a-case-of- disruptive-innovation/ 2. http://carminedimascio.com/2013/09/restful-design- principles/ 3. http://php.net/manual/en/book.curl.php 4. https://en.wikipedia.org/wiki/Application_programming_in terface 5. http://geeknizer.com/rest-vs-soap-using-http-choosing- the-right-webservice-protocol/ 27
  • 28. 28