Code Monkey home page Code Monkey logo

presentation-api's Introduction

Api

What

Application Programming Interface (API) In basic terms, APIs just allow applications to communicate with one another. ... An API is not a database. It is an access point to an app that can access a database.

How

An API is a software intermediary that allows two applications to talk to each other. In other words, an API is the messenger that delivers your request to the provider that you're requesting it from and then delivers the response back to you.

Why do we use APIS

The development of apps for mobile devices meant that organisations needed to allow users to access information through apps and not just through the Internet. APIs are used to allow organisations to easily share information to many different systems.

Where

10000?0s of APIS published for open consumption. This along with Open Data movements have shifted how we can consume and process data.

When

APIs allow the movement of data in a structured manner from server to client and vice-versa

Examples - Public APIS

Documentation

  • Reading
  • Experimenting to find out what they had not documented
  • Testing continuously for regressions
  • How can we make this a better experiece

Protocols

  • Text

  • Custom formats

  • Binary

  • XML

  • SOAP

  • RPC

  • JSON

  • XML-RPC

  • JSON-RPC

  • GRPC

  • socket

  • GraphQL

  • DB

API Types

  • REST
  • REACTIVE
  • PUSH
  • PULL
  • CRUD
  • Framework

Protection + Security

  • Authentication
  • Oauth
  • SAML
  • JWT
  • !COOKIES
  • !Session
  • Monitoring
  • Realtime alerts
  • Analysis

Build in

  • Rate limits
  • Error handling
  • http retry
  • traffic shifting
  • canary a/b

Paradigms

  • Frontend

  • Middleware

  • Backend

  • SPA

  • Serverless

Microservices

  • Monolith

  • Microlith

  • Microservices

  • Nanoservices FAAS

Deployment Targets

  • Container

  • Groups of Containers

  • Groups of Groups

Standardisation

Test Requests

Mock servers

Testing

  • Selelium
  • mocha
  • load testing

Tools

Apigeneration

Swagger UI

Postman

openapi.tools

Postman

  • Tests can be built in
  • Documentation built in
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("access_token", jsonData.access_token);
pm.test('all ', () => {
    pm.test('json ', () => {pm.response.to.be.json;})
    pm.test('headers ', () => {pm.response.to.have.header('Content-Type', 'application/json; charset=utf-8');})
    pm.test('200 ', () => {pm.response.to.have.status(200);})
})

Containers

Lint

Eslint - https://eslint.org/

JSHint - https://jshint.com/

JSLint - https://www.jslint.com/

Code Testing Frameworks

Code analyis

Pipelines

  • gitops flow
  • flux
  • jenkins-x
  • devops

E2E

CICD

Diagnostics

Standard Response

    Value            Description                             Reference
     100   Continue                        [RFC7231]
     101   Switching Protocols             [RFC7231]
     102   Processing                      [RFC2518]
     103   Early Hints                     [RFC8297]
   104-199 Unassigned
     200   OK                              [RFC7231]
     201   Created                         [RFC7231]
     202   Accepted                        [RFC7231]
     203   Non-Authoritative Information   [RFC7231]
     204   No Content                      [RFC7231]
     205   Reset Content                   [RFC7231]
     206   Partial Content                 [RFC7233]
     207   Multi-Status                    [RFC4918]
     208   Already Reported                [RFC5842]
   209-225 Unassigned
     226   IM Used                         [RFC3229]
   227-299 Unassigned
     300   Multiple Choices                [RFC7231]
     301   Moved Permanently               [RFC7231]
     302   Found                           [RFC7231]
     303   See Other                       [RFC7231]
     304   Not Modified                    [RFC7232]
     305   Use Proxy                       [RFC7231]
     306   (Unused)                        [RFC7231]
     307   Temporary Redirect              [RFC7231]
     308   Permanent Redirect              [RFC7538]
   309-399 Unassigned
     400   Bad Request                     [RFC7231]
     401   Unauthorized                    [RFC7235]
     402   Payment Required                [RFC7231]
     403   Forbidden                       [RFC7231]
     404   Not Found                       [RFC7231]
     405   Method Not Allowed              [RFC7231]
     406   Not Acceptable                  [RFC7231]
     407   Proxy Authentication Required   [RFC7235]
     408   Request Timeout                 [RFC7231]
     409   Conflict                        [RFC7231]
     410   Gone                            [RFC7231]
     411   Length Required                 [RFC7231]
     412   Precondition Failed             [RFC7232]
     413   Payload Too Large               [RFC7231]
     414   URI Too Long                    [RFC7231]
     415   Unsupported Media Type          [RFC7231]
     416   Range Not Satisfiable           [RFC7233]
     417   Expectation Failed              [RFC7231]
     418   ?
   419-420 Unassigned
     421   Misdirected Request             [RFC7540]
     422   Unprocessable Entity            [RFC4918]
     423   Locked                          [RFC4918]
     424   Failed Dependency               [RFC4918]
     425   Too Early                       [RFC8470]
     426   Upgrade Required                [RFC7231]
     427   Unassigned
     428   Precondition Required           [RFC6585]
     429   Too Many Requests               [RFC6585]
     430   Unassigned
     431   Request Header Fields Too Large [RFC6585]
   432-450 Unassigned
     451   Unavailable For Legal Reasons   [RFC7725]
   452-499 Unassigned
     500   Internal Server Error           [RFC7231]
     501   Not Implemented                 [RFC7231]
     502   Bad Gateway                     [RFC7231]
     503   Service Unavailable             [RFC7231]
     504   Gateway Timeout                 [RFC7231]
     505   HTTP Version Not Supported      [RFC7231]
     506   Variant Also Negotiates         [RFC2295]
     507   Insufficient Storage            [RFC4918]
     508   Loop Detected                   [RFC5842]
     509   Unassigned
     510   Not Extended                    [RFC2774]
     511   Network Authentication Required [RFC6585]
   512-599 Unassigned

Ready to Build

  • Favourite Toolsets

  • Frameworks

Starting points

Security

Questions

  • High level API design - how do we create collections, how do we break it all down

  • Use of functions, does the code tied to the route just do some simple parsing and then call a function in terms of implementation, or do you put as much logic as possible in the actual code?

  • Pros and Cons of handling backend state vs passing it around as a parameter

  • Testing suites for Postman for example - things to look for

presentation-api's People

Contributors

duncanhealy avatar

Stargazers

Padraig O'Brien avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.