SlideShare a Scribd company logo
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?

More Related Content

What's hot

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
 
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!
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API TestingSauce Labs
 
Designing APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecDesigning APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecAdam Paxton
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - APIChetan Gadodia
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Vibhawa Nirmal
 
Postman Introduction
Postman IntroductionPostman Introduction
Postman IntroductionRahul Agarwal
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developersPatrick Savalle
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to SwaggerKnoldus Inc.
 
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
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web APIBrad Genereaux
 

What's hot (20)

Postman
PostmanPostman
Postman
 
Api Testing
Api TestingApi Testing
Api Testing
 
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
 
Api types
Api typesApi types
Api types
 
What is an API?
What is an API?What is an API?
What is an API?
 
Api testing
Api testingApi testing
Api testing
 
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 Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
 
Designing APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecDesigning APIs with OpenAPI Spec
Designing APIs with OpenAPI Spec
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface)
 
Postman Introduction
Postman IntroductionPostman Introduction
Postman Introduction
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
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
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
API Testing
API TestingAPI Testing
API Testing
 

Viewers also liked

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
 

Viewers also liked (17)

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
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
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 to 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 to 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
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 

Recently uploaded (20)

What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 

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