SlideShare a Scribd company logo
KISS REST API
 @yurevich, oDesk corp.
     ekb.py 2012




                          1
Plan

• K.O.
• Good practices
• Real world sample
• Toolset

                       2
Good API
• Easy
 • to use
 • to read
 • to extend
• Complete
• Consistent
                     3
REST
• stateless (no cookies & sessions)
• resources identification (URLs)
• representation (JSON, XML,YaML)
• manipulation of resources through
  representation
• self-descriptive messages
• hypermedia (Links)
                                      4
Good samples

• Twitter API
• Twilio API
• Amazon S3 API


                     5
Good practices

• Though not so universal
• http://blog.feedly.com/2009/05/06/best-
  practices-for-building-json-rest-web-
  services/
• http://jacobian.org/writing/rest-worst-
  practices/


                                            6
Writing spec
    Document it first
• Real use-cases
• Complete and closed set
• Future kills now
• Explicit versioning

                            7
Beginners mistakes
• Resource = model
 • Think about married couple
• All methods should be implemented for
  every resource
 • Update user account activation? Delete
    sent SMS message?
• Custom methods
                                            8
Use nouns
  (learn passive voice)
• User sends SMS message =>
  A SMS message is created
• Article is reviewed by editor =>
  Review of article is created
• The user deactivates account =>
  User account activation is deleted



                                       9
Namespaces


• https://smsgate/v2/messages
  (or https://smsgate/20120210/messages) VS
  https://smsgate/messages




                                              10
Resources


• Resources are NOUNs
• https://smsgate/v2/messages VS
  https://smsgate/v2/send-message




                                    11
URLs


• Required GET params must be part of URL
 • http://smsgate/v2/messages/{id} instead of
    http://smsgate/v2/message?id={id}




                                                12
Auth! SSL!

• https://smsgate/v2/messages VS
  http://smsgate/v2/messages
• Poor man auth: token-based
• Production ready: oAuth2


                                   13
Real world sample 0

• SMS Gate
 • GET http://smsgate/sendMessage?
    number=780020000000&text=Send+it
    +please




                                       14
Real world sample
• SMS Gate
 • Resource: Text Message /message:
    • Create new one (send) —
        POST /messages
     • Get information about status
        GET /messages/{id}
 • version: 2
                                      15
Real world sample 2
• POST https://smsgate2/v2/messages
  > message=Send%20it
  %20please&target=780020000000
• 201 Created
  Location: https://smsgate2/v2/messages/242
  {‘target’: ‘78002000000’, ‘url’: ‘https://
  smsgate2/v2/message’, ‘status’: ‘queued’}


                                               16
Toolset

• Documentation
• Backend
• Validation
• JSON generation
• What’s next?

                       17
Toolset: documentation
• Sphinx (ReST)
 • HTTP Domain — https://github.com/
    deceze/Sphinx-HTTP-domain
 • httpdomain — https://bitbucket.org/
    birkenfeld/sphinx-contrib
• Markdown
 • https://github.com/coopernurse/doctorj
                                            18
Toolset: prototyping

• Red barrel
 • External DSL (hello, PHP&Ruby)
 • Self-documented
 • Easy to distribute
 • Only for prototyping

                                    19
Flask
• Simple
• You get what you need
• A lot of bootstrapping code
 • Attention to details
 • Chance to get hardcoded result
• In our projects most load-intensive APIs are
  implemented using Flask
                                                 20
Django+Piston

• Good set of features (for that time)
• Built-in formatters
 • works well, on Accept header
• Methods are strictly mapped to actions
• Hard to reuse different forms in single
  handler
• It’s obsolete
                                            21
Django+TastyPie

• A lot of features
• Pure Resource, ModelResource
• Pagination
• In our team richest APIs are implemented
  in TastyPie



                                             22
Toolset:Validation

• http://bitbucket.org/jek/flatland/
 • Looks cool
 • Not so obvious for nested structures
 • Internals — OMG

                                          23
Toolset:Validation

• https://github.com/Deepwalker/procrustes
 • Data and forms validation
 • Simple
 • Good as prototype, not so good for
    production
 • lack of documentation
                                             24
Toolset:Validation
• https://github.com/Deepwalker/trafaret
 • Very nice syntax
 • Easy but supports complex nested
    structures
 • Lack of documentation
 • No forms validation
                                           25
Toolset: JSON writer

• /dev/hands
• Ruby:
 • https://github.com/inem/tequila
 • https://github.com/nesquena/rabl

                                      26
What’s next?
• JSON Schema
 • Validation
 • Discovery
• http://json-schema.org/
• http://nico.vahlas.eu/2010/04/23/json-
  schema-specifying-and-validating-json-data-
  structures/
• http://shane.caraveo.com/2011/06/30/using-
  json-schema-for-exploring-api-servers/
                                                27
Surprise

• Dzen Python works for REST APIs
•curl http://pure-
  dawn-9186.herokuapp.com/
  import-this




                                    28
Thanks

• Questions?
• yyurevich@jellycrystal.com
• follow me on twitter @yurevich


                                   29

More Related Content

PDF
ekb.py: KISS REST API
Yury Yurevich
 
PDF
Developing OpenResty Framework
Aapo Talvensaari
 
PDF
Spicing up JMX with Jolokia (Devoxx 2014)
roland.huss
 
PDF
MongoDB and Node.js
Norberto Leite
 
PPTX
曾勇 Elastic search-intro
Shaoning Pan
 
PDF
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Miguel Gallardo
 
PPTX
Efficient cluster resource management by using Cook and Mesos / Li Jin (Two S...
Ontico
 
PDF
4Developers: Michał Papis- Publikowanie gemów
PROIDEA
 
ekb.py: KISS REST API
Yury Yurevich
 
Developing OpenResty Framework
Aapo Talvensaari
 
Spicing up JMX with Jolokia (Devoxx 2014)
roland.huss
 
MongoDB and Node.js
Norberto Leite
 
曾勇 Elastic search-intro
Shaoning Pan
 
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Miguel Gallardo
 
Efficient cluster resource management by using Cook and Mesos / Li Jin (Two S...
Ontico
 
4Developers: Michał Papis- Publikowanie gemów
PROIDEA
 

What's hot (13)

KEY
Rack
shaokun
 
KEY
Redis At 6Wunderkinder
Sebastian Kreutzberger
 
PPTX
Elastic search intro-@lamper
medcl
 
PDF
PLAT-16 Using Enterprise Content in Grails
Alfresco Software
 
PDF
Florian Koch - Monitoring CoreOS with Zabbix
Zabbix
 
PDF
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
MongoDB
 
PDF
2016-05-12 DCRUG React.rb
awwaiid
 
PDF
RESTFul development with Apache sling
Sergii Fesenko
 
PDF
Polyglot Messaging with Apache ActiveMQ
Christian Posta
 
PPT
Mongo Web Apps: OSCON 2011
rogerbodamer
 
PDF
Scala with mongodb
Knoldus Inc.
 
PDF
Connecting to Web Services on Android
sullis
 
PPTX
Eclipse Dirigible WebIDE - Deep Dive
Nedelcho Delchev
 
Rack
shaokun
 
Redis At 6Wunderkinder
Sebastian Kreutzberger
 
Elastic search intro-@lamper
medcl
 
PLAT-16 Using Enterprise Content in Grails
Alfresco Software
 
Florian Koch - Monitoring CoreOS with Zabbix
Zabbix
 
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
MongoDB
 
2016-05-12 DCRUG React.rb
awwaiid
 
RESTFul development with Apache sling
Sergii Fesenko
 
Polyglot Messaging with Apache ActiveMQ
Christian Posta
 
Mongo Web Apps: OSCON 2011
rogerbodamer
 
Scala with mongodb
Knoldus Inc.
 
Connecting to Web Services on Android
sullis
 
Eclipse Dirigible WebIDE - Deep Dive
Nedelcho Delchev
 
Ad

Similar to ekbpy'2012- Юрий Юревич - Как сделать REST API на Python (20)

PDF
API Design & Security in django
Tareque Hossain
 
PPTX
Scaling with swagger
Tony Tam
 
PPTX
RESTful Web Services
Gordon Dickens
 
PDF
Facebook & Twitter API
Fabrice Delhoste
 
KEY
Gaelyk - JFokus 2011 - Guillaume Laforge
Guillaume Laforge
 
PDF
Designing RESTful APIs
anandology
 
PDF
Web Service and Mobile Integrated Day I
Anuchit Chalothorn
 
PDF
Python Ireland Nov 2010 - RESTing with Django
Python Ireland
 
PDF
Swagger: Restful documentation that won't put you to sleep
Tobias Coetzee
 
PDF
Android App Development 06 : Network & Web Services
Anuchit Chalothorn
 
PPTX
Building A Mobile First API When You're Not Mobile First - Tyler Singletary
ProgrammableWeb
 
KEY
Rest
Neil Roberts
 
PDF
Cloud Native API Design and Management
AllBits BVBA (freelancer)
 
PDF
How to build a scalable SNS via Polling & Push
Mu Chun Wang
 
PDF
Ruby off Rails (english)
Stoyan Zhekov
 
PDF
OSGi, Scripting and REST, Building Webapps With Apache Sling
Carsten Ziegeler
 
PDF
Web micro-framework BATTLE!
Richard Jones
 
PDF
What is REST?
Saeid Zebardast
 
PPTX
REST Coder: Auto Generating Client Stubs and Documentation for REST APIs
Hiranya Jayathilaka
 
PDF
Making Things Work Together
Subbu Allamaraju
 
API Design & Security in django
Tareque Hossain
 
Scaling with swagger
Tony Tam
 
RESTful Web Services
Gordon Dickens
 
Facebook & Twitter API
Fabrice Delhoste
 
Gaelyk - JFokus 2011 - Guillaume Laforge
Guillaume Laforge
 
Designing RESTful APIs
anandology
 
Web Service and Mobile Integrated Day I
Anuchit Chalothorn
 
Python Ireland Nov 2010 - RESTing with Django
Python Ireland
 
Swagger: Restful documentation that won't put you to sleep
Tobias Coetzee
 
Android App Development 06 : Network & Web Services
Anuchit Chalothorn
 
Building A Mobile First API When You're Not Mobile First - Tyler Singletary
ProgrammableWeb
 
Cloud Native API Design and Management
AllBits BVBA (freelancer)
 
How to build a scalable SNS via Polling & Push
Mu Chun Wang
 
Ruby off Rails (english)
Stoyan Zhekov
 
OSGi, Scripting and REST, Building Webapps With Apache Sling
Carsten Ziegeler
 
Web micro-framework BATTLE!
Richard Jones
 
What is REST?
Saeid Zebardast
 
REST Coder: Auto Generating Client Stubs and Documentation for REST APIs
Hiranya Jayathilaka
 
Making Things Work Together
Subbu Allamaraju
 
Ad

More from it-people (20)

PDF
«Про аналитику и серебряные пули» Александр Подсобляев, Rambler&Co
it-people
 
PDF
«Scrapy internals» Александр Сибиряков, Scrapinghub
it-people
 
PDF
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
it-people
 
PDF
«Gevent — быть или не быть?» Александр Мокров, Positive Technologies
it-people
 
PDF
«Ещё один Поиск Яндекса» Александр Кошелев, Яндекс
it-people
 
PDF
«How I Learned to Stop Worrying and Love the BFG: нагрузочное тестирование со...
it-people
 
PDF
«Write once run anywhere — почём опиум для народа?» Игорь Новиков, Scalr
it-people
 
PDF
«Gensim — тематическое моделирование для людей» Иван Меньших, Лев Константино...
it-people
 
PDF
«Тотальный контроль производительности» Михаил Юматов, ЦИАН
it-people
 
PDF
«Детские болезни live-чата» Ольга Сентемова, Тинькофф Банк
it-people
 
PDF
«Микросервисы наносят ответный удар!» Олег Чуркин, Rambler&Co
it-people
 
PDF
«Память и Python. Что надо знать для счастья?» Алексей Кузьмин, ЦНС
it-people
 
PDF
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
it-people
 
PDF
«Python на острие бритвы: PyPy project» Александр Кошкин, Positive Technologies
it-people
 
PDF
«PyWat. А хорошо ли вы знаете Python?» Александр Швец, Marilyn System
it-people
 
PDF
«(Без)опасный Python», Иван Цыганов, Positive Technologies
it-people
 
PDF
«Python of Things», Кирилл Борисов, Яндекс
it-people
 
PDF
«Как сделать так, чтобы тесты на Swift не причиняли боль» Сычев Александр, Ra...
it-people
 
PDF
«Клиенту и серверу нужно поговорить» Прокопов Никита, Cognician
it-people
 
PDF
«Кошелек или деньги: сложный выбор между памятью и процессором» Алексеенко Иг...
it-people
 
«Про аналитику и серебряные пули» Александр Подсобляев, Rambler&Co
it-people
 
«Scrapy internals» Александр Сибиряков, Scrapinghub
it-people
 
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
it-people
 
«Gevent — быть или не быть?» Александр Мокров, Positive Technologies
it-people
 
«Ещё один Поиск Яндекса» Александр Кошелев, Яндекс
it-people
 
«How I Learned to Stop Worrying and Love the BFG: нагрузочное тестирование со...
it-people
 
«Write once run anywhere — почём опиум для народа?» Игорь Новиков, Scalr
it-people
 
«Gensim — тематическое моделирование для людей» Иван Меньших, Лев Константино...
it-people
 
«Тотальный контроль производительности» Михаил Юматов, ЦИАН
it-people
 
«Детские болезни live-чата» Ольга Сентемова, Тинькофф Банк
it-people
 
«Микросервисы наносят ответный удар!» Олег Чуркин, Rambler&Co
it-people
 
«Память и Python. Что надо знать для счастья?» Алексей Кузьмин, ЦНС
it-people
 
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
it-people
 
«Python на острие бритвы: PyPy project» Александр Кошкин, Positive Technologies
it-people
 
«PyWat. А хорошо ли вы знаете Python?» Александр Швец, Marilyn System
it-people
 
«(Без)опасный Python», Иван Цыганов, Positive Technologies
it-people
 
«Python of Things», Кирилл Борисов, Яндекс
it-people
 
«Как сделать так, чтобы тесты на Swift не причиняли боль» Сычев Александр, Ra...
it-people
 
«Клиенту и серверу нужно поговорить» Прокопов Никита, Cognician
it-people
 
«Кошелек или деньги: сложный выбор между памятью и процессором» Алексеенко Иг...
it-people
 

Recently uploaded (20)

PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Doc9.....................................
SofiaCollazos
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 

ekbpy'2012- Юрий Юревич - Как сделать REST API на Python

  • 1. KISS REST API @yurevich, oDesk corp. ekb.py 2012 1
  • 2. Plan • K.O. • Good practices • Real world sample • Toolset 2
  • 3. Good API • Easy • to use • to read • to extend • Complete • Consistent 3
  • 4. REST • stateless (no cookies & sessions) • resources identification (URLs) • representation (JSON, XML,YaML) • manipulation of resources through representation • self-descriptive messages • hypermedia (Links) 4
  • 5. Good samples • Twitter API • Twilio API • Amazon S3 API 5
  • 6. Good practices • Though not so universal • http://blog.feedly.com/2009/05/06/best- practices-for-building-json-rest-web- services/ • http://jacobian.org/writing/rest-worst- practices/ 6
  • 7. Writing spec Document it first • Real use-cases • Complete and closed set • Future kills now • Explicit versioning 7
  • 8. Beginners mistakes • Resource = model • Think about married couple • All methods should be implemented for every resource • Update user account activation? Delete sent SMS message? • Custom methods 8
  • 9. Use nouns (learn passive voice) • User sends SMS message => A SMS message is created • Article is reviewed by editor => Review of article is created • The user deactivates account => User account activation is deleted 9
  • 10. Namespaces • https://smsgate/v2/messages (or https://smsgate/20120210/messages) VS https://smsgate/messages 10
  • 11. Resources • Resources are NOUNs • https://smsgate/v2/messages VS https://smsgate/v2/send-message 11
  • 12. URLs • Required GET params must be part of URL • http://smsgate/v2/messages/{id} instead of http://smsgate/v2/message?id={id} 12
  • 13. Auth! SSL! • https://smsgate/v2/messages VS http://smsgate/v2/messages • Poor man auth: token-based • Production ready: oAuth2 13
  • 14. Real world sample 0 • SMS Gate • GET http://smsgate/sendMessage? number=780020000000&text=Send+it +please 14
  • 15. Real world sample • SMS Gate • Resource: Text Message /message: • Create new one (send) — POST /messages • Get information about status GET /messages/{id} • version: 2 15
  • 16. Real world sample 2 • POST https://smsgate2/v2/messages > message=Send%20it %20please&target=780020000000 • 201 Created Location: https://smsgate2/v2/messages/242 {‘target’: ‘78002000000’, ‘url’: ‘https:// smsgate2/v2/message’, ‘status’: ‘queued’} 16
  • 17. Toolset • Documentation • Backend • Validation • JSON generation • What’s next? 17
  • 18. Toolset: documentation • Sphinx (ReST) • HTTP Domain — https://github.com/ deceze/Sphinx-HTTP-domain • httpdomain — https://bitbucket.org/ birkenfeld/sphinx-contrib • Markdown • https://github.com/coopernurse/doctorj 18
  • 19. Toolset: prototyping • Red barrel • External DSL (hello, PHP&Ruby) • Self-documented • Easy to distribute • Only for prototyping 19
  • 20. Flask • Simple • You get what you need • A lot of bootstrapping code • Attention to details • Chance to get hardcoded result • In our projects most load-intensive APIs are implemented using Flask 20
  • 21. Django+Piston • Good set of features (for that time) • Built-in formatters • works well, on Accept header • Methods are strictly mapped to actions • Hard to reuse different forms in single handler • It’s obsolete 21
  • 22. Django+TastyPie • A lot of features • Pure Resource, ModelResource • Pagination • In our team richest APIs are implemented in TastyPie 22
  • 23. Toolset:Validation • http://bitbucket.org/jek/flatland/ • Looks cool • Not so obvious for nested structures • Internals — OMG 23
  • 24. Toolset:Validation • https://github.com/Deepwalker/procrustes • Data and forms validation • Simple • Good as prototype, not so good for production • lack of documentation 24
  • 25. Toolset:Validation • https://github.com/Deepwalker/trafaret • Very nice syntax • Easy but supports complex nested structures • Lack of documentation • No forms validation 25
  • 26. Toolset: JSON writer • /dev/hands • Ruby: • https://github.com/inem/tequila • https://github.com/nesquena/rabl 26
  • 27. What’s next? • JSON Schema • Validation • Discovery • http://json-schema.org/ • http://nico.vahlas.eu/2010/04/23/json- schema-specifying-and-validating-json-data- structures/ • http://shane.caraveo.com/2011/06/30/using- json-schema-for-exploring-api-servers/ 27
  • 28. Surprise • Dzen Python works for REST APIs •curl http://pure- dawn-9186.herokuapp.com/ import-this 28
  • 29. Thanks • Questions? • [email protected] follow me on twitter @yurevich 29