JoomlaDay Bangkok, 2014 CTO, Techjoomla Webservices working group leader @coolbung | @techjoomla www.techjoomla.com
JoomlaDay Bangkok, 2014
CTO, TechjoomlaWebservices working group leader
@coolbung | @techjoomlawww.techjoomla.com
JoomlaDay Bangkok, 2014
Techjoomla
J o o m l a E x t e n s i o n sInvitex, Social Ads, Jgive, Jbolo
C u s t o m P ro j e c t s & C o n s u lt a t i o nIn house experts. World class service!
U s i n g J o o m l a i n I n n o v a t i v e w a y sLighting control management using Raspberry Pi, Warehouse Management System
JoomlaDay Bangkok, 2014
Apptitude
M o b i l e A p p s ( A p p t i t u d e )JoomlaDay 2013 ;)Junite CMS inside an App–Reportoise Smartphone reporting–EasysocialJgive EasyblogAkeeba Tickets
C u s t o m a p p s a n d c o n s u lt a t i o nHybrid, native and a whole lot more
JoomlaDay Bangkok, 2014
Joomla REST API
JoomlaDay Bangkok, 2014
JoomlaDay Bangkok, 2014
What's an API ?
JoomlaDay Bangkok, 2014
Come Again ?
APIM O B I L E
W E B
JoomlaDay Bangkok, 2014
What's REST afterall ?
● A style of writing APIs over HTTP
● Uses HTTP verbs -
GET = Read
POST = Create
PUT = Update
DELETE = DELETE
JoomlaDay Bangkok, 2014
URLs are resources
● GET /users gets a list of all users
GET /users/coolbung gets details of user coolbung
● POST /users creates a new user
● PUT /users/coolbung updates the user coolbung
● DELETE /users/coolbung deletes the user
JoomlaDay Bangkok, 2014
What's this got to do with Joomla ?
http://www.flickr.com/photos/san_drino/1454922072/
JoomlaDay Bangkok, 2014
INSERT INTO jd14bkk_users (name, username, email, password, block)VALUES ('James Bond', '[email protected]', '[email protected]', MD5(007), 0)
INSERT INTO jos_user_usergroup_map VALUES(62, 8)
My JAVA app M y J o o m l a ! w e b s i t e
JoomlaDay Bangkok, 2014
What do I do then ?
/index.php?option=com_api&app=users&resource=user&format=raw
[POST]name = Ashwin Dateusername = [email protected] = [email protected]= supersecretkey = 4358a6fc7470713c79f31b163558a2639b3036ed
JoomlaDay Bangkok, 2014
What do I do then ?
/index.php?option=com_api&app=users&resource=user&format=raw/users
[POST]name = Ashwin Dateusername = [email protected] = [email protected]= supersecretkey = 4358a6fc7470713c79f31b163558a2639b3036ed
JoomlaDay Bangkok, 2014
What do I do then ?
/index.php?option=com_api&app=users&resource=user&format=raw/users/v1/users
[POST]name = Ashwin Dateusername = [email protected] = [email protected]= supersecretkey = 4358a6fc7470713c79f31b163558a2639b3036ed
JoomlaDay Bangkok, 2014
Brilliant!
So Joomla supports REST API ?
http://www.flickr.com/photos/djwtwo/8331524425/
JoomlaDay Bangkok, 2014
Yes! In fact several ways :)
● Techjoomla com_api
● redCORE
● view.json.php / format=json
● XML-RPC (very early, present in Joomla 1.5)
● Techjoomla REST API (very early later replaced by com_api)
JoomlaDay Bangkok, 2014
Who's using it ?
JoomlaDay Bangkok, 2014
Mobile Apps!
JoomlaDay Bangkok, 2014
Check-in JoomlaDay India attendees
JoomlaDay Bangkok, 2014
Mashups
● Pure HTML5 interface
● Uses API for all backend tasks
● Uses local storage for temporary store
● Heavy work done by APIs
JoomlaDay Bangkok, 2014
Enterprise ?
● Desktop app for a fortune 500 company to manage over 100,000 products
● Being used by our LMS Shika to allow candidates to start lessons on desktop and continue on their phone & tablet–
● Managing smart lighting (watch out for a detailed talk tomorrow!)
JoomlaDay Bangkok, 2014
Authentication
https://www.flickr.com/photos/alt1040/566963578/
LoginToken
JoomlaDay Bangkok, 2014
Current Drawbacks
● Uses Joomla routing so not easy to have custom SEF URLs for resources
● Components in MVC format should not need a plugin
JoomlaDay Bangkok, 2014
Proposed New Architecture
JoomlaDay Bangkok, 2014
Proposed New Architecture
● RESTful infrastructure embedded in Joomla! framework
● Support for Oauth 2
JoomlaDay Bangkok, 2014
Please join in!● Webservices working group
http://docs.joomla.org/Web_Services_Working_Group● Code on github
https://github.com/techjoomla/com_api-plugins
https://github.com/techjoomla/com_api● Joomla! General Development Google Group
https://groups.google.com/forum/?fromgroups=#!forum/joomla-dev-general
JoomlaDay Bangkok, 2014
Thank You
Ashwin Date
Twitter : @coolbung / @techjoomla
Email : [email protected]
http://www.slideshare.net/coolbung