SlideShare a Scribd company logo
Thomas Dutrion / @tdutrion - March 2015
Introduction to Apigility
API Development made easy
updated for
About me
@tdutrion / @engineor / thomas@engineor.com
PHP enthusiast
Founder and developer/architect at Engineor
Working with Zend Framework since 2009
API based architecture
● Multiplication of the device types and size
● Server side software independent from clients
● Public access to data
=> API-First development: api-first.com
Introduction to Apigility
Implementation issues
● How to standardise an API?
● What are the best practices?
● How to enable multiple clients with a single backend?
=> Read blog.apigee.com
Introduction to Apigility
API basics
Introduction to Apigility
● Architecture
● Output format standards
RPC:
Remote Procedure Call is a
distributed architecture where a
client execute a procedure on a
distant machine (server)
Architecture
REST:
Representational State Transfer is an
architecture where a client manage
distant resources using HTTP verbs.
Introduction to Apigility
Example:
GET http://your_api/get-current-time
POST http://your_api/send-email
Example:
GET http://your_api/contact
POST http://your_api/contact
GET http://your_api/contact/id
POST http://your_api/contact/id
PUT http://your_api/contact/id
PATCH http://your_api/contact/id
DELETE http://your_api/contact/id
JSON
application/json
{
“name”: “edPug”,
“type”: “meetup”
}
Output format standards
JSON HAL
application/hal+json
{
“_links”: {
“self”: {
“href”: “http://localhost:8000/meetups/1”
}
}
“name”: “edPug”,
“type”: “meetup”
}
Introduction to Apigility
Provide context to the entity / collection, self descriptive API
A tool to build your API
● Generate your project structure
● Leave all the configuration to the
GUI
● Focus on the business layer and only
write the content of your methods
Introduction to Apigility
Apigility has been created by Zend and the community to handle all the non-business code
and configurations
Content negotiation
● Let the user (frontend developer)
decide the output type he wants
● Build-in JSON and HAL JSON types,
you can add your own
● Based on the accept header
Introduction to Apigility
The documentation is a good example to test different output type on the same resource
Documentation
● Build-in documentation generator
● Can be extended with Swagger for
public documentation
● Generated from the fields and
constraints given within the GUI
Introduction to Apigility
Documentation is always one of the most important and neglected points in API projects
Self-descriptive API allow Apigility to build the documentation automatically
application/problem+json
{
“type”:
“/api/problems/forbidden”,
“title”: “Forbidden”,
“detail”: “Your API key is
missing or invalid.”,
“status”: 403,
“authenticationUrl”:
“/api/oauth”
}
Error handling
Introduction to Apigility
https://tools.ietf.org/html/draft-nottingham-http-problem-07
HTTP Problem RFC
● Standard error message
● Use http status code
● Help your frontend developers to
deal with errors
Authentication
● HTTP Simple
● HTTP Digest
● OAuth2
Multiple oauth scenarios, all
described in the documentation
Introduction to Apigility
https://apigility.org/documentation/auth/authentication-about
Versioning
● https://blog.apigee.com/detail/restful_api_design_how_many_versions
● https://blog.apigee.
com/detail/api_restful_design_question_verisioning_number_in_the_url
Apigility provides a built in versioning
You can specify the version through url or headers at your convenience
Introduction to Apigility
https://apigility.org/documentation/api-primer/versioning
Concrete introduction to Apigility
History:
● Announced during the ZendCon
US in October 2013
● First release 8th October 2013
(version 0.6.0)
● Skeleton application currently in
version 1.0.4
Introduction to Apigility
Problems solved:
● Standardising APIs
● Rapid API centric application
development
● APIs for file upload as well
● Give access to fast and clean API
development for non developers
(database connected API)
Installation
● Using Composer
● Using the auto installer
● Using the archive download
● Using the skeleton or as a dependance
Introduction to Apigility
Watch the demo: https://www.youtube.com/watch?v=cE2rwGi437I
Create a database connected API
Introduction to Apigility
Watch the demo: https://www.youtube.com/watch?v=KYsOCCPrOwE
● Use HTTP verbs to query resources
● Fetch automatically data from the table
● The demo does not show a full CRUD, try it yourself, it’s easy!
Add an authentication
● Add an HTTP Basic authentication
● Not very dynamic (requires to change htpasswd for each new user)
● Requires HTTPS
=> good for internal projects or non critical project, prefer oauth in most cases
Introduction to Apigility
Watch the demo: https://www.youtube.com/watch?v=0I_rTFRQid0
Add a version
● Generate new files in background
● Use accept header to select a version
● Use a route parameter to select a version
Introduction to Apigility
Watch the demo: https://www.youtube.com/watch?v=Nt4BNn3QRoQ
Quick and dirty example:
Injecting your tools
● Productivity: know your tools
● Apigility provides factories
● Composer is included
Introduction to Apigility
Using Doctrine is officially supported (https://github.com/zfcampus/zf-apigility-doctrine), do not copy
this slide example!
Live demonstration
Introduction to Apigility
What’s next?
https://twitter.com/julienguittard/status/574980150409969664
Introduction to Apigility
● Decoupled components
● Release end of 2015
● New version of Apigility using ZF3
HTTP middleware stack (PSR-7)
https://twitter.com/ezimuel/status/562911967149850625
Questions?
Thanks to:
● Enrico Zimuel / @ezimuel - https://speakerdeck.com/ezimuel/apigility-the-api-builder-for-php
● Enrico Zimuel / @ezimuel - http://goo.gl/io7nqO
● Rob Allen / @akrabat - http://akrabat.com/wp-content/uploads/20140318-phpne-apigility-intro.pdf
http://akrabat.com/wp-content/uploads/2015-02-20-phpuk-apigility.pdf
Introduction to Apigility
Feel free to comment: http://www.slideshare.net/engineor/introduction-to-apigility-v2-glasgow-php

More Related Content

PPTX
Apigility & Restfull APIs
PDF
Introduction to Apigility
PDF
Apigility – Lightning Fast API Development - OSSCamp 2014
PDF
Quick run in with Swagger
PPTX
Rest API with Swagger and NodeJS
PPTX
Building APIs with Node.js and Swagger
PDF
Implement Web API with Swagger
PDF
Get Your Node.js API Swaggering with OpenAPI Spec
Apigility & Restfull APIs
Introduction to Apigility
Apigility – Lightning Fast API Development - OSSCamp 2014
Quick run in with Swagger
Rest API with Swagger and NodeJS
Building APIs with Node.js and Swagger
Implement Web API with Swagger
Get Your Node.js API Swaggering with OpenAPI Spec

What's hot (20)

PDF
Acceptance & Functional Testing with Codeception - Devspace 2015
PDF
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
PPTX
PDF
Intro To React Native
PDF
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
PDF
Introduction to React Native
PDF
Getting Started with React Native (and should I use it at all?)
PPTX
API Design first with Swagger
PPTX
AngularJS: Service, factory & provider
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
PDF
Philip Shurpik "Architecting React Native app"
PPTX
React Native for ReactJS Devs
PDF
Full Stack Flutter Testing
PDF
The Road to Native Web Components
PDF
AngularJS and Protractor
PPTX
Automated Testing using JavaScript
PDF
Crystal clear service interfaces w/ Swagger/OpenAPI
DOCX
Protractor end-to-end testing framework for angular js
PPT
Intro to Service Worker API and its use cases
PPT
Six Steps To Build A Successful API
Acceptance & Functional Testing with Codeception - Devspace 2015
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Intro To React Native
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Introduction to React Native
Getting Started with React Native (and should I use it at all?)
API Design first with Swagger
AngularJS: Service, factory & provider
Better End-to-End Testing with Page Objects Model using Protractor
Philip Shurpik "Architecting React Native app"
React Native for ReactJS Devs
Full Stack Flutter Testing
The Road to Native Web Components
AngularJS and Protractor
Automated Testing using JavaScript
Crystal clear service interfaces w/ Swagger/OpenAPI
Protractor end-to-end testing framework for angular js
Intro to Service Worker API and its use cases
Six Steps To Build A Successful API
Ad

Similar to Apigility introduction v2 (glasgow php) (20)

PPTX
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
PDF
Crafting APIs
PDF
Apigility-powered API's on IBM i
PPTX
API workshop: Introduction to APIs (TC Camp)
PPTX
How to Create a Service in Choreo
PPTX
How to build Simple yet powerful API.pptx
ODP
Improving code quality using CI
PPTX
API Services: Building State-of-the-Art APIs
PDF
Create and Manage APIs with API Connect, Swagger and Bluemix
PPTX
solution Challenge design and flutter day.pptx
PPTX
InnovateQASeattle2024_RoyYap_Intro to Robot Framework.pptx
PPTX
API Conference 2021
PPTX
Integrate any Angular Project into WebSphere Portal
PPTX
API Documentation Workshop tcworld India 2015
PDF
Developing Brilliant and Powerful APIs in Ruby & Python
PDF
Build Android App using GCE & GAE
PPTX
2022 APIsecure_Securing APIs with Open Standards
PDF
Uni w pachube 111108
PPTX
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
PDF
Building FirefoxOS apps with Clojurescript
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
Crafting APIs
Apigility-powered API's on IBM i
API workshop: Introduction to APIs (TC Camp)
How to Create a Service in Choreo
How to build Simple yet powerful API.pptx
Improving code quality using CI
API Services: Building State-of-the-Art APIs
Create and Manage APIs with API Connect, Swagger and Bluemix
solution Challenge design and flutter day.pptx
InnovateQASeattle2024_RoyYap_Intro to Robot Framework.pptx
API Conference 2021
Integrate any Angular Project into WebSphere Portal
API Documentation Workshop tcworld India 2015
Developing Brilliant and Powerful APIs in Ruby & Python
Build Android App using GCE & GAE
2022 APIsecure_Securing APIs with Open Standards
Uni w pachube 111108
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Building FirefoxOS apps with Clojurescript
Ad

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
Teaching material agriculture food technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology
Understanding_Digital_Forensics_Presentation.pptx
Review of recent advances in non-invasive hemoglobin estimation
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm

Apigility introduction v2 (glasgow php)

  • 1. Thomas Dutrion / @tdutrion - March 2015 Introduction to Apigility API Development made easy updated for
  • 2. About me @tdutrion / @engineor / thomas@engineor.com PHP enthusiast Founder and developer/architect at Engineor Working with Zend Framework since 2009
  • 3. API based architecture ● Multiplication of the device types and size ● Server side software independent from clients ● Public access to data => API-First development: api-first.com Introduction to Apigility
  • 4. Implementation issues ● How to standardise an API? ● What are the best practices? ● How to enable multiple clients with a single backend? => Read blog.apigee.com Introduction to Apigility
  • 5. API basics Introduction to Apigility ● Architecture ● Output format standards
  • 6. RPC: Remote Procedure Call is a distributed architecture where a client execute a procedure on a distant machine (server) Architecture REST: Representational State Transfer is an architecture where a client manage distant resources using HTTP verbs. Introduction to Apigility Example: GET http://your_api/get-current-time POST http://your_api/send-email Example: GET http://your_api/contact POST http://your_api/contact GET http://your_api/contact/id POST http://your_api/contact/id PUT http://your_api/contact/id PATCH http://your_api/contact/id DELETE http://your_api/contact/id
  • 7. JSON application/json { “name”: “edPug”, “type”: “meetup” } Output format standards JSON HAL application/hal+json { “_links”: { “self”: { “href”: “http://localhost:8000/meetups/1” } } “name”: “edPug”, “type”: “meetup” } Introduction to Apigility Provide context to the entity / collection, self descriptive API
  • 8. A tool to build your API ● Generate your project structure ● Leave all the configuration to the GUI ● Focus on the business layer and only write the content of your methods Introduction to Apigility Apigility has been created by Zend and the community to handle all the non-business code and configurations
  • 9. Content negotiation ● Let the user (frontend developer) decide the output type he wants ● Build-in JSON and HAL JSON types, you can add your own ● Based on the accept header Introduction to Apigility The documentation is a good example to test different output type on the same resource
  • 10. Documentation ● Build-in documentation generator ● Can be extended with Swagger for public documentation ● Generated from the fields and constraints given within the GUI Introduction to Apigility Documentation is always one of the most important and neglected points in API projects Self-descriptive API allow Apigility to build the documentation automatically
  • 11. application/problem+json { “type”: “/api/problems/forbidden”, “title”: “Forbidden”, “detail”: “Your API key is missing or invalid.”, “status”: 403, “authenticationUrl”: “/api/oauth” } Error handling Introduction to Apigility https://tools.ietf.org/html/draft-nottingham-http-problem-07 HTTP Problem RFC ● Standard error message ● Use http status code ● Help your frontend developers to deal with errors
  • 12. Authentication ● HTTP Simple ● HTTP Digest ● OAuth2 Multiple oauth scenarios, all described in the documentation Introduction to Apigility https://apigility.org/documentation/auth/authentication-about
  • 13. Versioning ● https://blog.apigee.com/detail/restful_api_design_how_many_versions ● https://blog.apigee. com/detail/api_restful_design_question_verisioning_number_in_the_url Apigility provides a built in versioning You can specify the version through url or headers at your convenience Introduction to Apigility https://apigility.org/documentation/api-primer/versioning
  • 14. Concrete introduction to Apigility History: ● Announced during the ZendCon US in October 2013 ● First release 8th October 2013 (version 0.6.0) ● Skeleton application currently in version 1.0.4 Introduction to Apigility Problems solved: ● Standardising APIs ● Rapid API centric application development ● APIs for file upload as well ● Give access to fast and clean API development for non developers (database connected API)
  • 15. Installation ● Using Composer ● Using the auto installer ● Using the archive download ● Using the skeleton or as a dependance Introduction to Apigility Watch the demo: https://www.youtube.com/watch?v=cE2rwGi437I
  • 16. Create a database connected API Introduction to Apigility Watch the demo: https://www.youtube.com/watch?v=KYsOCCPrOwE ● Use HTTP verbs to query resources ● Fetch automatically data from the table ● The demo does not show a full CRUD, try it yourself, it’s easy!
  • 17. Add an authentication ● Add an HTTP Basic authentication ● Not very dynamic (requires to change htpasswd for each new user) ● Requires HTTPS => good for internal projects or non critical project, prefer oauth in most cases Introduction to Apigility Watch the demo: https://www.youtube.com/watch?v=0I_rTFRQid0
  • 18. Add a version ● Generate new files in background ● Use accept header to select a version ● Use a route parameter to select a version Introduction to Apigility Watch the demo: https://www.youtube.com/watch?v=Nt4BNn3QRoQ
  • 19. Quick and dirty example: Injecting your tools ● Productivity: know your tools ● Apigility provides factories ● Composer is included Introduction to Apigility Using Doctrine is officially supported (https://github.com/zfcampus/zf-apigility-doctrine), do not copy this slide example!
  • 21. What’s next? https://twitter.com/julienguittard/status/574980150409969664 Introduction to Apigility ● Decoupled components ● Release end of 2015 ● New version of Apigility using ZF3 HTTP middleware stack (PSR-7) https://twitter.com/ezimuel/status/562911967149850625
  • 22. Questions? Thanks to: ● Enrico Zimuel / @ezimuel - https://speakerdeck.com/ezimuel/apigility-the-api-builder-for-php ● Enrico Zimuel / @ezimuel - http://goo.gl/io7nqO ● Rob Allen / @akrabat - http://akrabat.com/wp-content/uploads/20140318-phpne-apigility-intro.pdf http://akrabat.com/wp-content/uploads/2015-02-20-phpuk-apigility.pdf Introduction to Apigility Feel free to comment: http://www.slideshare.net/engineor/introduction-to-apigility-v2-glasgow-php