SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
API
An introduction
WEB REST JSON API
● WEB - Set of HTTP Endpoints

● REST - Descriptive URLs, nouns and verbs,
  emphasis on readability

● JSON - Output format (JavaScript Object
  Notation)

● API - Application Programming Interface
Other WS-Protocols
● SOAP
● XML-RPC
● ...

● Clean protocol (less complexity)
● Reduces overhead of XML envelopes
  creation/handling
Other Output Formats
● XML
● CSV
● ...

● Less verbosity
● Client direct interaction (most clients handle
  Javascript/JSON interaction)
Who is it for?
●   Desktop Applications
●   Mobile Applications
●   Third-Party Web Applications
●   Everything that HTTPs

Purpose
Interaction of external services with our
backend
Who is it for? (2)
End User
Client Service Developer Team

Goal
Maximize end user productivity
Modules


● Input - Output - Error Output
● Documentation
● User/App Identification
Input - Output - Error Output
Think of each HTTP Endpoint as a method

● What should it receive?
● What should it respond/return?
● How should it behave when something was
  unexpected?
Input - Output - Error Output (2)
http://api.platform.com/banjos/1

● What it received
  ○ 1 (identifier of the banjo)
● What will it respond?
  ○ Depends of your design decision, as long as its
    JSON (ex: {“state” : “ok”, “banjo” : {“id” : 1, “brand”:
    “Les Paulanjo”}}
● How should it handle errors?
  ○ Depends of your design decision, as long as its
    JSON (ex: {“state” : “error”, “error” : “No banjo 1”}
Input - Output - Error Output (3)
In Rightclearing:

All responses have a “state” parameter (possible values
either “ok” or “error”)

GET - response definition per resource/action
POST - returns Id of the newly-created resource
PUT - nothing relevant
DELETE - nothing relevant
Input - Output - Error Output (4)
Errors In Rightclearing:
● single error:
   ○ error: error code
   ○ error_description: error message
   ○ error_uri: uri for the error documentation

● multiple errors:
   ○ errors: collection of errors
   ○ for each error:
         ■ code: error code
         ■ messages: collection or error messages
         ■ uri: uri for the error documentation
Input - Output - Error Output (5)
Room for Improvement


● “single error” spec is only used by Oauth endpoints
    (follows its spec)
●   “multiple errors” spec is used everywhere else
    (convention/ience for multiple validation message
    problem)

Could one find a standardization of error messages?
This might get confusing
Documentation
Under construction...

● APIs are not Apps (no incremental learning
  here, no navigating)
● End User must know what can he use, how
  can he use, where can he use.

Straightforwardness is the key - be very clear
and concise in describing functionality
Documentation (2)
For each endpoint:
● Description
● Route
● Request Method
● Request Headers
● Request Parameters
● Response Headers
● Response Body
● Example
Documentation (3)
For each error (still under development):
● Description
● Solutions/Workarounds
● ...(?)




https://docs.google.
com/document/d/1daK5zRlPZDQ2tV6TFUgibEmejLjrkSavD_6ktU0hpQE/edit
User/App Identification
Many approaches:
● app password
● Open ID
● Oauth
● etc...
User/App Identification
(Oauth)
● Manager owns resources in Rightclearing
  (Resource Owner)
● Allows binding of Resource Owner’s
  accounts in other services with his
  Rightclearing Account (easy identification)
● Resource Owner can define a set of
  permissions per client application
● Resources are the Resource Owner’s
  responsibility
User/App Identification
(Oauth) (2)
● Doesn't provide security (SSL does)
● Authorization Protocol, yet needs
  authentication
● ...

● no clear better alternative
● a lot of existing libraries on the protocol in
  most of programming languages
API Application Ecosystem
● Framework - Sinatra

● Common modules libraries - rc-logic

● Architecture - MVDispatcher / Façade

● SDKs - rc-sdk-ruby (for now)

● Integration - Oauth Authorizations
Framework - Sinatra
Advantages

● Minimal
● Thread-safe
● Does not make assumptions
● Flexible
● Lots of extensions / well-developed
  ecosystem
● Supports HTTP very well
Framework - Sinatra (2)
Disadvantages

● Sinatra specific, found none, maybe later


(Rails dependent behaviour in certain gems are more a
gem-specific disadvantage than the other way round)
Common modules libraries
rc-logic
●   We want to process user input,
    access/handle resources, provide JSON
    output
●   Sinatra/Ruby handle user input/output,
    AR/filesystem libraries handle resources

Data Integrity must be kept cross-application (a
resource in the API is the same as in the main
web app)
Common modules libraries
rc-logic (2)
What is shared?

● Common Data Model Mapping / Integration
● Common Data Model/File handling libraries
● Common configuration (database conf, app
  conf, filesystem conf)
Architecture - MVDispatcher /
Façade
● Models - API-specific models or Extensions of
  common models with API-specific behaviour
● Views - Handle model view representation
  (JSON-visible attributes, model delegations,
  attribute formatting)
● Helpers - encapsulated logic from filters/routes
  conveniently packed
● Filters - route pre-filtering
● Apis - Façades for sub-components/APIs
● API - Where everything is bound
Architecture - MVDispatcher /
Façade (2)
SDKs - rc-sdk-ruby
Library to ease the integration of a possible
external app with the API using language-specific
HTTP/Oauth libraries.

● Two Entities - App and User
● DSL for building REST Requests
● Provides Responses Handling

Existing SDK only for Ruby (already used for
restorm integration with the API)
SDKs - rc-sdk-ruby (2)


Javascript SDK(???)
(Java? PHP? Python? etc...)
Integration
Provides API access to external clients

● Handled in the Web App (Oauth flow)
● Web App supplies resource owner
  authorizations
● API delivers access tokens
Integration (2)
Questions?

Más contenido relacionado

La actualidad más candente

Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web APIBrad Genereaux
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaEdureka!
 
API Test Automation
API Test Automation API Test Automation
API Test Automation SQALab
 
Postman. From simple API test to end to end scenario
Postman. From simple API test to end to end scenarioPostman. From simple API test to end to end scenario
Postman. From simple API test to end to end scenarioHYS Enterprise
 
Test Design and Automation for REST API
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST APIIvan Katunou
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API TestingSauce Labs
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developersPatrick Savalle
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGSiddharth Sharma
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonTEST Huddle
 

La actualidad más candente (20)

Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Api types
Api typesApi types
Api types
 
Belajar Postman test runner
Belajar Postman test runnerBelajar Postman test runner
Belajar Postman test runner
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
What is an API
What is an APIWhat is an API
What is an API
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
 
Rest API
Rest APIRest API
Rest API
 
Postman. From simple API test to end to end scenario
Postman. From simple API test to end to end scenarioPostman. From simple API test to end to end scenario
Postman. From simple API test to end to end scenario
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Test Design and Automation for REST API
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST API
 
REST API
REST APIREST API
REST API
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
Api Testing
Api TestingApi Testing
Api Testing
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
API Testing
API TestingAPI Testing
API Testing
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 

Destacado

API Economy: 2016 Horizonwatch Trend Brief
API Economy:  2016 Horizonwatch Trend BriefAPI Economy:  2016 Horizonwatch Trend Brief
API Economy: 2016 Horizonwatch Trend BriefBill Chamberlin
 
APIs for biz dev 2.0 - Which business model to win in the API Economy?
APIs for biz dev 2.0 - Which business model to win in the API Economy?APIs for biz dev 2.0 - Which business model to win in the API Economy?
APIs for biz dev 2.0 - Which business model to win in the API Economy?3scale
 
API Frenzy: API Strategy 101
API Frenzy: API Strategy 101API Frenzy: API Strategy 101
API Frenzy: API Strategy 101Akana
 
The Acceleration of the API Economy
The Acceleration of the API EconomyThe Acceleration of the API Economy
The Acceleration of the API EconomyPerficient, Inc.
 
Why API? - Business of APIs Conference
Why API? - Business of APIs ConferenceWhy API? - Business of APIs Conference
Why API? - Business of APIs ConferenceDaniel Jacobson
 
APIs 101: What are they? What do they have to do with genealogy?
APIs 101: What are they? What do they have to do with genealogy?APIs 101: What are they? What do they have to do with genealogy?
APIs 101: What are they? What do they have to do with genealogy?Colleen Greene
 
Welcome to the API Economy
Welcome to the API EconomyWelcome to the API Economy
Welcome to the API EconomyNino Guarnacci
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIsamesar0
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical WritingSarah Maddox
 
API 101 - Understanding APIs.
API 101 - Understanding APIs.API 101 - Understanding APIs.
API 101 - Understanding APIs.Kirsten Hunter
 
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...John Musser
 
Pizza Hut Marketing Research Project
Pizza Hut Marketing Research ProjectPizza Hut Marketing Research Project
Pizza Hut Marketing Research ProjectHanan Rasool
 

Destacado (16)

API Economy: 2016 Horizonwatch Trend Brief
API Economy:  2016 Horizonwatch Trend BriefAPI Economy:  2016 Horizonwatch Trend Brief
API Economy: 2016 Horizonwatch Trend Brief
 
What's an api
What's an apiWhat's an api
What's an api
 
APIs for biz dev 2.0 - Which business model to win in the API Economy?
APIs for biz dev 2.0 - Which business model to win in the API Economy?APIs for biz dev 2.0 - Which business model to win in the API Economy?
APIs for biz dev 2.0 - Which business model to win in the API Economy?
 
Api management 101
Api management 101Api management 101
Api management 101
 
API Frenzy: API Strategy 101
API Frenzy: API Strategy 101API Frenzy: API Strategy 101
API Frenzy: API Strategy 101
 
The Acceleration of the API Economy
The Acceleration of the API EconomyThe Acceleration of the API Economy
The Acceleration of the API Economy
 
Api economy
Api economyApi economy
Api economy
 
Why API? - Business of APIs Conference
Why API? - Business of APIs ConferenceWhy API? - Business of APIs Conference
Why API? - Business of APIs Conference
 
APIs 101: What are they? What do they have to do with genealogy?
APIs 101: What are they? What do they have to do with genealogy?APIs 101: What are they? What do they have to do with genealogy?
APIs 101: What are they? What do they have to do with genealogy?
 
Welcome to the API Economy
Welcome to the API EconomyWelcome to the API Economy
Welcome to the API Economy
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
 
Api for dummies
Api for dummies  Api for dummies
Api for dummies
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
API 101 - Understanding APIs.
API 101 - Understanding APIs.API 101 - Understanding APIs.
API 101 - Understanding APIs.
 
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
 
Pizza Hut Marketing Research Project
Pizza Hut Marketing Research ProjectPizza Hut Marketing Research Project
Pizza Hut Marketing Research Project
 

Similar a Api presentation

Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationTim Burks
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanJexia
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCTim Burks
 
GraphQL is actually rest
GraphQL is actually restGraphQL is actually rest
GraphQL is actually restJakub Riedl
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays
 
Designing a json/rest api for your mobile app
Designing a json/rest api for your mobile appDesigning a json/rest api for your mobile app
Designing a json/rest api for your mobile appOlivier Destrebecq
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For ArchitectsKevin Brockhoff
 
Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)Tim Burks
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App EngineVlad Filippov
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first designKyrylo Reznykov
 
Helpful logging with python
Helpful logging with pythonHelpful logging with python
Helpful logging with pythonroskakori
 
How to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxHow to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxChanna Ly
 
Lisbon Mulesoft Meetup - Logging Aggregation & Visualization
Lisbon Mulesoft Meetup - Logging Aggregation & VisualizationLisbon Mulesoft Meetup - Logging Aggregation & Visualization
Lisbon Mulesoft Meetup - Logging Aggregation & VisualizationSteve Michael Fernandes
 

Similar a Api presentation (20)

Node.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniquesNode.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniques
 
Cloud Native API Design and Management
Cloud Native API Design and ManagementCloud Native API Design and Management
Cloud Native API Design and Management
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel Mardjan
 
Software Development with PHP & Laravel
Software Development  with PHP & LaravelSoftware Development  with PHP & Laravel
Software Development with PHP & Laravel
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 
GraphQL is actually rest
GraphQL is actually restGraphQL is actually rest
GraphQL is actually rest
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
 
Designing a json/rest api for your mobile app
Designing a json/rest api for your mobile appDesigning a json/rest api for your mobile app
Designing a json/rest api for your mobile app
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For Architects
 
Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App Engine
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
Binder: Android IPC
Binder: Android IPCBinder: Android IPC
Binder: Android IPC
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first design
 
Mobile+API
Mobile+APIMobile+API
Mobile+API
 
Helpful logging with python
Helpful logging with pythonHelpful logging with python
Helpful logging with python
 
How to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxHow to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptx
 
Lisbon Mulesoft Meetup - Logging Aggregation & Visualization
Lisbon Mulesoft Meetup - Logging Aggregation & VisualizationLisbon Mulesoft Meetup - Logging Aggregation & Visualization
Lisbon Mulesoft Meetup - Logging Aggregation & Visualization
 

Último

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Api presentation

  • 2. WEB REST JSON API ● WEB - Set of HTTP Endpoints ● REST - Descriptive URLs, nouns and verbs, emphasis on readability ● JSON - Output format (JavaScript Object Notation) ● API - Application Programming Interface
  • 3. Other WS-Protocols ● SOAP ● XML-RPC ● ... ● Clean protocol (less complexity) ● Reduces overhead of XML envelopes creation/handling
  • 4. Other Output Formats ● XML ● CSV ● ... ● Less verbosity ● Client direct interaction (most clients handle Javascript/JSON interaction)
  • 5. Who is it for? ● Desktop Applications ● Mobile Applications ● Third-Party Web Applications ● Everything that HTTPs Purpose Interaction of external services with our backend
  • 6. Who is it for? (2) End User Client Service Developer Team Goal Maximize end user productivity
  • 7. Modules ● Input - Output - Error Output ● Documentation ● User/App Identification
  • 8. Input - Output - Error Output Think of each HTTP Endpoint as a method ● What should it receive? ● What should it respond/return? ● How should it behave when something was unexpected?
  • 9. Input - Output - Error Output (2) http://api.platform.com/banjos/1 ● What it received ○ 1 (identifier of the banjo) ● What will it respond? ○ Depends of your design decision, as long as its JSON (ex: {“state” : “ok”, “banjo” : {“id” : 1, “brand”: “Les Paulanjo”}} ● How should it handle errors? ○ Depends of your design decision, as long as its JSON (ex: {“state” : “error”, “error” : “No banjo 1”}
  • 10. Input - Output - Error Output (3) In Rightclearing: All responses have a “state” parameter (possible values either “ok” or “error”) GET - response definition per resource/action POST - returns Id of the newly-created resource PUT - nothing relevant DELETE - nothing relevant
  • 11. Input - Output - Error Output (4) Errors In Rightclearing: ● single error: ○ error: error code ○ error_description: error message ○ error_uri: uri for the error documentation ● multiple errors: ○ errors: collection of errors ○ for each error: ■ code: error code ■ messages: collection or error messages ■ uri: uri for the error documentation
  • 12. Input - Output - Error Output (5) Room for Improvement ● “single error” spec is only used by Oauth endpoints (follows its spec) ● “multiple errors” spec is used everywhere else (convention/ience for multiple validation message problem) Could one find a standardization of error messages? This might get confusing
  • 13. Documentation Under construction... ● APIs are not Apps (no incremental learning here, no navigating) ● End User must know what can he use, how can he use, where can he use. Straightforwardness is the key - be very clear and concise in describing functionality
  • 14. Documentation (2) For each endpoint: ● Description ● Route ● Request Method ● Request Headers ● Request Parameters ● Response Headers ● Response Body ● Example
  • 15. Documentation (3) For each error (still under development): ● Description ● Solutions/Workarounds ● ...(?) https://docs.google. com/document/d/1daK5zRlPZDQ2tV6TFUgibEmejLjrkSavD_6ktU0hpQE/edit
  • 16. User/App Identification Many approaches: ● app password ● Open ID ● Oauth ● etc...
  • 17. User/App Identification (Oauth) ● Manager owns resources in Rightclearing (Resource Owner) ● Allows binding of Resource Owner’s accounts in other services with his Rightclearing Account (easy identification) ● Resource Owner can define a set of permissions per client application ● Resources are the Resource Owner’s responsibility
  • 18. User/App Identification (Oauth) (2) ● Doesn't provide security (SSL does) ● Authorization Protocol, yet needs authentication ● ... ● no clear better alternative ● a lot of existing libraries on the protocol in most of programming languages
  • 19. API Application Ecosystem ● Framework - Sinatra ● Common modules libraries - rc-logic ● Architecture - MVDispatcher / Façade ● SDKs - rc-sdk-ruby (for now) ● Integration - Oauth Authorizations
  • 20. Framework - Sinatra Advantages ● Minimal ● Thread-safe ● Does not make assumptions ● Flexible ● Lots of extensions / well-developed ecosystem ● Supports HTTP very well
  • 21. Framework - Sinatra (2) Disadvantages ● Sinatra specific, found none, maybe later (Rails dependent behaviour in certain gems are more a gem-specific disadvantage than the other way round)
  • 22. Common modules libraries rc-logic ● We want to process user input, access/handle resources, provide JSON output ● Sinatra/Ruby handle user input/output, AR/filesystem libraries handle resources Data Integrity must be kept cross-application (a resource in the API is the same as in the main web app)
  • 23. Common modules libraries rc-logic (2) What is shared? ● Common Data Model Mapping / Integration ● Common Data Model/File handling libraries ● Common configuration (database conf, app conf, filesystem conf)
  • 24. Architecture - MVDispatcher / Façade ● Models - API-specific models or Extensions of common models with API-specific behaviour ● Views - Handle model view representation (JSON-visible attributes, model delegations, attribute formatting) ● Helpers - encapsulated logic from filters/routes conveniently packed ● Filters - route pre-filtering ● Apis - Façades for sub-components/APIs ● API - Where everything is bound
  • 26. SDKs - rc-sdk-ruby Library to ease the integration of a possible external app with the API using language-specific HTTP/Oauth libraries. ● Two Entities - App and User ● DSL for building REST Requests ● Provides Responses Handling Existing SDK only for Ruby (already used for restorm integration with the API)
  • 27. SDKs - rc-sdk-ruby (2) Javascript SDK(???) (Java? PHP? Python? etc...)
  • 28. Integration Provides API access to external clients ● Handled in the Web App (Oauth flow) ● Web App supplies resource owner authorizations ● API delivers access tokens