Top Banner
How to embed Messaging and Video in your apps API Evangelist @CiscoDevNet @SteveSfartz Stève Sfartz DEMOS AND CODE INTENSE
51

Embedding Messages and Video Calls in your apps

Jan 23, 2018

Download

Technology

Stève Sfartz
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Embedding Messages and Video Calls in your apps

How to embed

Messaging and Video

in your apps

API Evangelist @CiscoDevNet

@SteveSfartz

Stève Sfartz

DEMOS AND CODEINTENSE

Page 2: Embedding Messages and Video Calls in your apps
Page 3: Embedding Messages and Video Calls in your apps

/Cisco/DevNet/SteveSfartz

API Evangelist @CiscoDevNet

Cisco Spark & Tropo APIs

NodeJS mainly, a bit of #golang

France and all around Europe

hosted @PIRL – Paris Innovation Center & Research Lab

twitter://@SteveSfartz

github://ObjectIsAdvantag

“vision without execution is

hallucination”

-- Thomas Edison

[email protected]@SteveSfartz

Page 4: Embedding Messages and Video Calls in your apps

so what’s on the menu

• Tour the potential of Video Calls

• Messaging from code

• Calling from code

• Demos & tech details

Page 5: Embedding Messages and Video Calls in your apps

EN

GA

GE

ME

NT

TIME

Ad HocMeetings

FuriousChat

OccasionalMessaging

REALTIME

ScheduledMeetings

Current Workstyles Use Multiple Modes

Page 6: Embedding Messages and Video Calls in your apps

EN

GA

GE

ME

NT

TIME

Optimizing the Space between the Spaces

REALTIME

OccasionalMessaging

ScheduledMeetings

Ad HocMeetings

FuriousChat

How do I escalate from chat to a live meeting without killing our momentum?

We’re on a roll in this meeting, if only I had a little more time to finish my thoughts.

I need a few more answers before I can assign the action items

Where did that list of important reference articles end up?

Page 7: Embedding Messages and Video Calls in your apps

EN

GA

GE

ME

NT

TIME

Continuous Collaboration

REALTIME

OccasionalMessaging

Ad HocMeetings

FuriousChat

ScheduledMeetings

Page 8: Embedding Messages and Video Calls in your apps
Page 9: Embedding Messages and Video Calls in your apps

Secure, scalable, continuous collaboration

Cisco Spark Platform

Apps and Endpoints

On Premise Services Cloud Based Services

Single Experience Across Devices & Applications

Apps and Endpoints

Page 10: Embedding Messages and Video Calls in your apps

Every Pocket , Desk, Room

Page 11: Embedding Messages and Video Calls in your apps

Demo Cisco Spark Clients DX80

Page 12: Embedding Messages and Video Calls in your apps

?! Now what if your app could getthese Messages, Audio/Video

super powers ?!

Page 13: Embedding Messages and Video Calls in your apps

Cisco Spark ‘Free’ plan

Web, Desktop, Mobile clients

Illimited messaging & spaces

Up to 3 participants in a Call

Developer access to Cisco Spark APIs

https://developer.ciscospark.com

Page 14: Embedding Messages and Video Calls in your apps

Cisco Spark REST API

14

GET

POST

DELETE

PUT

/Rooms

/Memberships

/Messages

/Webhooks

/People

/Teams

developer.ciscospark.com/

Page 15: Embedding Messages and Video Calls in your apps

Cisco Spark for Developers

APItoken

Page 16: Embedding Messages and Video Calls in your apps

Cisco Spark for Developers

APIdeveloper

botoauth

jwt

token

Page 17: Embedding Messages and Video Calls in your apps

Demo REST API Automation, ChatOps

Page 18: Embedding Messages and Video Calls in your apps

Cisco SparkCloud Service

1. interacts in spacesvia a Cisco Spark client

Cisco Spark User

Your Bot code runningOn-premise or on a Public Coud

2. posts notifications to registered WebHooks

Publicly accessible APIs

3. posts messages as notifications fly in

Bot Architecture: Webhooks

Register events your bot is interested to listened to Messages / created

Memberships / created

As events happen in spaces, receive notifications

Page 19: Embedding Messages and Video Calls in your apps

Demo REST API Bot (on Glitch)

‘What is takes to code a bot’

Page 20: Embedding Messages and Video Calls in your apps

Cisco Spark for Developers

APIdeveloper

botoauth

jwt

token

Page 21: Embedding Messages and Video Calls in your apps

Cisco Spark for Developers

developerbot

oauthguest

token REST API

SDKs

Browsers, iOS, Android

all Sparkfeatures

Page 22: Embedding Messages and Video Calls in your apps

Demo OAuth grant flow

Page 23: Embedding Messages and Video Calls in your apps

Step 3 – App Requests Access Token

duittenb

With the received Auth Code, app.html does a HTTPS POST to sparkwith the client ID & secret to request the Access Token.

HTTPS POST send :https://api.ciscospark.com/v1/access_token

grant_type = authorization_code

redirect_uri = http://myserver.com/app.html

code = auth code…

client_id = oif8we28382u398u2938u

client_secret = hf33we28382uf8we2838Zx

http://myserver.com

Page 24: Embedding Messages and Video Calls in your apps

Step 4 – Spark Response

HTTP POST response{

"access_token" :"ZDI3MGEyYzQtNmFlN0NDNhLWFlN",

"expires_in” :1209600, //seconds

"refresh_token":"MDEyMzQ1Njc4OTAxMjM0NTY3ODkw",

"refresh_token_expires_in":7776000 //seconds

}

duittenb

Spark returns the Access Token to the Application

Some applications may store this access token in a secure way so it can be re-used when a user logs into the Application

http://myserver.com

Page 25: Embedding Messages and Video Calls in your apps

Cisco Spark for Developers

developerbot

oauthjwt

token REST API

SDKs

Browsers, iOS, Android

all Sparkfeatures

Page 26: Embedding Messages and Video Calls in your apps

Spark SDKs

Calling

• Calling

• Call Events

Specs

iOS SDK - swift

• iOS 9 and 10

Browsers SDK - WebRTC

• Chrome - current• Firefox - current

CODECS

• H264• Opus

Call &Media Controls

• Call Control

• Audio Control

• Video Control

Other Functions

• Persistent registration

• Feedback

• Push notifications

Page 27: Embedding Messages and Video Calls in your apps

Use Case: Retail

Page 28: Embedding Messages and Video Calls in your apps

https://developer.ciscospark.com/sdk-for-browsers.html

Page 29: Embedding Messages and Video Calls in your apps

https://ciscospark.github.io/spark-js-sdk/api

Page 30: Embedding Messages and Video Calls in your apps

Demo OAuth with Spark SDK

Web Dialer from FireFoxhttps://webdialer.chhab.rocks

Page 31: Embedding Messages and Video Calls in your apps
Page 32: Embedding Messages and Video Calls in your apps

Each space also has a SIP address

https://developer.ciscospark.com/endpoint-rooms-roomId-get.html

Page 33: Embedding Messages and Video Calls in your apps

Cisco Spark Client to Widget

Recents

Space

Page 34: Embedding Messages and Video Calls in your apps

Space Widget

• Audio & video 1:1 calling

• Space & 1:1 messaging

• Markdown support

• File sharing

• Message flags and ability to delete messages

• Read receipts

• Persistent chat

Page 35: Embedding Messages and Video Calls in your apps

Demo Space Widget

Page 36: Embedding Messages and Video Calls in your apps

Embedding the Space React component

Page 37: Embedding Messages and Video Calls in your apps

Cisco Spark for Developers

developerbot

oauthjwt

token REST API

SDKs

Browsers, iOS, Android

all Sparkfeatures

Page 38: Embedding Messages and Video Calls in your apps

What if my users are not on Spark ?

Cisco Spark

Anyone Everywhere- spark user- guest

- spark user, spaces, devices

- SIP addresses

Page 39: Embedding Messages and Video Calls in your apps

Guest mode

• Create a Developer Guest organisation

• Get issued a OrgId & Secret

• Dynamically register users

• Get JWT tokens for these users

• Access Cisco Spark APIs & SDKs

Page 40: Embedding Messages and Video Calls in your apps

Gest mode deep dive

Page 41: Embedding Messages and Video Calls in your apps

https://jwt.io/

Page 42: Embedding Messages and Video Calls in your apps

Create a user JWT token from code

Page 43: Embedding Messages and Video Calls in your apps

API access token from the user JWT token

POST https://api.ciscospark.com/v1/jwt/login

Authorization: <jwt-user-token>

{

"token": "eyJhbGci.eyNlX3R5cGU.I4zgVxATOH9Y"

"expiresIn": 21599

}

Page 44: Embedding Messages and Video Calls in your apps

Demo Guest mode

Page 45: Embedding Messages and Video Calls in your apps

Secure, scalable, extensible Conversations

• Desktop, Mobile, Web clients

• APIs & SDKs to extend the platform• API tokens, Oauth, JWT

• Key Management Server for end to end security

• WebRTC, Voice over IP• SIP addresses

Page 46: Embedding Messages and Video Calls in your apps

Cisco Spark Resources

developer.ciscospark.com

awesome-ciscospark

DevNet learning labs

https://learninglabs.cisco.com/tracks/collab-cloud

Page 47: Embedding Messages and Video Calls in your apps

Get empowered at

Learnings labs

Fog computing

Sandboxes

ready to use Kubernetes cluster

for DevNet members

Page 48: Embedding Messages and Video Calls in your apps

Other talks at CodeMotion

today 14:10: Embedding Cisco Spark and Location applications (ESRI) into business processes

saturday 12:30: Microservices and containers networking: Contiv, deep dive and demo

Page 49: Embedding Messages and Video Calls in your apps

Thank you

Page 50: Embedding Messages and Video Calls in your apps
Page 51: Embedding Messages and Video Calls in your apps