SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
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?

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

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
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Api types
Api typesApi types
Api types
 
Rest API
Rest APIRest API
Rest API
 
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
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
Api Testing
Api TestingApi Testing
Api Testing
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
What's an api
What's an apiWhat's an api
What's an api
 
Web API Basics
Web API BasicsWeb API Basics
Web API Basics
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
Api testing
Api testingApi testing
Api testing
 
Web api
Web apiWeb api
Web api
 
Postman
PostmanPostman
Postman
 
API 101 event.pdf
API 101 event.pdfAPI 101 event.pdf
API 101 event.pdf
 
REST API
REST APIREST API
REST API
 
REST-API overview / concepts
REST-API overview / conceptsREST-API overview / concepts
REST-API overview / concepts
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface)
 

Andere mochten auch

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
 

Andere mochten auch (15)

API Economy: 2016 Horizonwatch Trend Brief
API Economy:  2016 Horizonwatch Trend BriefAPI Economy:  2016 Horizonwatch Trend Brief
API Economy: 2016 Horizonwatch Trend Brief
 
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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Kürzlich hochgeladen (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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