SlideShare a Scribd company logo
Welcome!
• We’ll use postman for some of our examples. If you would like to follow along,
download postman now. www.getpostman.com.
• Feel free to pair with someone!
• Our Postman demo collection will be available with our presentation materials.
• Follow @apidemo_carter onTwitter!
JoEllen Carter / Lisa Crispin
Overview
• What is an API?
• History of API growth
• Current API landscape
• HowAPIs work, including some hands-on demos
• Strategies and tools for testing an API
• API Stories
What is an
Application
Programming
Interface?
!!!
Interfaces
• Touch
• Voice
• Sight
Api FUNdamentals #MHA2017
API
Your
application The world !!!
2000 2002 2004 2006 2008
Api FUNdamentals #MHA2017
Why RESTful?
• REST: Representational state transfer
• Uniform and predefined set of stateless
operations
• People can “just know things” about an API
that’s RESTful
Api FUNdamentals #MHA2017
How does an
Application Programming
Interface
Work?
RPC SOAP HTTP HTTPS CoAP …
HTTPRequest
URL
Method
Headers
Body
URL
https://api.twitter.com/1.1/statuses/update.json?status=testing
{base url} / {version} / {endpoint} ? {query parameters}
GET
• Get some data about an object or
‘resource’
POST • Create a new resource
PUT • Update a resource
DELETE • Delete a resource
Methods
Headers
• Headers are key/value combinations that specify
additional information about the request
• Some common request headers are:
• Content-type
• Authentication
• Accept
• Origin
Body
• Data to send with the
request – usually for a
POST or PUT
• Data format – xml,
json, etc. - is specified
by the content-type
header
{
"location": {
"lat": -33.8669710,
"lng": 151.1958750
},
"accuracy": 50,
"name": "Google Shoes!",
"phone_number": "(02) 9374
4000",
"address": "48 Pirrama Road,
Pyrmont, NSW 2009, Australia",
"types": ["shoe_store"],
"website":
"http://www.google.com.au/",
"language": "en-AU"
}
What about cookies?
• Restful API requests should be self-reliant
• Cookies are session-dependent, so not
independent
• Using cookies to store data means your
API is not Restful
Authentication
• Insecure - Authorization token in url
• https://api.darksky.net/forecast/{{token}}
/39.9026420,-105.0905190
• https://maps.googleapis.com/maps/api/p
lace/nearbysearch/json?key={{googlema
psKey}}
• Basic
• Username:password are concatenated
and encoded
• Sent in Authorization header
Authentication - Oauth
• Oauth1/2 - https://oauth.net/
Service Provider
Api FUNdamentals #MHA2017
Authentication - JWT
JSON WebToken https://jwt.io/ - an open standard (RFC 7519)
that defines a compact and self-contained way for securely
transmitting information between parties as a JSON object.
• Header – type of token (JWT) and hashing (signing) algorithm
• Payload – contains ‘claims’, or information about the user
• Signature = signature from header-specified algorithm using
encoded Header + encoded payload + secret
Let’s try a GET now…
• We’ll hit the dark sky api to get our current
weather
HTTPResponse
URL
Status Code
Headers
Body
OK200
Bad Request400
Forbidden403
Not Found404
Internal Server Error500
Service Unavailable503
GatewayTimeout504
Common
Status
Codes
Let’s try a POST now…
• We’ll post a tweet from #MHA2017
How do we
test
API’s?
Security
• Basic
• Authentication tokens are valid/present
• Account boundaries are not violated
• SSL is enforced/warned when not present
• Hacker-in-training
• Injection points – headers, parameters, body
• Recording tools – what is exposed/available
• White Hat hacker - OWASP
• Rest Security Cheat Sheet
• OWASP top 10 security vulnerabilities – new
section on Under-protected APIs
Functional
• Basic
• Correct status codes are generated for invalid
inputs
• Request/response bodies contain the correct
content type and schema
• Backwards-compatibility for public APIs -
previous tests continue to pass or breaking
changes are clearly documented – aka
regression testing
• Advanced
• Join API requests together to mirror application
functionality
Exploratory
• Identify the variable bits - things that can/will/might
change
• Requests –
• Method
• Mix/match endpoints
• Parameters
• Headers, especially content type
• ContentType
• Size, Depth - images, json/xml nesting
• Timing & Frequency – what happens with caching?
Heuristics
• Apply Heuristics to the variables
• Zero, One, Many
• Some, None,All
• Beginning, Middle, End
• Too Many,Too Few
• Relative Position, i.e. content
Automation
• Part of your CI/CD pipeline
• Part of development process since tests can be
run in both local and pre-production
environments
• Performance
• Combine tests with monitoring
• Tools
• Postman
• Command line runner that can be integrated
into your CI
• Developer adoption is high
• Runscope
• Powerful code snippets
Supporting an API
Tracker API, rewritten in 2012-13
• Our own client software uses public API, same as customers
• With some private endpoints
• Leading practices: RESTful, JSON in & out,
• Versioning
• Only changes are additions
• Promote new endpoints through various stages
• “edge” version
• Metadata-driven
• Reference doc generated from metadata and unit test outputs
Long-term results
• Few support requests
• Thanks to comprehensive unit tests, comprehensive doc & examples
• Comprehensive doc for devs to introduce new endpoints
• Many new endpoints added
• Mostly without pain – one backwards compatibility issue
• Postman regression tests run in CI in addition to unit tests
• Include performance checks
Questions? Stories?
Take-aways
• APIs are the engine behind the apps we
use every day
• APIs are an integral part of our agile
processes - APIs make apps more testable,
and can be tested!
• APIs add value to your product - maybe
your company/product/team needs an
API?
• You’ve learned some terms about RESTful
web services – go forth and learn more!
Links
• ProgrammableWeb
• API Security Testing
• OWASPTop 10 Project
• List of HTTP Header fields
• Varonis - Introduction to Oauth
• Oauth.net
• Understanding rest and rpc

More Related Content

PDF
PDF
Micro Services - Small is Beautiful
PDF
Micro Service – The New Architecture Paradigm
PPTX
Api crash
PPTX
To the cloud!
PPTX
AWS User Group - Survey Results and Building APIs on AWS
PDF
Micro Services - Smaller is Better?
PPTX
Web Planning an Effective Integration with a 3rd party API to Scale
Micro Services - Small is Beautiful
Micro Service – The New Architecture Paradigm
Api crash
To the cloud!
AWS User Group - Survey Results and Building APIs on AWS
Micro Services - Smaller is Better?
Web Planning an Effective Integration with a 3rd party API to Scale

What's hot (16)

PDF
Assuring the code quality of share point solutions and apps - Matthias Einig
PDF
Micro Services - Neither Micro Nor Service
PPTX
Postman Introduction
PPTX
Process Orchestration with Flowable and Spring Boot
PPTX
Practical Application of API-First in microservices development
PDF
Continuous Delivery and Micro Services - A Symbiosis
PPTX
Continuous Integration and Delivery at Shapeways (Matt Boyle)
PDF
AOEcon17: Searchperience - The journey from PHP and Solr to Scala and Elastic...
PDF
PDF
Java Architectures - a New Hope
PDF
Agile North East Agile + DevOps by Craig Pearson of CAP Project Services
PPTX
DevCon 2018 - 5 ways to use AWS with Alfresco
PDF
Mocking APIs Collaboratively with Postman
PPTX
Selenium-4-and-appium-2
PPTX
Selenium-4
PPTX
Vs java (1)
Assuring the code quality of share point solutions and apps - Matthias Einig
Micro Services - Neither Micro Nor Service
Postman Introduction
Process Orchestration with Flowable and Spring Boot
Practical Application of API-First in microservices development
Continuous Delivery and Micro Services - A Symbiosis
Continuous Integration and Delivery at Shapeways (Matt Boyle)
AOEcon17: Searchperience - The journey from PHP and Solr to Scala and Elastic...
Java Architectures - a New Hope
Agile North East Agile + DevOps by Craig Pearson of CAP Project Services
DevCon 2018 - 5 ways to use AWS with Alfresco
Mocking APIs Collaboratively with Postman
Selenium-4-and-appium-2
Selenium-4
Vs java (1)
Ad

Similar to Api FUNdamentals #MHA2017 (20)

PDF
Api fundamentals
PPTX
Apitesting.pptx
PDF
Api Testing.pdf
PDF
API testing Notes and features, difference.pdf
PDF
Agile Testing Days 2018 USA - API Testing Fundamentals
PPTX
Soap UI and postman
PPTX
Api Testing
PPTX
Api Testing
PPTX
API testing - Japura.pptx
PPTX
Best Practices for Architecting a Pragmatic Web API.
PDF
API Testing. Streamline your testing process.
PDF
Api Design and More (Friday Training at Itnig)
PPTX
API Testing Using REST Assured with TestNG
PPT
Postman.ppt
PPTX
Standards of rest api
ODP
Attacking REST API
PDF
Facebook & Twitter API
PPTX
Rest Webservice
PDF
REST API Basics
Api fundamentals
Apitesting.pptx
Api Testing.pdf
API testing Notes and features, difference.pdf
Agile Testing Days 2018 USA - API Testing Fundamentals
Soap UI and postman
Api Testing
Api Testing
API testing - Japura.pptx
Best Practices for Architecting a Pragmatic Web API.
API Testing. Streamline your testing process.
Api Design and More (Friday Training at Itnig)
API Testing Using REST Assured with TestNG
Postman.ppt
Standards of rest api
Attacking REST API
Facebook & Twitter API
Rest Webservice
REST API Basics
Ad

More from JoEllen Carter (6)

TXT
Agile Testing Days 2018 - API Fundamentals - postman collection
DOCX
Mapping Mashup Story Mapping Exercise 3 uncolored cards
DOCX
Mapping Mashup Exercise solutions
PDF
Mapping Mashup Exercise handouts
PPTX
Atd 2016-mapping-mashup
PDF
Agile testing to build the right thing - Lisa Crispin and JoEllen Carter
Agile Testing Days 2018 - API Fundamentals - postman collection
Mapping Mashup Story Mapping Exercise 3 uncolored cards
Mapping Mashup Exercise solutions
Mapping Mashup Exercise handouts
Atd 2016-mapping-mashup
Agile testing to build the right thing - Lisa Crispin and JoEllen Carter

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
KodekX | Application Modernization Development
PPTX
Cloud computing and distributed systems.
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Machine learning based COVID-19 study performance prediction
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
Review of recent advances in non-invasive hemoglobin estimation
Diabetes mellitus diagnosis method based random forest with bat algorithm
Reach Out and Touch Someone: Haptics and Empathic Computing
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KodekX | Application Modernization Development
Cloud computing and distributed systems.
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Machine learning based COVID-19 study performance prediction
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology

Api FUNdamentals #MHA2017

  • 1. Welcome! • We’ll use postman for some of our examples. If you would like to follow along, download postman now. www.getpostman.com. • Feel free to pair with someone! • Our Postman demo collection will be available with our presentation materials. • Follow @apidemo_carter onTwitter!
  • 2. JoEllen Carter / Lisa Crispin
  • 3. Overview • What is an API? • History of API growth • Current API landscape • HowAPIs work, including some hands-on demos • Strategies and tools for testing an API • API Stories
  • 5. !!!
  • 9. 2000 2002 2004 2006 2008
  • 11. Why RESTful? • REST: Representational state transfer • Uniform and predefined set of stateless operations • People can “just know things” about an API that’s RESTful
  • 13. How does an Application Programming Interface Work?
  • 14. RPC SOAP HTTP HTTPS CoAP …
  • 17. GET • Get some data about an object or ‘resource’ POST • Create a new resource PUT • Update a resource DELETE • Delete a resource Methods
  • 18. Headers • Headers are key/value combinations that specify additional information about the request • Some common request headers are: • Content-type • Authentication • Accept • Origin
  • 19. Body • Data to send with the request – usually for a POST or PUT • Data format – xml, json, etc. - is specified by the content-type header { "location": { "lat": -33.8669710, "lng": 151.1958750 }, "accuracy": 50, "name": "Google Shoes!", "phone_number": "(02) 9374 4000", "address": "48 Pirrama Road, Pyrmont, NSW 2009, Australia", "types": ["shoe_store"], "website": "http://www.google.com.au/", "language": "en-AU" }
  • 20. What about cookies? • Restful API requests should be self-reliant • Cookies are session-dependent, so not independent • Using cookies to store data means your API is not Restful
  • 21. Authentication • Insecure - Authorization token in url • https://api.darksky.net/forecast/{{token}} /39.9026420,-105.0905190 • https://maps.googleapis.com/maps/api/p lace/nearbysearch/json?key={{googlema psKey}} • Basic • Username:password are concatenated and encoded • Sent in Authorization header
  • 22. Authentication - Oauth • Oauth1/2 - https://oauth.net/ Service Provider
  • 24. Authentication - JWT JSON WebToken https://jwt.io/ - an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. • Header – type of token (JWT) and hashing (signing) algorithm • Payload – contains ‘claims’, or information about the user • Signature = signature from header-specified algorithm using encoded Header + encoded payload + secret
  • 25. Let’s try a GET now… • We’ll hit the dark sky api to get our current weather
  • 27. OK200 Bad Request400 Forbidden403 Not Found404 Internal Server Error500 Service Unavailable503 GatewayTimeout504 Common Status Codes
  • 28. Let’s try a POST now… • We’ll post a tweet from #MHA2017
  • 30. Security • Basic • Authentication tokens are valid/present • Account boundaries are not violated • SSL is enforced/warned when not present • Hacker-in-training • Injection points – headers, parameters, body • Recording tools – what is exposed/available • White Hat hacker - OWASP • Rest Security Cheat Sheet • OWASP top 10 security vulnerabilities – new section on Under-protected APIs
  • 31. Functional • Basic • Correct status codes are generated for invalid inputs • Request/response bodies contain the correct content type and schema • Backwards-compatibility for public APIs - previous tests continue to pass or breaking changes are clearly documented – aka regression testing • Advanced • Join API requests together to mirror application functionality
  • 32. Exploratory • Identify the variable bits - things that can/will/might change • Requests – • Method • Mix/match endpoints • Parameters • Headers, especially content type • ContentType • Size, Depth - images, json/xml nesting • Timing & Frequency – what happens with caching?
  • 33. Heuristics • Apply Heuristics to the variables • Zero, One, Many • Some, None,All • Beginning, Middle, End • Too Many,Too Few • Relative Position, i.e. content
  • 34. Automation • Part of your CI/CD pipeline • Part of development process since tests can be run in both local and pre-production environments • Performance • Combine tests with monitoring • Tools • Postman • Command line runner that can be integrated into your CI • Developer adoption is high • Runscope • Powerful code snippets
  • 35. Supporting an API Tracker API, rewritten in 2012-13 • Our own client software uses public API, same as customers • With some private endpoints • Leading practices: RESTful, JSON in & out, • Versioning • Only changes are additions • Promote new endpoints through various stages • “edge” version • Metadata-driven • Reference doc generated from metadata and unit test outputs
  • 36. Long-term results • Few support requests • Thanks to comprehensive unit tests, comprehensive doc & examples • Comprehensive doc for devs to introduce new endpoints • Many new endpoints added • Mostly without pain – one backwards compatibility issue • Postman regression tests run in CI in addition to unit tests • Include performance checks
  • 38. Take-aways • APIs are the engine behind the apps we use every day • APIs are an integral part of our agile processes - APIs make apps more testable, and can be tested! • APIs add value to your product - maybe your company/product/team needs an API? • You’ve learned some terms about RESTful web services – go forth and learn more!
  • 39. Links • ProgrammableWeb • API Security Testing • OWASPTop 10 Project • List of HTTP Header fields • Varonis - Introduction to Oauth • Oauth.net • Understanding rest and rpc