SlideShare a Scribd company logo
Crafting WEB API Design that
Developers Love. Deep dive
Roman Bugaev, Senior developer at Adform
About us • 400+ high performance servers
• High availability load balancing and failover
• 200 000 requests per second
• Peta Bytes of data on 50+ servers
• Up to 20 releases per day
• Integrations
•
•
•
•

Facebook, Google, Adobe
Large e-shops and CMS platform
TV ads recognition
Adform Marketplace
Why?
~70% API – REST
Pragmatic REST
• REST is an architectural style and not a strict
standard, it allows for a lot of flexibly
• The primary design principle when crafting your API
should be to maximize developer productivity and
success.
• Pragmatic REST is a design problem
• Keep simple things simple
Keep base URL simple & intuitive
• Nouns are good; verbs are bad
• 2 base URLs per resource
• /users
/users/1234

• Keep verbs out of your base URLs
• Use HTTP verbs to operate on the collections and
elements.
• POST create
GET read
PUT update DELETE
delete
How to pick the nouns for URLs.
• Plural rather than singular nouns
• Foursquare
• Dropbox
• Facebook

/checkins
/files
/me/friends

• Concrete rather than abstract names
• /items vs. /blogs, /news
Simplify associations
• GET /folders/5678/files
• Get all files belonging to a specific folder

• POST /folders/5678/files
• Create new file for that folder
Sweep complexity behind the ‘?’
• Attributes GET
/cars?color=red&state=new&location=minsk
• Paging GET /cars?limit=25&offset=50
• Global Search GET /search?q=lamb

• Scoped Search GET /owners/5678/cars?q=lamb
Handling errors
• Developers learn to write code through errors
• Developers depend on well-designed errors at the
critical times
Handling errors - Facebook
HTTP Status Code 200
{
error:
{
message: “Malformed access token <token>”,
type: “OAuthException”,
code: “190”
}
}
Handling errors - Twilio
HTTP Status Code: 401
{
status: "401",
message: "Authenticate",
code: 20003,
info: "http://www.twilio.com/docs/errors/20003"
}
A couple of best practices
• Use HTTP status codes
• Make messages returned in the payload as verbose as
possible
•
•
•
•

Code
Developer message
User message
More Info

I ❤ BEST
PRACTICES

Start by using the following 3 codes:
• 200 – OK (success)
• 400 - Bad Request (client error)
• 500 - Internal Server Error (server error)
Tips for versioning
• salesforce.com
/services/data/v20.0/sobjects/Account
• Facebook ?v=1.0

• The version is mandatory.
• Accept header for entity versioning
• Specify the version with a 'v' prefix.
• Use a simple ordinal number.
• Create an alias for current version
Actions
• Use verbs not nouns:
• /convert?from=EUR&to=CNY&amount=100

• Make it clear in your API documentation that these
“non-resource” scenarios are different.
Probe Web Resources Efficiently
with OPTIONS in REST
< HTTP/1.1 200 OK
< Allow: GET, HEAD, POST, OPTIONS, TRACE
< Content-Type: text/html; charset=UTF-8
< Date: Wed, 13 December 2013 10:24:43 GMT
< Content-Length: 0
Probe Web Resources Efficiently
with HEAD in REST
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Content-Type: text/html; charset=UTF-8
< Date: Wed, 08 May 2013 10:12:29 GMT
< ETag: "780602-4f6-4db31b2978ec0"
< Last-Modified: Thu, 25 Apr 2013 16:13:23 GMT
< Content-Length: 1270
Scale
• Think about scale sooner that later
• Rate limits
• Extra servers
• Partitioning
• Caching
•
•
•
•

Between application and database
In the application itself
Using an API proxy
CDN for large static content
Supporting multiple formats
• To get the JSON format from a collection or specific
element:
• dogs.json
• /dogs/1234.json
Accept header for entity versioning also applicable
Default format: JSON

Follow JavaScript conventions
Chatty APIs
Imagine how developers will use your API
• You can design a RESTful API and still mitigate the
chattiness.
Be complete and RESTful and provide shortcuts
Take advantage of the partial response syntax
• /owners/5678?fields=name, dogs.name
Some useful tools
Apiary.io
Apigee
Runscope, hurl.it, apichangelog
Mashape
Security
• Use something established
• API keys for non-sensitive data only
• Username/password auth for site based
APIs
• OAuth for server-to-server APIs
• SSL for EVERYTHING sensitive
OAuth
1. An OAuth token gives one app access to one API
on behalf of one user.
2. App developers do not want responsibility of
holding a user’s secret information (password).
3. there are three entities (legs) – user/server/client
Why is OAuth important?
• What if client is hacked and someone steals all the
passwords?
• OAuth allows the API provider to revoke tokens for an
individual user and for an entire app

• On the other hand, if user decides to change his
password, the token will be the same.
• Developers can use an OAuth library in their
language
Types of OAuth 2.0
• BEARER TOKEN
• SSL and big numbers

• MAC TOKEN
• Uses signature instead of SSL

• SAML
• if you and your potential API developers don’t
understand SAML or know what it is, that’s a signal to
stay away
Thank you! Questions?

rbugaev@gmail.com
bugaev_roman
http://twitter.com/rbugaev
http://facebook.com/rbugaev

More Related Content

What's hot (20)

Developing Apps for SharePoint Store
Developing Apps for SharePoint StoreDeveloping Apps for SharePoint Store
Developing Apps for SharePoint Store
Kashif Imran
 
Reasons to Upgrade to DNN Evoq Content Version 7
Reasons to Upgrade to DNN Evoq Content Version 7Reasons to Upgrade to DNN Evoq Content Version 7
Reasons to Upgrade to DNN Evoq Content Version 7
DNN
 
Feature List
Feature ListFeature List
Feature List
Aleksandar Pavic
 
Product Update Elvis - Salesforce integration, Multi-tiered storage, File nam...
Product Update Elvis - Salesforce integration, Multi-tiered storage, File nam...Product Update Elvis - Salesforce integration, Multi-tiered storage, File nam...
Product Update Elvis - Salesforce integration, Multi-tiered storage, File nam...
Marco Makfab
 
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity APIBuilding SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
SharePointRadi
 
Apps for SharePoint
Apps for SharePointApps for SharePoint
Apps for SharePoint
Melick Baranasooriya
 
Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013
SharePointRadi
 
SharePoint 2013 Search and Creating Dynamic Content Management Solutions
SharePoint 2013 Search and Creating Dynamic Content Management SolutionsSharePoint 2013 Search and Creating Dynamic Content Management Solutions
SharePoint 2013 Search and Creating Dynamic Content Management Solutions
InnoTech
 
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Bram de Jager
 
Hosting a website on IIS Server
Hosting a website on IIS ServerHosting a website on IIS Server
Hosting a website on IIS Server
Dinesh Vasamshetty
 
Visio Services in SharePoint 2010
Visio Services in SharePoint 2010Visio Services in SharePoint 2010
Visio Services in SharePoint 2010
Alexander Meijers
 
Access share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-appsAccess share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-apps
Alexander Meijers
 
Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...
AEM HUB
 
Restful api design
Restful api designRestful api design
Restful api design
Mizan Riqzia
 
Building the Eventbrite API Ecosystem
Building the Eventbrite API EcosystemBuilding the Eventbrite API Ecosystem
Building the Eventbrite API Ecosystem
Mitch Colleran
 
Developer’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App ModelDeveloper’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App Model
bgerman
 
IBM Digital Experience Theme Customization
IBM Digital Experience Theme CustomizationIBM Digital Experience Theme Customization
IBM Digital Experience Theme Customization
Van Staub, MBA
 
Easy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with PicoEasy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with Pico
William Yang
 
IBM Social Business Toolkit
IBM Social Business ToolkitIBM Social Business Toolkit
IBM Social Business Toolkit
Van Staub, MBA
 
ECS19 - Michael Greth - Best Practice with Company Video on Microsoft Stream
ECS19 - Michael Greth - Best Practice with Company Video on Microsoft StreamECS19 - Michael Greth - Best Practice with Company Video on Microsoft Stream
ECS19 - Michael Greth - Best Practice with Company Video on Microsoft Stream
European Collaboration Summit
 
Developing Apps for SharePoint Store
Developing Apps for SharePoint StoreDeveloping Apps for SharePoint Store
Developing Apps for SharePoint Store
Kashif Imran
 
Reasons to Upgrade to DNN Evoq Content Version 7
Reasons to Upgrade to DNN Evoq Content Version 7Reasons to Upgrade to DNN Evoq Content Version 7
Reasons to Upgrade to DNN Evoq Content Version 7
DNN
 
Product Update Elvis - Salesforce integration, Multi-tiered storage, File nam...
Product Update Elvis - Salesforce integration, Multi-tiered storage, File nam...Product Update Elvis - Salesforce integration, Multi-tiered storage, File nam...
Product Update Elvis - Salesforce integration, Multi-tiered storage, File nam...
Marco Makfab
 
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity APIBuilding SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
SharePointRadi
 
Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013
SharePointRadi
 
SharePoint 2013 Search and Creating Dynamic Content Management Solutions
SharePoint 2013 Search and Creating Dynamic Content Management SolutionsSharePoint 2013 Search and Creating Dynamic Content Management Solutions
SharePoint 2013 Search and Creating Dynamic Content Management Solutions
InnoTech
 
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Bram de Jager
 
Hosting a website on IIS Server
Hosting a website on IIS ServerHosting a website on IIS Server
Hosting a website on IIS Server
Dinesh Vasamshetty
 
Visio Services in SharePoint 2010
Visio Services in SharePoint 2010Visio Services in SharePoint 2010
Visio Services in SharePoint 2010
Alexander Meijers
 
Access share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-appsAccess share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-apps
Alexander Meijers
 
Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...
AEM HUB
 
Restful api design
Restful api designRestful api design
Restful api design
Mizan Riqzia
 
Building the Eventbrite API Ecosystem
Building the Eventbrite API EcosystemBuilding the Eventbrite API Ecosystem
Building the Eventbrite API Ecosystem
Mitch Colleran
 
Developer’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App ModelDeveloper’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App Model
bgerman
 
IBM Digital Experience Theme Customization
IBM Digital Experience Theme CustomizationIBM Digital Experience Theme Customization
IBM Digital Experience Theme Customization
Van Staub, MBA
 
Easy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with PicoEasy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with Pico
William Yang
 
IBM Social Business Toolkit
IBM Social Business ToolkitIBM Social Business Toolkit
IBM Social Business Toolkit
Van Staub, MBA
 
ECS19 - Michael Greth - Best Practice with Company Video on Microsoft Stream
ECS19 - Michael Greth - Best Practice with Company Video on Microsoft StreamECS19 - Michael Greth - Best Practice with Company Video on Microsoft Stream
ECS19 - Michael Greth - Best Practice with Company Video on Microsoft Stream
European Collaboration Summit
 

Similar to Создание API, которое полюбят разработчики. Глубокое погружение (20)

Don't screw it up! How to build durable API
Don't screw it up! How to build durable API Don't screw it up! How to build durable API
Don't screw it up! How to build durable API
Alessandro Cinelli (cirpo)
 
Web REST APIs Design Principles
Web REST APIs Design PrinciplesWeb REST APIs Design Principles
Web REST APIs Design Principles
Anji Beeravalli
 
API Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
API Design Best Practices & Tech Talk : API Craft Meetup @ ApigeeAPI Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
API Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
Anil Sagar
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best Practices
Jordan Open Source Association
 
REST Api Tips and Tricks
REST Api Tips and TricksREST Api Tips and Tricks
REST Api Tips and Tricks
Maksym Bruner
 
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Codemotion
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for Longevity
MuleSoft
 
Design Web Api
Design Web ApiDesign Web Api
Design Web Api
Tailor Fontela
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 
A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2
VivekKrishna34
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
Embracing HTTP in the era of API’s
Embracing HTTP in the era of API’sEmbracing HTTP in the era of API’s
Embracing HTTP in the era of API’s
Visug
 
Consumer centric api design v0.4.0
Consumer centric api design v0.4.0Consumer centric api design v0.4.0
Consumer centric api design v0.4.0
mustafa sarac
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
jrodbx
 
Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017
JoEllen Carter
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
Restlet
 
Facebook & Twitter API
Facebook & Twitter APIFacebook & Twitter API
Facebook & Twitter API
Fabrice Delhoste
 
Cloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practicesCloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practices
Nicolas FOATA
 
Great webapis
Great webapisGreat webapis
Great webapis
Rafał Hryniewski
 
Api Design and More (Friday Training at Itnig)
Api Design and More (Friday Training at Itnig)Api Design and More (Friday Training at Itnig)
Api Design and More (Friday Training at Itnig)
itnig
 
Web REST APIs Design Principles
Web REST APIs Design PrinciplesWeb REST APIs Design Principles
Web REST APIs Design Principles
Anji Beeravalli
 
API Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
API Design Best Practices & Tech Talk : API Craft Meetup @ ApigeeAPI Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
API Design Best Practices & Tech Talk : API Craft Meetup @ Apigee
Anil Sagar
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best Practices
Jordan Open Source Association
 
REST Api Tips and Tricks
REST Api Tips and TricksREST Api Tips and Tricks
REST Api Tips and Tricks
Maksym Bruner
 
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Codemotion
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for Longevity
MuleSoft
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 
A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2
VivekKrishna34
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
Embracing HTTP in the era of API’s
Embracing HTTP in the era of API’sEmbracing HTTP in the era of API’s
Embracing HTTP in the era of API’s
Visug
 
Consumer centric api design v0.4.0
Consumer centric api design v0.4.0Consumer centric api design v0.4.0
Consumer centric api design v0.4.0
mustafa sarac
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
jrodbx
 
Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017
JoEllen Carter
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
Restlet
 
Cloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practicesCloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practices
Nicolas FOATA
 
Api Design and More (Friday Training at Itnig)
Api Design and More (Friday Training at Itnig)Api Design and More (Friday Training at Itnig)
Api Design and More (Friday Training at Itnig)
itnig
 
Ad

More from SQALab (20)

Готовим стажировку
Готовим стажировкуГотовим стажировку
Готовим стажировку
SQALab
 
Куда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщикаКуда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщика
SQALab
 
Оптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержкиОптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержки
SQALab
 
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программированияАвтоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
SQALab
 
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
SQALab
 
Continuous performance testing
Continuous performance testingContinuous performance testing
Continuous performance testing
SQALab
 
Конфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нуженКонфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нужен
SQALab
 
Команда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихииКоманда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихии
SQALab
 
API. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советовAPI. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советов
SQALab
 
Добиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестовДобиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестов
SQALab
 
Делаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIsДелаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIs
SQALab
 
Вредные привычки в тест-менеджменте
Вредные привычки в тест-менеджментеВредные привычки в тест-менеджменте
Вредные привычки в тест-менеджменте
SQALab
 
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииМощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
SQALab
 
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качествеКак hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
SQALab
 
Стили лидерства и тестирование
Стили лидерства и тестированиеСтили лидерства и тестирование
Стили лидерства и тестирование
SQALab
 
"Давайте не будем про качество"
"Давайте не будем про качество""Давайте не будем про качество"
"Давайте не будем про качество"
SQALab
 
Apache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектовApache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектов
SQALab
 
Тестирование геолокационных систем
Тестирование геолокационных системТестирование геолокационных систем
Тестирование геолокационных систем
SQALab
 
Лидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопросЛидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопрос
SQALab
 
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
SQALab
 
Готовим стажировку
Готовим стажировкуГотовим стажировку
Готовим стажировку
SQALab
 
Куда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщикаКуда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщика
SQALab
 
Оптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержкиОптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержки
SQALab
 
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программированияАвтоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
SQALab
 
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
SQALab
 
Continuous performance testing
Continuous performance testingContinuous performance testing
Continuous performance testing
SQALab
 
Конфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нуженКонфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нужен
SQALab
 
Команда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихииКоманда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихии
SQALab
 
API. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советовAPI. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советов
SQALab
 
Добиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестовДобиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестов
SQALab
 
Делаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIsДелаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIs
SQALab
 
Вредные привычки в тест-менеджменте
Вредные привычки в тест-менеджментеВредные привычки в тест-менеджменте
Вредные привычки в тест-менеджменте
SQALab
 
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииМощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
SQALab
 
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качествеКак hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
SQALab
 
Стили лидерства и тестирование
Стили лидерства и тестированиеСтили лидерства и тестирование
Стили лидерства и тестирование
SQALab
 
"Давайте не будем про качество"
"Давайте не будем про качество""Давайте не будем про качество"
"Давайте не будем про качество"
SQALab
 
Apache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектовApache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектов
SQALab
 
Тестирование геолокационных систем
Тестирование геолокационных системТестирование геолокационных систем
Тестирование геолокационных систем
SQALab
 
Лидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопросЛидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопрос
SQALab
 
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
SQALab
 
Ad

Recently uploaded (20)

How to Manage Allocations in Odoo 18 Time Off
How to Manage Allocations in Odoo 18 Time OffHow to Manage Allocations in Odoo 18 Time Off
How to Manage Allocations in Odoo 18 Time Off
Celine George
 
Freckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptxFreckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptx
EveryLibrary
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
How to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 WebsiteHow to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 Website
Celine George
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad LevelLDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDM & Mia eStudios
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Pragya Champion's Chalice 2025 Set , General Quiz
Pragya Champion's Chalice 2025 Set , General QuizPragya Champion's Chalice 2025 Set , General Quiz
Pragya Champion's Chalice 2025 Set , General Quiz
Pragya - UEM Kolkata Quiz Club
 
Semisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptxSemisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptx
Shantanu Ranjan
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time OffHow to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATIONTHE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
PROF. PAUL ALLIEU KAMARA
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
How to Manage Allocations in Odoo 18 Time Off
How to Manage Allocations in Odoo 18 Time OffHow to Manage Allocations in Odoo 18 Time Off
How to Manage Allocations in Odoo 18 Time Off
Celine George
 
Freckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptxFreckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptx
EveryLibrary
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
How to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 WebsiteHow to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 Website
Celine George
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad LevelLDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDM & Mia eStudios
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Semisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptxSemisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptx
Shantanu Ranjan
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time OffHow to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATIONTHE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
THE CHURCH AND ITS IMPACT: FOSTERING CHRISTIAN EDUCATION
PROF. PAUL ALLIEU KAMARA
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 

Создание API, которое полюбят разработчики. Глубокое погружение

  • 1. Crafting WEB API Design that Developers Love. Deep dive Roman Bugaev, Senior developer at Adform
  • 2. About us • 400+ high performance servers • High availability load balancing and failover • 200 000 requests per second • Peta Bytes of data on 50+ servers • Up to 20 releases per day • Integrations • • • • Facebook, Google, Adobe Large e-shops and CMS platform TV ads recognition Adform Marketplace
  • 3. Why? ~70% API – REST "there is no 'official' standard for RESTful web Interviews
  • 4. Pragmatic REST • REST is an architectural style and not a strict standard, it allows for a lot of flexibly • The primary design principle when crafting your API should be to maximize developer productivity and success. • Pragmatic REST is a design problem • Keep simple things simple
  • 5. Keep base URL simple & intuitive • Nouns are good; verbs are bad • 2 base URLs per resource • /users /users/1234 • Keep verbs out of your base URLs • Use HTTP verbs to operate on the collections and elements. • POST create GET read PUT update DELETE delete
  • 6. How to pick the nouns for URLs. • Plural rather than singular nouns • Foursquare • Dropbox • Facebook /checkins /files /me/friends • Concrete rather than abstract names • /items vs. /blogs, /news
  • 7. Simplify associations • GET /folders/5678/files • Get all files belonging to a specific folder • POST /folders/5678/files • Create new file for that folder
  • 8. Sweep complexity behind the ‘?’ • Attributes GET /cars?color=red&state=new&location=minsk • Paging GET /cars?limit=25&offset=50 • Global Search GET /search?q=lamb • Scoped Search GET /owners/5678/cars?q=lamb
  • 9. Handling errors • Developers learn to write code through errors • Developers depend on well-designed errors at the critical times
  • 10. Handling errors - Facebook HTTP Status Code 200 { error: { message: “Malformed access token ”, type: “OAuthException”, code: “190” } }
  • 11. Handling errors - Twilio HTTP Status Code: 401 { status: "401", message: "Authenticate", code: 20003, info: "http://www.twilio.com/docs/errors/20003" }
  • 12. A couple of best practices • Use HTTP status codes • Make messages returned in the payload as verbose as possible • • • • Code Developer message User message More Info I ❤ BEST PRACTICES Start by using the following 3 codes: • 200 – OK (success) • 400 - Bad Request (client error) • 500 - Internal Server Error (server error)
  • 13. Tips for versioning • salesforce.com /services/data/v20.0/sobjects/Account • Facebook ?v=1.0 • The version is mandatory. • Accept header for entity versioning • Specify the version with a 'v' prefix. • Use a simple ordinal number. • Create an alias for current version
  • 14. Actions • Use verbs not nouns: • /convert?from=EUR&to=CNY&amount=100 • Make it clear in your API documentation that these “non-resource” scenarios are different.
  • 15. Probe Web Resources Efficiently with OPTIONS in REST < HTTP/1.1 200 OK < Allow: GET, HEAD, POST, OPTIONS, TRACE < Content-Type: text/html; charset=UTF-8 < Date: Wed, 13 December 2013 10:24:43 GMT < Content-Length: 0
  • 16. Probe Web Resources Efficiently with HEAD in REST < HTTP/1.1 200 OK < Accept-Ranges: bytes < Content-Type: text/html; charset=UTF-8 < Date: Wed, 08 May 2013 10:12:29 GMT < ETag: "780602-4f6-4db31b2978ec0" < Last-Modified: Thu, 25 Apr 2013 16:13:23 GMT < Content-Length: 1270
  • 17. Scale • Think about scale sooner that later • Rate limits • Extra servers • Partitioning • Caching • • • • Between application and database In the application itself Using an API proxy CDN for large static content
  • 18. Supporting multiple formats • To get the JSON format from a collection or specific element: • dogs.json • /dogs/1234.json Accept header for entity versioning also applicable Default format: JSON Follow JavaScript conventions
  • 19. Chatty APIs Imagine how developers will use your API • You can design a RESTful API and still mitigate the chattiness. Be complete and RESTful and provide shortcuts Take advantage of the partial response syntax • /owners/5678?fields=name, dogs.name
  • 25. Security • Use something established • API keys for non-sensitive data only • Username/password auth for site based APIs • OAuth for server-to-server APIs • SSL for EVERYTHING sensitive
  • 26. OAuth 1. An OAuth token gives one app access to one API on behalf of one user. 2. App developers do not want responsibility of holding a user’s secret information (password). 3. there are three entities (legs) – user/server/client
  • 27. Why is OAuth important? • What if client is hacked and someone steals all the passwords? • OAuth allows the API provider to revoke tokens for an individual user and for an entire app • On the other hand, if user decides to change his password, the token will be the same. • Developers can use an OAuth library in their language
  • 28. Types of OAuth 2.0 • BEARER TOKEN • SSL and big numbers • MAC TOKEN • Uses signature instead of SSL • SAML • if you and your potential API developers don’t understand SAML or know what it is, that’s a signal to stay away