SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
API Design & Devp with AT
What is an API
Similarly, an API lists a bunch of
operations that developers can use,
along with a description of what they
do.
How an API works
API protocols and Architecture
SOAP
XML used as data format,
- Too verbose on client and
server side
- Still used by banks and
Telcos
REST
GraphQL
HTTP Basics
Anatomy of an HTTP Request
- The version of the HTTP protocol.
- Optional headers that convey additional information
for the servers.
- Body, for some methods like POST, similar to those in
responses, which contain the resource sent.
Anatomy of an HTTP Response
- HTTP version protocol they follow.
- Status code indicating if the
request has been successful, or
not, and why.
- Status message a
non-authoritative short description
of the status code.
- HTTP headers like those for
requests.
- Optionally a body containing the
fetched resource.
Representing Data: REST Data formats
curl -i -u application_name:application_password
--data '{"password": "my_password"}'
http://localhost/myapi/1/auth?username=my_usernam
e --header 'Content-Type: application/json'
--header 'Accept: application/json'
API Authentication
- There are three common API
authentication schemes;
- Basic Auth
- API keys
- OAuth
Authentication: Basic Authentication
- Basic Auth only requires a
username and password.
- Passed on via Authorization
HTTP header
- Server returns http code 401 to let
client know authorization failed
API Key Authentication
- key is usually a long series of letters
and numbers that is distinct from the
account owner's login password
- keys are used simply so the user
does not have to give out their
password
- You can put the key in the
Authorization header or add the key
onto the URL
(http://example.com?api_key=my_se
cret_key)
Open Authorization (OAuth)
- Automates key exchange by providing a
standard way for the client to get a key from
server through walking user via simple steps.
- OAuth 2 involves;
- User: Person who wants to connect two
websites they use
- Client: Website that will be granted
access to the user's data
- Server: website that has the user's
data
API design basics
- Resources are the nouns of APIs
- Key pointers;
- Decide what resource(s) need to be
available.
- Assign URLs to those resources.
- Decide what actions the client should
be allowed to perform on those
resources.
- Figure out what pieces of data are
required for each action and what
format they should be in.
Example Rest API actions & url endpoints
API Development & testing tools
Try out Africa’s Talking APIs
Thank You
David Okwii,
Developer relations, Africa’s talking
dokwi@africastalking.com
@oquidave on Twitter
More cool Resources:
● Api security checklist
https://github.com/shieldfy/API-Security-Checklist
● API best practices:
https://www.vinaysahni.com/best-practices-for-a-prag
matic-restful-api
● Mozilla:
https://developer.mozilla.org/en-US/docs/Web/HTTP/
Overview
● Zapier: https://zapier.com/learn/apis/

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Bt0083, server side programming theory
Bt0083, server side programming theoryBt0083, server side programming theory
Bt0083, server side programming theory
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural Style
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
Site opsys
Site opsysSite opsys
Site opsys
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 
SQL Injection Attacks
SQL Injection AttacksSQL Injection Attacks
SQL Injection Attacks
 
JSON and REST
JSON and RESTJSON and REST
JSON and REST
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web Services
 
gofortution
gofortutiongofortution
gofortution
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
Top open source tools to consider for web service performance testing
Top open source tools to consider for web service performance testingTop open source tools to consider for web service performance testing
Top open source tools to consider for web service performance testing
 
Intro to flask2
Intro to flask2Intro to flask2
Intro to flask2
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
 
Web crawler
Web crawlerWeb crawler
Web crawler
 
Day01 api
Day01   apiDay01   api
Day01 api
 
Rest api-basic
Rest api-basicRest api-basic
Rest api-basic
 
Cors (cross origin request sharing) in mule
Cors (cross origin request sharing) in muleCors (cross origin request sharing) in mule
Cors (cross origin request sharing) in mule
 
Restful api
Restful apiRestful api
Restful api
 
Learn How To Use CA PPM REST API in 2 minutes!
Learn How To Use CA PPM REST API in 2 minutes!Learn How To Use CA PPM REST API in 2 minutes!
Learn How To Use CA PPM REST API in 2 minutes!
 

Semelhante a Api design and development

REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
DEEPAK KHETAWAT
 
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座
Li Yi
 

Semelhante a Api design and development (20)

Best Practices in Api Design
Best Practices in Api DesignBest Practices in Api Design
Best Practices in Api Design
 
Restful web services
Restful web servicesRestful web services
Restful web services
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Hia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyHia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economy
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
RAML - The architecture
RAML  - The architectureRAML  - The architecture
RAML - The architecture
 
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
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
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...
 
Lunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's GuideLunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's Guide
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座
 
Web services - REST and SOAP
Web services - REST and SOAPWeb services - REST and SOAP
Web services - REST and SOAP
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Api design and development

  • 1. API Design & Devp with AT
  • 2. What is an API Similarly, an API lists a bunch of operations that developers can use, along with a description of what they do.
  • 3. How an API works
  • 4. API protocols and Architecture
  • 5. SOAP XML used as data format, - Too verbose on client and server side - Still used by banks and Telcos
  • 9. Anatomy of an HTTP Request - The version of the HTTP protocol. - Optional headers that convey additional information for the servers. - Body, for some methods like POST, similar to those in responses, which contain the resource sent.
  • 10. Anatomy of an HTTP Response - HTTP version protocol they follow. - Status code indicating if the request has been successful, or not, and why. - Status message a non-authoritative short description of the status code. - HTTP headers like those for requests. - Optionally a body containing the fetched resource.
  • 11. Representing Data: REST Data formats curl -i -u application_name:application_password --data '{"password": "my_password"}' http://localhost/myapi/1/auth?username=my_usernam e --header 'Content-Type: application/json' --header 'Accept: application/json'
  • 12. API Authentication - There are three common API authentication schemes; - Basic Auth - API keys - OAuth
  • 13. Authentication: Basic Authentication - Basic Auth only requires a username and password. - Passed on via Authorization HTTP header - Server returns http code 401 to let client know authorization failed
  • 14. API Key Authentication - key is usually a long series of letters and numbers that is distinct from the account owner's login password - keys are used simply so the user does not have to give out their password - You can put the key in the Authorization header or add the key onto the URL (http://example.com?api_key=my_se cret_key)
  • 15. Open Authorization (OAuth) - Automates key exchange by providing a standard way for the client to get a key from server through walking user via simple steps. - OAuth 2 involves; - User: Person who wants to connect two websites they use - Client: Website that will be granted access to the user's data - Server: website that has the user's data
  • 16. API design basics - Resources are the nouns of APIs - Key pointers; - Decide what resource(s) need to be available. - Assign URLs to those resources. - Decide what actions the client should be allowed to perform on those resources. - Figure out what pieces of data are required for each action and what format they should be in.
  • 17. Example Rest API actions & url endpoints
  • 18. API Development & testing tools
  • 19. Try out Africa’s Talking APIs
  • 20. Thank You David Okwii, Developer relations, Africa’s talking dokwi@africastalking.com @oquidave on Twitter More cool Resources: ● Api security checklist https://github.com/shieldfy/API-Security-Checklist ● API best practices: https://www.vinaysahni.com/best-practices-for-a-prag matic-restful-api ● Mozilla: https://developer.mozilla.org/en-US/docs/Web/HTTP/ Overview ● Zapier: https://zapier.com/learn/apis/