Jab14 exemple of integration of Joomla and slim Framework
http://jandbeyond.org/program/sessions/dont-worry-be-api-best-practices-and-implementatio.html
In the context of a website or web application, an application-programming interface or API allows software developers to interact with and build upon the data and/or services delivered by your website. Thus, APIs provide limitless flexibility, reach and innovative potential for any website, service or application.
During the last few months, Pierre-André has performed extensive research and development to discover effective ways of adding an API to a Joomla website. In this interactive session, he will share his findings.
Attendees can expect to learn, why you need an API for your web site, the pros and cons of various API solutions, and why a RESTful API is a good fit for Joomla. Best practices for implementing a well-documented, pragmatic, and RESTful API will be discussed, along with useful tools and sample code for using the com_api component as well as Slim Framework.
5. Amazon
→ All teams will expose their data and functionality
through API.
→ There will be no other form of interprocess
communication [..]
→ Anyone who doesn't do this will be fired.
Amazon policy set by Jeff Bezos in 2003
6. Open your system
→ Internal use
→ Apps
→ Clients
→ Partners
Data
API
Functionality
app
partners
services
7. REST
Everything is a resource
verbs : GET, PUT, POST, DELETE, PATCH
GET /sessions
11. API interfaces for Joomla
J!1.5 : XML-RPC
J!2.5 : com_api
J!3.2 : com_ajax and com_api
External solution : Slim Framework
12. com_api
for J! 2.5 & 3.x
a component by Techjoomla
extended by plugins
Example of call : index.php?
option=com_api&app=jab&format=raw&resource=sessions&id=14&api
_key=123456qwert12
http://techjoomla.com/rest-api-for-joomla
14. com_ajax
Since J! 3.2 in the core
Extended by plugins & modules
First use for intern ajax call
Example of call : index.php?
option=com_ajax&plugin=session&format=json
http://docs.joomla.org/Using_Joomla_Ajax_Interface
24. Swagger
describing, producing, consuming, and
visualizing RESTful web services
Specification: https://github.com/wordnik/swagger-spec
Swagger™ Demo: http://petstore.swagger.wordnik.com/
25. PHP comments
* @SWGApi(
* path="/logs/metadata",
* @SWGOperation(
* method="GET",
* summary="Get the list of fields",
* notes="Returns a list of fields",
* type="Logs",
* nickname="getFieldsLogs" (…)
27. Use it
Generate online documentation
http://petstore.swagger.wordnik.com/
Generate clients in different languages
https://github.com/wordnik/swagger-codegen
Share you api : http://apicommons.org/apis.html
28. Other tools
Consoles :
App for chrome
Online console
API proxy :
http://apigee.com
http://www.3scale.net
http://www.mashery.com/