SlideShare a Scribd company logo
RESTFUL API CONCEPTS
AND BEST PRACTICES
Yazan Qutieshat
Tambi Jalouqa
Senior Software Engineer at Souq.com a subsidiary of amazon
Head of Products at Propeller inc.
Working on a social media aggregator opened my eyes to
many restful APIs such as (Facebook, Twitter, Instagram…)
How i used to create API’s
`GET /getComments/` [Get Comments]
`POST /addComment/` [Add a Comment]
`POST /deleteComment/` [Delete a Comment]
MY STORY
How Facebook API's work
`GET /posts/{post_id}/comments` [Get Comments]
`POST /posts/{post_id}/comments` [Add a Comment]

`DELETE /comments/{comment_id}` [Delete a Comment]
RESTFUL ARCHITECTURE
WHAT MAKES AN API
RESTFUL
Representational state transfer (REST) or RESTful web
services is a way of providing interoperability between
computer systems on the Internet. REST-compliant Web
services allow requesting systems to access and manipulate
textual representations of Web resources using a uniform
and predefined set of stateless operations.
RESTFUL ARCHITECTURE
WHAT MAKES AN API
RESTFUL
REST is the underlying architectural principle of the web. The
amazing thing about the web is the fact that clients and
servers can interact in complex ways without the client
knowing anything beforehand about the server and the
resources it hosts.
ARCHITECTURAL STYLE
THE SIMPLE VERSION
A set of guidelines (attributes and characteristic) that aims to
design a single interface that reflect your business to all
your consumers while being stateless and readable.
WHAT MAKES AN API
RESTFUL
The main ingredients of a Restful Api
• Resources
• Protocol (Http)
• Headers
• Methods
• Status Codes
The Guidelines
WHAT MAKES AN API
RESTFUL
Resources :
Any abstraction of information that has a meaning in your
domain (business)
The Guidelines
• Virtual object.
• Singleton or a Collection
• List of available options.
• Result of a mathematical operation.
WHAT MAKES AN API
RESTFUL
Protocol (HTTP) :
Methods :
Use Methods to Retrieve and Manipulate (Creation, Mutation) resources.
The Guidelines
• GET [Retrieve] : Safe, Idempotent , Cacheable
• PUT [update] : Idempotent
• DELETE [delete]: Idempotent
• PATCH [Partial update] : Idempotent
• POST [Create]
WHAT MAKES AN API
RESTFUL
Protocol (HTTP) :
Status Codes :
Use Status Codes to inform how client how he should proceed.
The Guidelines
• Successful 2xx (200 Successful, 201 Created, 204 No Content)
• Multiple choices 3xx (301 Moved, 302 Found, 304 Not Modified)
• User Errors 4xx (401 Unauthorized, 403 Forbidden, 404 Not
Found, 422 Unprocessable Entity )
• Server Errors 5xx
THE ALTERNATIVES
SOAP
RPC
GRAPH
THE ALTERNATIVES
RPC
Remote Procedure Call (RPC) is a protocol that one program
can use to request a service from a program located in another
computer on a network without having to understand the
network's details. A procedure call is also sometimes known as
a function call or a subroutine call
• Complicated
• Lacks consistency
• Oriented around procedures
THE ALTERNATIVES
SOAP
It is method for exchanging XML based message over the
Internet for providing and consuming web services. SOAP
message are transferred forming the SOAP-Envelope.
• Rigid
• Requires Development
• Requires Knowledge
THE ALTERNATIVES
GRAPH QL
Instead of working with rigid server-defined endpoints, you can
send queries to get exactly the data you’re looking for in one
request
• Still Young
• Requires domain knowledge
• Coupled with the backend
BENEFITS
• Simple
• Scalable
• Cacheable
• Testable
REINVENTING THE
WHEEL
Authentication (Basic, OAuth, JWT)
Security (ACL, CORS)
Traffic control (Rate Limiting, Termination)
Logging
TOOLS
TOOLS
Word Documents
DOCUMENTATION
TOOLS
Apiary (Blueprint)
DOCUMENTATION
TOOLS
Swagger
DOCUMENTATION
TOOLS
API Gateway AWS
Apigee
Kong
MANAGEMENT
TOOLS
Acceptance Testing
Continuous Integration
TESTING
THANK YOU
END OF PART ONE
BEST PRACTICES FOR
CREATING A RESTFUL
API
API FIRST DEVELOPMENT
Lets start with a story about a mountain bike trail
I LOVE MOUNTAIN BIKING
AND THATS WHY I BUILD
TRAILS
BUT BUILDING TRAILS IS
HARD AND REQUIRES
TRAIL DESIGN
HEAVY MACHINERY COMES
LAST. MARKING WITH STICK
AND STONE IS FIRST
SKETCHING VS PIXEL
PERFECT DESIGN
• Include the team
• Allow change to happen
• Faster feedback loop
TREAT YOUR API LIKE A
CONSUMER PRODUCT
Consumers of your API should be treated as if they are going
to pay for it.
Do not take them for granted.
They will either move on or have a bad experience.
USER EXPERIENCE
USER EXPERIENCE
Using the proper language while naming your endpoints and
resources will help users understand how to use your API.
Using nouns vs verbs helps set the mental model for using
the API.
COMMUNICATE PROPERLY
Use

POST /people
Instead of 

POST /addPerson
Be consistent in your return status codes. Try to use a few
but well understood status codes such as 200, 201, 403
Do not re-define status codes in a way that will confuse
users. Returning a 201 when a resource is edited will
confuse the user and increase cognitive load.
BE FAMILIAR
USER EXPERIENCE
Be clear about the wrong ways of using your API. If you require
a certain schema return an error that is descriptive of what is
the issue. Invalid keys, invalid datatypes, required fields that
are empty.
You will make solving issues while using the API much faster if
you are clear and helpful.
ALWAYS GIVE USEFUL FEEDBACK
USER EXPERIENCE
Always return the same schema or status code for the same
operations if possible
This will help users re-use their learned behavior
For example they can create an abstraction around using your
API
BE CONSISTENT
USER EXPERIENCE
Implement a consistent pagination, filtering or relations in
your API
Different users will have different needs. One user might
want the whole collection while another will only need a few
pages. Mobile clients would try to be bandwidth conservative
and only ask for what they need.
DESIGN FOR DIFFERENT USE


GET /people?fields=firstname,lastname&limit=10&skip=3
USER EXPERIENCE
HELP USERS BE SMARTER
USER EXPERIENCE
HELP USERS BE SMARTER
Specify the life of your returned results. Add meta data to
allow smart users to cache your data to reduce chatter and
allow for offline experiences.
Use ETag or Last-Modified to allow users to know if a
resource has been updated and they will receive fresh data
from your API
USER EXPERIENCE
USER EXPERIENCE
BE BACKWARDS COMPATIBLE
Versioning your api will allow for users that have not updated
their code to continue interacting with your API
This allows for an incremental move to a newer version on
their own paces. But always give them a push toward newer
better versions.
Available options are URI based versioning or the Accept
header or custom request headers.
JOSA TechTalks - RESTful API Concepts and Best Practices
COMMON PITFALLS
Many times API designers tend to crudify their APIs
Always think about each resource and how it fits your
domain. Sometimes a resource will only allow for creating a
new resource and not editing it.
ALWAYS USING CRUD
COMMON PITFALLS
e.g. financial transactions

POST /transactions
Transactions will not accept PUT, PATCH, DELETE
Changes to an API that will break existing clients need to be
clear. If the interface changes underneath without them
knowing it systems will break.
As discussed before always increment the available version
and help onboard users to the newer API
Always communicate upcoming changes and create the
proper channels to facilitate that
NOT USING VERSIONING
COMMON PITFALLS
COMMON PITFALLS
Designing an API without the proper feedback loop will
guarantee that your API is not usable.
Not taking the users into consideration will create an API that
is not user-centered and will require a re-design for new use
cases.
NOT INCLUDING YOUR
STAKEHOLDERS
COMMON PITFALLS
Use industry standards to document your API, Swagger,
Blueprint, RAML, etc.
Having the users to either ask for the schema or read
through your code to understand usage of your API is a
recipe for disaster.
NOT DOCUMENTING
ALWAYS BE DESIGNING
THE API IS A CONSUMER FACING
PRODUCT, TREAT THEM THAT WAY.
THANK YOU
END OF PART TWO
Q&A
Yazan Qutieshat
Tambi Jalouqa
Senior Software Engineer at Souq.com a subsidiary of amazon

yazan.qutieshat@gmail.com
Head of Products at Propeller inc. 

tambi@propellerinc.me

More Related Content

What's hot (20)

PPTX
React js
Alireza Akbari
 
PDF
Getting Started with React-Nathan Smith
TandemSeven
 
PDF
React-js
Avi Kedar
 
PPTX
Internal workshop react-js-mruiz
Miguel Ruiz Rodriguez
 
PPTX
React js basics
Maulik Shah
 
PDF
Tech Talk on ReactJS
Atlogys Technical Consulting
 
PPTX
React js programming concept
Tariqul islam
 
PDF
Fundamental concepts of react js
StephieJohn
 
PPTX
React js Rahil Memon
RahilMemon5
 
PDF
[React Native Tutorial] Lecture 6: Component, Props, and Network
Kobkrit Viriyayudhakorn
 
PPSX
React introduction
Kashyap Parmar
 
PDF
Ryan Christiani I Heard React Was Good
FITC
 
PDF
learning react
Eueung Mulyana
 
PDF
An Overview of the React Ecosystem
FITC
 
PPTX
How native is React Native? | React Native vs Native App Development
Devathon
 
PPTX
Intro to React
Justin Reock
 
PDF
Top 8 benefits of react js
Rani Sinha
 
PPTX
React workshop
Imran Sayed
 
PDF
Introduction to react
kiranabburi
 
React js
Alireza Akbari
 
Getting Started with React-Nathan Smith
TandemSeven
 
React-js
Avi Kedar
 
Internal workshop react-js-mruiz
Miguel Ruiz Rodriguez
 
React js basics
Maulik Shah
 
Tech Talk on ReactJS
Atlogys Technical Consulting
 
React js programming concept
Tariqul islam
 
Fundamental concepts of react js
StephieJohn
 
React js Rahil Memon
RahilMemon5
 
[React Native Tutorial] Lecture 6: Component, Props, and Network
Kobkrit Viriyayudhakorn
 
React introduction
Kashyap Parmar
 
Ryan Christiani I Heard React Was Good
FITC
 
learning react
Eueung Mulyana
 
An Overview of the React Ecosystem
FITC
 
How native is React Native? | React Native vs Native App Development
Devathon
 
Intro to React
Justin Reock
 
Top 8 benefits of react js
Rani Sinha
 
React workshop
Imran Sayed
 
Introduction to react
kiranabburi
 

Similar to JOSA TechTalks - RESTful API Concepts and Best Practices (20)

PPTX
Building a REST API for Longevity
MuleSoft
 
PDF
Modern REST API design principles and rules.pdf
Aparna Sharma
 
PPTX
API Design- Best Practices
Prakash Bhandari
 
PDF
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Codemotion
 
PDF
The ultimate api checklist by Blendr.io
Blendr.io
 
PDF
Web REST APIs Design Principles
Anji Beeravalli
 
PDF
REST API Recommendations
Jeelani Shaik
 
PPTX
Cloud Side: REST APIs - Best practices
Nicolas FOATA
 
PDF
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
Jitendra Bafna
 
PDF
Modern REST API design principles and rules.pdf
Aparna Sharma
 
PDF
Consumer centric api design v0.4.0
mustafa sarac
 
PDF
Creating a RESTful api without losing too much sleep
Mike Anderson
 
PDF
Architect's Guide to Building an API Program
clatimer
 
PDF
API Introduction - API Management Workshop Munich from Ronnie Mitra
CA API Management
 
PDF
"API Design: From User Need to Finished Spec" by Andrew Jordan, ex-Product @T...
TheFamily
 
PPTX
RESTful API - Best Practices
Tricode (part of Dept)
 
PDF
Создание API, которое полюбят разработчики. Глубокое погружение
SQALab
 
PPTX
Building-Robust-APIs-ASPNET-Web-API-and-RESTful-Patterns.pptx
keshabregmi1
 
PDF
Designing Usable APIs featuring Forrester Research, Inc.
CA API Management
 
PDF
How to design a good rest api tools, techniques and best practices.
Nuwan Dias
 
Building a REST API for Longevity
MuleSoft
 
Modern REST API design principles and rules.pdf
Aparna Sharma
 
API Design- Best Practices
Prakash Bhandari
 
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Codemotion
 
The ultimate api checklist by Blendr.io
Blendr.io
 
Web REST APIs Design Principles
Anji Beeravalli
 
REST API Recommendations
Jeelani Shaik
 
Cloud Side: REST APIs - Best practices
Nicolas FOATA
 
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
Jitendra Bafna
 
Modern REST API design principles and rules.pdf
Aparna Sharma
 
Consumer centric api design v0.4.0
mustafa sarac
 
Creating a RESTful api without losing too much sleep
Mike Anderson
 
Architect's Guide to Building an API Program
clatimer
 
API Introduction - API Management Workshop Munich from Ronnie Mitra
CA API Management
 
"API Design: From User Need to Finished Spec" by Andrew Jordan, ex-Product @T...
TheFamily
 
RESTful API - Best Practices
Tricode (part of Dept)
 
Создание API, которое полюбят разработчики. Глубокое погружение
SQALab
 
Building-Robust-APIs-ASPNET-Web-API-and-RESTful-Patterns.pptx
keshabregmi1
 
Designing Usable APIs featuring Forrester Research, Inc.
CA API Management
 
How to design a good rest api tools, techniques and best practices.
Nuwan Dias
 
Ad

More from Jordan Open Source Association (20)

PPTX
JOSA TechTalks - Data Oriented Architecture
Jordan Open Source Association
 
PPTX
JOSA TechTalks - Machine Learning on Graph-Structured Data
Jordan Open Source Association
 
PDF
OpenSooq Mobile Infrastructure @ Scale
Jordan Open Source Association
 
PDF
Data-Driven Digital Transformation
Jordan Open Source Association
 
PDF
Data Science in Action
Jordan Open Source Association
 
PDF
Processing Arabic Text
Jordan Open Source Association
 
PDF
JOSA TechTalks - Downgrade your Costs
Jordan Open Source Association
 
PDF
JOSA TechTalks - Docker in Production
Jordan Open Source Association
 
PPTX
JOSA TechTalks - Word Embedding and Word2Vec Explained
Jordan Open Source Association
 
PDF
Web app architecture
Jordan Open Source Association
 
PDF
Intro to the Principles of Graphic Design
Jordan Open Source Association
 
ODP
Intro to Graphic Design Elements
Jordan Open Source Association
 
PDF
JOSA TechTalk: Realtime monitoring and alerts
Jordan Open Source Association
 
PPTX
JOSA TechTalk: Metadata Management
in Big Data
Jordan Open Source Association
 
ODP
JOSA TechTalk: Introduction to Supervised Learning
Jordan Open Source Association
 
PDF
JOSA TechTalk: Taking Docker to Production
Jordan Open Source Association
 
PDF
JOSA TechTalk: Introduction to docker
Jordan Open Source Association
 
PDF
D programming language
Jordan Open Source Association
 
PDF
A taste of Functional Programming
Jordan Open Source Association
 
PDF
JOSA TechTalks - Machine Learning in Practice
Jordan Open Source Association
 
JOSA TechTalks - Data Oriented Architecture
Jordan Open Source Association
 
JOSA TechTalks - Machine Learning on Graph-Structured Data
Jordan Open Source Association
 
OpenSooq Mobile Infrastructure @ Scale
Jordan Open Source Association
 
Data-Driven Digital Transformation
Jordan Open Source Association
 
Data Science in Action
Jordan Open Source Association
 
Processing Arabic Text
Jordan Open Source Association
 
JOSA TechTalks - Downgrade your Costs
Jordan Open Source Association
 
JOSA TechTalks - Docker in Production
Jordan Open Source Association
 
JOSA TechTalks - Word Embedding and Word2Vec Explained
Jordan Open Source Association
 
Web app architecture
Jordan Open Source Association
 
Intro to the Principles of Graphic Design
Jordan Open Source Association
 
Intro to Graphic Design Elements
Jordan Open Source Association
 
JOSA TechTalk: Realtime monitoring and alerts
Jordan Open Source Association
 
JOSA TechTalk: Metadata Management
in Big Data
Jordan Open Source Association
 
JOSA TechTalk: Introduction to Supervised Learning
Jordan Open Source Association
 
JOSA TechTalk: Taking Docker to Production
Jordan Open Source Association
 
JOSA TechTalk: Introduction to docker
Jordan Open Source Association
 
D programming language
Jordan Open Source Association
 
A taste of Functional Programming
Jordan Open Source Association
 
JOSA TechTalks - Machine Learning in Practice
Jordan Open Source Association
 
Ad

Recently uploaded (20)

PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 

JOSA TechTalks - RESTful API Concepts and Best Practices

  • 1. RESTFUL API CONCEPTS AND BEST PRACTICES Yazan Qutieshat Tambi Jalouqa Senior Software Engineer at Souq.com a subsidiary of amazon Head of Products at Propeller inc.
  • 2. Working on a social media aggregator opened my eyes to many restful APIs such as (Facebook, Twitter, Instagram…) How i used to create API’s `GET /getComments/` [Get Comments] `POST /addComment/` [Add a Comment] `POST /deleteComment/` [Delete a Comment] MY STORY How Facebook API's work `GET /posts/{post_id}/comments` [Get Comments] `POST /posts/{post_id}/comments` [Add a Comment]
 `DELETE /comments/{comment_id}` [Delete a Comment]
  • 3. RESTFUL ARCHITECTURE WHAT MAKES AN API RESTFUL Representational state transfer (REST) or RESTful web services is a way of providing interoperability between computer systems on the Internet. REST-compliant Web services allow requesting systems to access and manipulate textual representations of Web resources using a uniform and predefined set of stateless operations.
  • 4. RESTFUL ARCHITECTURE WHAT MAKES AN API RESTFUL REST is the underlying architectural principle of the web. The amazing thing about the web is the fact that clients and servers can interact in complex ways without the client knowing anything beforehand about the server and the resources it hosts.
  • 6. THE SIMPLE VERSION A set of guidelines (attributes and characteristic) that aims to design a single interface that reflect your business to all your consumers while being stateless and readable.
  • 7. WHAT MAKES AN API RESTFUL The main ingredients of a Restful Api • Resources • Protocol (Http) • Headers • Methods • Status Codes The Guidelines
  • 8. WHAT MAKES AN API RESTFUL Resources : Any abstraction of information that has a meaning in your domain (business) The Guidelines • Virtual object. • Singleton or a Collection • List of available options. • Result of a mathematical operation.
  • 9. WHAT MAKES AN API RESTFUL Protocol (HTTP) : Methods : Use Methods to Retrieve and Manipulate (Creation, Mutation) resources. The Guidelines • GET [Retrieve] : Safe, Idempotent , Cacheable • PUT [update] : Idempotent • DELETE [delete]: Idempotent • PATCH [Partial update] : Idempotent • POST [Create]
  • 10. WHAT MAKES AN API RESTFUL Protocol (HTTP) : Status Codes : Use Status Codes to inform how client how he should proceed. The Guidelines • Successful 2xx (200 Successful, 201 Created, 204 No Content) • Multiple choices 3xx (301 Moved, 302 Found, 304 Not Modified) • User Errors 4xx (401 Unauthorized, 403 Forbidden, 404 Not Found, 422 Unprocessable Entity ) • Server Errors 5xx
  • 12. THE ALTERNATIVES RPC Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a program located in another computer on a network without having to understand the network's details. A procedure call is also sometimes known as a function call or a subroutine call • Complicated • Lacks consistency • Oriented around procedures
  • 13. THE ALTERNATIVES SOAP It is method for exchanging XML based message over the Internet for providing and consuming web services. SOAP message are transferred forming the SOAP-Envelope. • Rigid • Requires Development • Requires Knowledge
  • 14. THE ALTERNATIVES GRAPH QL Instead of working with rigid server-defined endpoints, you can send queries to get exactly the data you’re looking for in one request • Still Young • Requires domain knowledge • Coupled with the backend
  • 15. BENEFITS • Simple • Scalable • Cacheable • Testable
  • 16. REINVENTING THE WHEEL Authentication (Basic, OAuth, JWT) Security (ACL, CORS) Traffic control (Rate Limiting, Termination) Logging
  • 17. TOOLS
  • 23. THANK YOU END OF PART ONE
  • 25. API FIRST DEVELOPMENT Lets start with a story about a mountain bike trail
  • 26. I LOVE MOUNTAIN BIKING AND THATS WHY I BUILD TRAILS
  • 27. BUT BUILDING TRAILS IS HARD AND REQUIRES TRAIL DESIGN
  • 28. HEAVY MACHINERY COMES LAST. MARKING WITH STICK AND STONE IS FIRST
  • 29. SKETCHING VS PIXEL PERFECT DESIGN • Include the team • Allow change to happen • Faster feedback loop
  • 30. TREAT YOUR API LIKE A CONSUMER PRODUCT Consumers of your API should be treated as if they are going to pay for it. Do not take them for granted. They will either move on or have a bad experience.
  • 32. USER EXPERIENCE Using the proper language while naming your endpoints and resources will help users understand how to use your API. Using nouns vs verbs helps set the mental model for using the API. COMMUNICATE PROPERLY Use
 POST /people Instead of 
 POST /addPerson
  • 33. Be consistent in your return status codes. Try to use a few but well understood status codes such as 200, 201, 403 Do not re-define status codes in a way that will confuse users. Returning a 201 when a resource is edited will confuse the user and increase cognitive load. BE FAMILIAR USER EXPERIENCE
  • 34. Be clear about the wrong ways of using your API. If you require a certain schema return an error that is descriptive of what is the issue. Invalid keys, invalid datatypes, required fields that are empty. You will make solving issues while using the API much faster if you are clear and helpful. ALWAYS GIVE USEFUL FEEDBACK USER EXPERIENCE
  • 35. Always return the same schema or status code for the same operations if possible This will help users re-use their learned behavior For example they can create an abstraction around using your API BE CONSISTENT USER EXPERIENCE
  • 36. Implement a consistent pagination, filtering or relations in your API Different users will have different needs. One user might want the whole collection while another will only need a few pages. Mobile clients would try to be bandwidth conservative and only ask for what they need. DESIGN FOR DIFFERENT USE 
 GET /people?fields=firstname,lastname&limit=10&skip=3 USER EXPERIENCE
  • 37. HELP USERS BE SMARTER USER EXPERIENCE
  • 38. HELP USERS BE SMARTER Specify the life of your returned results. Add meta data to allow smart users to cache your data to reduce chatter and allow for offline experiences. Use ETag or Last-Modified to allow users to know if a resource has been updated and they will receive fresh data from your API USER EXPERIENCE
  • 39. USER EXPERIENCE BE BACKWARDS COMPATIBLE Versioning your api will allow for users that have not updated their code to continue interacting with your API This allows for an incremental move to a newer version on their own paces. But always give them a push toward newer better versions. Available options are URI based versioning or the Accept header or custom request headers.
  • 42. Many times API designers tend to crudify their APIs Always think about each resource and how it fits your domain. Sometimes a resource will only allow for creating a new resource and not editing it. ALWAYS USING CRUD COMMON PITFALLS e.g. financial transactions
 POST /transactions Transactions will not accept PUT, PATCH, DELETE
  • 43. Changes to an API that will break existing clients need to be clear. If the interface changes underneath without them knowing it systems will break. As discussed before always increment the available version and help onboard users to the newer API Always communicate upcoming changes and create the proper channels to facilitate that NOT USING VERSIONING COMMON PITFALLS
  • 44. COMMON PITFALLS Designing an API without the proper feedback loop will guarantee that your API is not usable. Not taking the users into consideration will create an API that is not user-centered and will require a re-design for new use cases. NOT INCLUDING YOUR STAKEHOLDERS
  • 45. COMMON PITFALLS Use industry standards to document your API, Swagger, Blueprint, RAML, etc. Having the users to either ask for the schema or read through your code to understand usage of your API is a recipe for disaster. NOT DOCUMENTING
  • 46. ALWAYS BE DESIGNING THE API IS A CONSUMER FACING PRODUCT, TREAT THEM THAT WAY.
  • 47. THANK YOU END OF PART TWO
  • 48. Q&A Yazan Qutieshat Tambi Jalouqa Senior Software Engineer at Souq.com a subsidiary of amazon
 [email protected] Head of Products at Propeller inc. 
 [email protected]