Slide 1

Slide 1 text

Arnaud Lauret @apihandyman A quest for simplicity AXA Banque From depths of IS to heights of API

Slide 2

Slide 2 text

One does not simply start a quest without a goal The events depicted in this talk are fictitious. Any similarity to any information system living or dead is merely coincidental.

Slide 3

Slide 3 text

What is your quest?

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

What is your favorite word in API?

Slide 6

Slide 6 text

Application?

Slide 7

Slide 7 text

Programming?

Slide 8

Slide 8 text

Interface?

Slide 9

Slide 9 text

Interface!

Slide 10

Slide 10 text

The place at which independent and often unrelated systems meet and interact with each other

Slide 11

Slide 11 text

Photos of interface with my hands

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

What have they in common?

Slide 14

Slide 14 text

Us

Slide 15

Slide 15 text

People (Even APIs)

Slide 16

Slide 16 text

API = UI for people building programs

Slide 17

Slide 17 text

What’s happening behind an interface? The microwave oven parable

Slide 18

Slide 18 text

Abstraction A picture is worth a thousand words

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

What do we seek when using an interface (especially an API) ?

Slide 21

Slide 21 text

Simplicity

Slide 22

Slide 22 text

Easy to use

Slide 23

Slide 23 text

Easy to understand Error 1543 Missing email

Slide 24

Slide 24 text

Adapted to the targeted audience

Slide 25

Slide 25 text

So, what is our quest?

Slide 26

Slide 26 text

Simplify

Slide 27

Slide 27 text

Core Banking System A long time ago...

Slide 28

Slide 28 text

This is an interface

Slide 29

Slide 29 text

Access

Slide 30

Slide 30 text

IVR

Slide 31

Slide 31 text

Interactive Voice Response CBS Database CBS Non CBS Database IVR ZBAL0 ZBALV ZBALA ZBALY

Slide 32

Slide 32 text

FWW

Slide 33

Slide 33 text

Minitel CBS Database CBS Non CBS Database IVR MIN MQ Message: F1202167754151912540123777463779FRF0300020160917

Slide 34

Slide 34 text

Is interfacing with CBS simple? ● Is it easy to use? ● It it easy to understand? ● Is the abstraction adapted to the audience?

Slide 35

Slide 35 text

So, it’s not simple

Slide 36

Slide 36 text

A few years laters... Web services

Slide 37

Slide 37 text

This is a dinosaur

Slide 38

Slide 38 text

At that time... CBS Database CBS Non CBS Database IVR MIN WEB

Slide 39

Slide 39 text

SOA(P)

Slide 40

Slide 40 text

SOA Principles ● Service ● Loose coupling ● Reusability

Slide 41

Slide 41 text

SOAP Protocol ● Use HTTP as a transport protocol ● XML based ● Input message contains the action to trigger and the data

Slide 42

Slide 42 text

Service or you’re ired!

Slide 43

Slide 43 text

SOA(P) CBS Database CBS Non CBS Database MIN IVR WEB SOAP services

Slide 44

Slide 44 text

Several years later

Slide 45

Slide 45 text

SOA(P) CBS Database CBS Non CBS Database IVR WEB JBOWS IVR WEB

Slide 46

Slide 46 text

Is interfacing with SOA simple? ● Is it easy to use? ● It it easy to understand? ● Is the abstraction adapted to the audience?

Slide 47

Slide 47 text

Better but not awesome...

Slide 48

Slide 48 text

A few years ago ... APIs

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

Mobile

Slide 51

Slide 51 text

Middleware IVR WEB SOAP services MMW

Slide 52

Slide 52 text

ROAST

Slide 53

Slide 53 text

ROAST API recipe 1. Take a SOAP/XML web service name add a / before it 2. Choose randomly an HTTP method between GET, PUT, POST, PATCH or DELETE, put it before the / 3. Transform input/output data from XML to JSON 4. If the method is GET or DELETE, put all parameters in query variables 5. And be sure to always return HTTP status 200

Slide 54

Slide 54 text

The mobile team discovering GET /cancelTrfr?ztr1={id}

Slide 55

Slide 55 text

Several years later

Slide 56

Slide 56 text

Seriously

Slide 57

Slide 57 text

A REST API

Slide 58

Slide 58 text

Design First

Slide 59

Slide 59 text

Use resource instead of actions

Slide 60

Slide 60 text

A list of wire transfers /transfers

Slide 61

Slide 61 text

A wire transfers /transfers/{transferId}

Slide 62

Slide 62 text

Use relevant HTTP method

Slide 63

Slide 63 text

Create a transfer POST /transfers

Slide 64

Slide 64 text

Delete a pending wire transfer DELETE /transfers/{transferId}

Slide 65

Slide 65 text

Update a customer email PATCH /customers/me

Slide 66

Slide 66 text

Update a customer phone number PATCH /customers/me

Slide 67

Slide 67 text

Use relevant HTTP status

Slide 68

Slide 68 text

403 Not enough money

Slide 69

Slide 69 text

503 No transfer between 1 am and 2 am

Slide 70

Slide 70 text

Provide hypermedia controls

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

GET /accounts/C1 { “id”: “C1”, “balance”: , “actions”: [ { “name”: “transfer”, “method”: “POST”, “href”: “https://bank.com/transfers”} ] }

Slide 73

Slide 73 text

Different ways to fill the set of actions

Slide 74

Slide 74 text

#1 Takeshi’s Castle Knock Knock

Slide 75

Slide 75 text

403 Forbidden { “code”: 1012, “message”: “Insufficient balance.” }

Slide 76

Slide 76 text

503 Service unavailable { “code”: 1214, “message”: “No transfer between 1am and 2am.” }

Slide 77

Slide 77 text

#2 This is bowling. There are rules.

Slide 78

Slide 78 text

GET /accounts/C1 { “id”: “C1”, “balance”: -200, “actions”: [ ] }

Slide 79

Slide 79 text

GET /accounts/C1 { “id”: “C1”, “balance”: 20000, “actions”: [ ] }

Slide 80

Slide 80 text

#3 The Dude abides.

Slide 81

Slide 81 text

GET /accounts/C1 { “id”: “C1”, “balance”: -200, “actions”: [ { “name”: “transfer”, “status”: 403, “error”: { “code”: 1012, “message”: “Insufficient balance.”} } ] }

Slide 82

Slide 82 text

GET /accounts/C1 { “id”: “C1”, “balance”: 20000, “actions”: [ { “name”: “transfer”, “status”: 503, “error”: { “code”: 1214, “message”: “No transfer between 1am and 2am.”} } ] }

Slide 83

Slide 83 text

It it really so simple to design an API?

Slide 84

Slide 84 text

Is interfacing with a RESTful API simple? ● Is it easy to use? ● It it easy to understand? ● Is the abstraction adapted to the audience?

Slide 85

Slide 85 text

Simple as a lego brick

Slide 86

Slide 86 text

To the heights of API and beyond... The end?