expanding apis beyond the web

56
@Braintree_Dev @SeraAndroid Expanding APIs beyond the Web Tim Messerschmidt <Head of Developer Advocacy, EMEA/> Braintree_Dev. #APIDays Paris

Upload: tim-messerschmidt

Post on 16-Jul-2015

1.002 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Expanding APIs beyond the Web

Tim Messerschmidt

<Head of Developer Advocacy, EMEA/>

Braintree_Dev.

#APIDays Paris

Page 2: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Page 3: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

That’s me

Page 4: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid@Braintree_Dev @SeraAndroid

Page 5: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

OFF FUTUREPayment Method

ON

ON

ON

ON

Braintree

Page 6: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>3 key requirements in tech

Page 7: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidSECURITY

Page 8: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidFLEXIBILITY

Page 9: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidSCALABILITY

Page 10: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>Current technology landscape

Page 11: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid@Braintree_Dev @SeraAndroid

Page 12: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid@Braintree_Dev @SeraAndroid

Page 13: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Bluetooth LE

Page 14: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Differences BLE vs. Bluetooth

• Lower range (50m vs 100m)

• Lower latency (Factor 16)

• Lower battery consumption (Factor 100)

nodesagency.com/the-beacon-dictionary

Page 15: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid@Braintree_Dev @SeraAndroidESTIMOTE BEACONS

Page 16: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>Payments in the background

Page 17: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Page 18: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>Wearables and Biometrics

Page 19: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidFINGERPRINT AS UNIQUE TOKEN

Page 20: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidHEARTBEAT AS IDENTIFIER

Page 21: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

A Trusted Environment

Page 22: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

“Favor security too much over the experience

and you’ll make the website a pain to use.”

smashingmagazine.com/2012/10/26/password-masking-hurt-signup-form

Page 23: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>Introducing: The Hype Cyclegartner.com/newsroom/id/2819918 (2014)

Page 24: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Page 25: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Page 26: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Page 27: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Page 28: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>26 Billion IoT devices by 2020gartner.com/newsroom/id/2636073 (2013)

Page 29: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>2020: 200 billion smart devicesintel.ly/1i8O2ec (2014)

Page 30: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid@Braintree_Dev @SeraAndroid

6 Billion 15 Billion

200 Billion

0

50

100

150

200

250

2006 2015 2020

The Explosion of IoT devices

Page 31: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>The Age of Rapid Prototyping

Page 32: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>The Movement of Open Source

Page 33: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>A new Full Stack Developer

Page 34: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>Evaluation of available hardware

Page 35: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidRaspberry Pi

Page 36: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidArduino Yún

Page 37: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidIntel Edison

Page 38: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroidThe Spark Core

Page 39: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

IoT Authentication1. Non-expiring pre-generated Access Token

2. Access Token dynamically requested

Page 40: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Receiving an OAuth Access Token

POSThttps://api.spark.io/oauth/token

PARAMS{

"grant_type": "password"

"username": { Your Email Address }

"password": { Password }

}

Page 41: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Sending Data to the Core

POST

https://api.spark.io/v1/devices/{deviceid}/{route}

PARAMS

{

"access_token": {OAuth Access Token}

"args": {Payload}

}

Page 42: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Registering Functions

void setup() {

Spark.function("handler", handlePayload);

}

void loop() {

...

}

int handlePayload(String payload) {

...

}

Page 43: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Registering Functions

void setup() {

Spark.function("handler", handlePayload);

}

void loop() {

...

}

int handlePayload(String payload) {

...

}

Page 44: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Registering Functions

void setup() {

Spark.function("handler", handlePayload);

}

void loop() {

...

}

int handlePayload(String payload) {

...

}

Page 45: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Registering Functions

void setup() {

Spark.function("handler", handlePayload);

}

void loop() {

...

}

int handlePayload(String payload) {

...

}

Page 46: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Braintree's v.zero on a

POS devicedevelopers.braintreepayments.com

github.com/SeraphimSerapis/vzero-iot-node

Page 47: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid@Braintree_Dev @SeraAndroid

Frontend

JS

Backend

Node.js

Spark

Core

BraintreeSpark

Cloud

Page 48: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Page 49: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Sending transactions to the Spark

var formData = {

access_token: sparkToken,

params: amount + ',' + method

};

request.post({

url: 'https://api.spark.io/v1/devices/' + sparkDeviceID + '/pay',

form: formData }, function (err, httpResponse, body) {

if (err) {

console.log(err);

} else {

console.log(body);

}

});

Page 50: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Sending transactions to the Spark

var formData = {

access_token: sparkToken,

params: amount + ',' + method

};

request.post({

url: 'https://api.spark.io/v1/devices/' + sparkDeviceID + '/pay',

form: formData }, function (err, httpResponse, body) {

if (err) {

console.log(err);

} else {

console.log(body);

}

});

Page 51: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Sending transactions to the Spark

var formData = {

access_token: sparkToken,

params: amount + ',' + method

};

request.post({

url: 'https://api.spark.io/v1/devices/' + sparkDeviceID + '/pay',

form: formData }, function (err, httpResponse, body) {

if (err) {

console.log(err);

} else {

console.log(body);

}

});

Page 52: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Sending transactions to the Spark

var formData = {

access_token: sparkToken,

params: amount + ',' + method

};

request.post({

url: 'https://api.spark.io/v1/devices/' + sparkDeviceID + '/pay',

form: formData }, function (err, httpResponse, body) {

if (err) {

console.log(err);

} else {

console.log(body);

}

});

Page 53: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Spark Support for SSE

“A server-sent event is when a web page automatically gets

updates from a server.”

w3schools.com/Html/html5_serversentevents.asp

Page 54: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>A new Standard: FIDO Alliance

Page 55: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

>The Road Ahead

Page 56: Expanding APIs beyond the Web

@Braintree_Dev @SeraAndroid

Thanks

[email protected]

developers.braintreepayments.com

slideshare.com/PayPal