ez goes mobile - the restful way
TRANSCRIPT
![Page 1: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/1.jpg)
Markus Birth
eZ goes mobile
...the RESTful way
![Page 2: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/2.jpg)
Slide 2 / Markus Birth
About me
Markus Birth
Software-Developer at silver.solutions GmbH
Berlin, Germany
silver.solutions offers great experience in connecting eZ Publish to ERP systems (Navision, Axapta, SAP R/3). We also do mobile apps.
I do mostly backend programming for eZ Publish sites where I'm specialized in interfaces. My second field of activity is mobile apps.
![Page 3: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/3.jpg)
Slide 3
REST
→ Representational State Transfer
(Google it! Or try Wikipedia: http://en.wikipedia.org/wiki/REST)
![Page 4: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/4.jpg)
Image from pixelio.de Slide 4
Things you might need
What you need:eZ 4.5 with ezpRestApiProviderconfigured OAuth2 consumer credentialsuser login with appropriate access rightsdoc.ez.nosome client (e.g. a mobile app)
![Page 5: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/5.jpg)
Slide 5 / Markus Birth
I am who I am (or: OAuth 2.0)
to communicate via REST, a valid access_token is required
can be retrieved via OAuth2 workflow
tricky for non-browser applications2 ways for apps on mobile devices:
a) show login window in an own WebView and watch the currently shown URL for the endpoint URI
b) register a new protocol handler, set the endpoint_uri and react on that (works from any mobile browser)
e.g. mycrapp://
![Page 6: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/6.jpg)
Slide 6 / Markus Birth
OAuth 2.0 login
![Page 7: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/7.jpg)
Slide 7 / Markus Birth
eZ REST URL Scheme
Methods: GET, POST, PUT, DELETE
Base URL: http://myezsite.com/api/ezp/v1/content/object/[objectID]/content/node/[nodeID]/content/(node|object)/[ID]/fields/content/(node|object)/[ID]/field/[fieldID]/content/node/[nodeID]/list/offset/…/limit/…/sort/…/…/content/node/[nodeID]/childrenCount
non-default language: http://…?translation=xxx-YY
![Page 8: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/8.jpg)
Slide 8 / Markus Birth
The first request
GET /api/ezp/v1/content/node/2/listAuthorization: OAuth 0123456789abcdef…Accept: application/json
"childrenNodes": [ { "objectName": "Awards", "classIdentifier": "subcategory", "datePublished": 1302091069, "dateModified": 1307614988, "objectRemoteId": "d003…3e94", "objectId": 1203, "nodeId": 1257, "nodeRemoteId": "f4ef…47f2", "fullUrl": "http:\/\/…\/Awards", "link": "http:\/\/…\/content\/node\/1257" }, { … } ],
![Page 9: eZ goes mobile - the RESTful way](https://reader033.vdocuments.us/reader033/viewer/2022051516/55a4288d1a28aba3038b47b2/html5/thumbnails/9.jpg)
Slide 9 / Markus Birth
Thank you for listening
http://lanyrd.com/sfhtw