Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2016.06.27 Cisco Spark / Tropo API

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

2016.06.27 Cisco Spark / Tropo API

Avatar for solutionpartner-japan

solutionpartner-japan

June 29, 2016
Tweet

More Decks by solutionpartner-japan

Other Decks in Technology

Transcript

  1. The New Collaboration Landscape
 Powered by APIs that are simple,

    open, and pay as you go 3 Embed a 
 collaboration service 
 into your offering Accelerate 
 time to market Generate better business outcomes Improve employee satisfaction Access your 
 favorite tools 
 wherever you work Build customized 
 solutions 
 for verticals - - Integrate with 
 your existing 
 IT management tools Results
  2. 4

  3. 5 List items GET /items Create an item POST /items

    Get an item GET /items/{id} Update an item PUT /items/{id} Delete an item DELETE /items/{id}
  4. 10

  5. 11

  6. 13 ask “Thanks for calling. For sales say sales or

    press 1. For support say support or press 2.”, { :choices => “1 (sales, 1) , 2 (support, 2)”, :onChoice => { if result.value == 1 then say “Your money is important to us” elsif result.value == 2 say “Your call will be ignored in the order it was received.” end } }
  7. 14 ✓ Globally available ✓ Global Outgoing Calls & Messages

    ✓ Numbers in 42 countries ✓ 80 speech languages
  8. Cisco Spark Platform APIs Make it easy for users to

    integrate Cisco Spark 
 with the apps they love and give developers tools 
 to transform collaboration experiences. Teams unify workstreams 
 in a click Native 
 Integrations Power-users 
 create their own apps 
 in minutes App Integration 
 Services Developers accelerate the value of Spark in their environments Platform APIs / SDKs Cisco Spark Platform APIs
  9. The Solution Cisco Cloud Collaboration Platforms 19 Complete collaboration solution

    Modular building blocks Integrate, extend, and customize Spark experiences Cisco Spark Platform Embed voice and SMS services to enhance business processes Tropo Platform Cisco Spark for Developers was built by Spark and Tropo architects. Those of you already familiar with Tropo will recognize the world-class ease of use, docs and 24/7 support on Cisco Spark for Developers.
  10. 20

  11. 21

  12. Inbound Capabilities: 
 User Calls or Texts App 24 •

    Surveys / Voting • Voice Search • Seasonal Spikes • Audio Conferencing • Information Lookup • Basic Auto Attendent
  13. Outbound Capabilities: 
 App Calls or Texts User 25 •

    Voice Broadcast • Conditional Alerts • Click-to-Call • Appointment Reminders • Two Factor Authentication • Confirmation SMS
  14. 31 Customer Loyalty In store IVR Notifications Satisfaction Surveys “Press

    1 if you were satisfied Status of gift cards, extra coupons, promotions Confirmation receipts of delivery, order pickups In store Paging and Notification - “Press for help in electronics” Branch site flexibility Appointment Reminders Use Cases Retail Click to Call for Web Leads (auto conference) Delivery/Operations In store Delivery optimization
  15. 32 Hospital, Pharmacy Home Healthcare Operations Patient appointment Reminders Prescription

    Re-fill and pickup reminders Medical lab results outbound IVR Time of Day Dietary and Exercise Reminders Daily check-ins “today’s pain level =“, Mental illness check-in Nurse site visit verifications Use Cases Billing record verifications and payments Health Care + Masked Number Medical Consult
  16. 33 Customer Loyalty Customer Interaction Workforce Optimization Theme park notifications

    Deals, promotions marketing campaigns Appointment Reminders “ Your Massage is scheduled” Reservation and Delivery confirmations “Your Table is ready” Basic Interactive Voice Response – Press 1 for concierge Use Cases Hospitality Maintenance services to validate job status Branch Site flexibility - persistent updates
  17. 34 Banking Insurance 2 Factor Authentication Appointment Reminders, Kiosk integrations

    Basic account balance IVR and self service Proactive notifications – low balance, fraud, account activity Proactive Notifications – New offers, loan rates, stocks Extreme Weather Notification Services Branch Location Flexibility for IVR Verification of identify for account access Use Cases Payment Reminders Financial Services
  18. 35 IOT Sensor Alerting Customer Loyalty Escalation of thresholds to

    sms/voice Plant status Emergency notifications « plant down, line halt » Smart Grid power consumption management Gas tank and gauge thresholds Use Cases Proactive outreach of utility spending, surges, planned downtime Manufacturing & Energy Notifications Payment Reminders Remote device status alerts (inbound or outbound)
  19. 36 911 Alerting Notifications Reminders City appointment reminders / take

    a ticket Intruder and emergency alerts via Text and Calling to Mobile Extreme Weather notifications Use Cases City – Roadwork, closures, emergencies Education, Government Location tracking and alerts for student locations Transportation – City Bus Systems Parent/student information - grades, tardy Schedule changes school closed, late start days
  20. Why Tropo? 37 Cloud Modular Services (Calling, Texting, Branch etc.)

    Embeddable Web Developer Friendly APIs Easily and rapidly scalable Zero upfront costs and usage based fees Tropo handles all telco provisioning Pre-integrated speech technologies Tropo Premise (moving to cloud) Full Application (IVR, UC, etc.) Integratabtle Complex and/or Proprietary Fixed costs and lead-times hinder scalability Upfront capital expenditure Customer responsible for phone #s, trunk lines, etc. Speech is an add-on Traditional Communication Solutions
  21. 38

  22. 39 • Local Numbers • Toll Free • 25+ countries

    • SIP Addresses Numbers • Inbound • Outbound • Trunking included Voice • Inbound • Outbound • Two-way Texting
  23. 40 • Transfer • Conference • Headers Call Control •

    Speech Recognition • Text to Speech • Audio playback • Recording Rich Media • Redundant data centers • Auto-scaling • Usage- based Cloud
  24. Account Types 41 • Free for testing • Low-volume •

    Restricted use • No production usage Developer • Pre-paid • Credit Card • Self-service signup • Shared Cloud • one minute billing increments Production • Post-paid invoices • Contract • SLA • Account Manager • Shorter billing increments • Training Enterprise
  25. Spark APIs execute as the user they are running as,

    using their license grants and permissions.
  26. Personal Access Token Invoke Spark API’s as yourself Spark needs

    to identify you when you are making your API calls Every Spark user has an Authorization header Where can you find it? Logon to developer.ciscospark.com, and click on your avatar, it’s right there! 45
  27. 53 /People /Rooms /Membership /Messages /Webhooks GET - List People

    GET - List Rooms GET - List Membership GET - List Messages GET - List Webhooks GET - Get Person Details POST - Create a Room POST - Create a Membership POST - Create a Message POST - Create a Webhook GET - Get My Details GET - Get Room Details GET - Get Membership Details GET - Get Message Details GET - Get Webhook Details PUT - Update a Room PUT - Update a Membership PUT - Update a Webhook DELETE - Delete a Room DELETE - Delete a Membership DELETE - Delete a Message DELETE - Delete a Webhook
  28. Apps and OAuth 54 Have your app invoke Spark API’s

    on behalf of someone else A personal access token will make calls on your behalf, but a lot of the time you will need your app to post on behalf of others. Applications are how you can securely request permissions to invoke Spark API’s on behalf of other users To do this in a secure way, Spark supports OAuth2. To achieve this: 1.Register an app with Spark 2.Request permission using OAuth grant flow 3.Exchange the resulting Authorization code for an Access Token 4.Use this Access Token to make your API calls
  29. Register Your App with Spark 55 Register your app, include:

    •App Name •Description •Contact Email •Icon URL •Redirect URL •Scopes •Keywords
  30. oAuth Flow 56 ‘Authorize URL’ ‘Accept’ ‘Base64 code’ ‘Access-Token Request’

    ‘Access-Token’ ‘Subsequent Spark Calls’ w/ Access Token and “refresh” token’ Each request shown in full on next slide Access-token is valid for 14 days. Refresh token is valid for 90 days
  31. Request Parameters 57 Access-Token Request: https://api.ciscospark.com/v1/access_token •Grant-type •Client_id •Client_Secret •Code

    •Redirect-url Authorize URL: https://api.ciscospark.com/v1/authorize •Respose_type •Client_id •Redirect_uri •Scope •State Base64 code returned upon successful request: http://your-server.com/auth?code=<Some-base64-code>
  32. /people/me GET 58 // Check if user is valid jQuery.ajax({

    url: "https://api.ciscospark.com/v1/people? email="+userEmail, type: "GET", headers: { "Authorization": "Bearer <YOUR-TOKEN>", "Content-Type": "application/json", } })
  33. /Membership POST 59 // Add user to main topic discussion

    room, based on the area that they clicked on. jQuery.ajax({ url: "https://api.ciscospark.com/v1/memberships", type: "POST", headers: { "Authorization": "Bearer <YOUR-TOKEN>", "Content-Type": "application/json", }, contentType: "application/json", data: JSON.stringify({ "personEmail": userEmail, "roomId": areaRoom }) })
  34. /Membership POST 60 // Post message and content to room

    jQuery.ajax({ url: "https://api.ciscospark.com/v1/messages", type: "POST", headers: { "Authorization": "Bearer <YOUR-TOKEN>", "Content-Type": "application/json”, }, contentType: "application/json", data: JSON.stringify({ “text": “https://youtu.be/YA7yG-LIYxU", "roomId": newRoomId }) })
  35. 63 PHP <?php
 answer();
 say("Hello World");
 hangup();
 ?> Javascript answer();


    say("Hello World");
 hangup(); Ruby answer
 say "Hello World"
 hangup Python answer()
 say("Hello World")
 hangup() Groovy answer()
 say("Hello World")
 hangup() JSON {"tropo":[{
 "say": "Hello World"
 }]}
  36. 69

  37. 70

  38. 71

  39. 73

  40. 74

  41. 75

  42. 76

  43. 78

  44. Try It! 81 • Replace “hello world” with the URL

    to an audio file • What happens if you use both “hello world AND an audio file?
  45. Asking Questions 82 var result = ask("What's your favorite color?

    Choose from red, blue or green.", {
 choices:"red, blue, green"
 });
 say("You said " + result.value);
 log("They said " + result.value);
  46. Languages 84 say("hola.", { voice:'Juan' } ); ask("color favorito", {

    choices:'rojo,azul', voice:'Juan', recognizer:'es-us' } );
  47. Try It! 85 say("hola.", { voice:'Paulina' } ); ask("color favorito",

    { choices:'rojo,azul', voice:'Paulina', recognizer:'es-us' } );
  48. 90 call('+' + numberToDial);
 say("Hey, "+ customerName +": "+ msg);

    POST /1.0/sessions {
 "token": "abcdef123456",
 "customerName": "Troposaurus",
 "numberToDial": "14075551212",
 "msg": "the sky is falling."
 }

  49. 91 call('+' + numberToDial);
 say("Hey, "+ customerName +": "+ msg);

    POST /1.0/sessions {
 "token": "abcdef123456",
 "customerName": "Troposaurus",
 "numberToDial": "14075551212",
 "msg": "the sky is falling."
 }

  50. 92 call('+' + numberToDial);
 say("Hey, "+ customerName +": "+ msg);

    POST /1.0/sessions {
 "token": "abcdef123456",
 "customerName": "Troposaurus",
 "numberToDial": "14075551212",
 "msg": "the sky is falling."
 }

  51. 97 call('+14155550100', {
 timeout:120,
 onAnswer: function() {
 say("Tag, you are

    it!");
 log("Obnoxious call complete");
 },
 onTimeout: function() {
 log("Call timed out");
 },
 onCallFailure: function() {
 log("Call could not be completed as dialed");
 }
 });
  52. 101 conference("Four score and seven", {
 terminator: "*",
 playTones: true,


    onChoice: function(event) {
 say("Disconnecting");
 }
 });
  53. Try It! 104 • Call your neighbor’s number and join

    their conference. conference("1138");
  54. Message Shortcut 106 message("Here's what you asked for.", 
 {


    to: "+16505551212", 
 network: "SMS"}
 );
  55. 107 message(msg, { to: '+' + to, network:"SMS" }); POST

    /1.0/sessions {
 "token": "abcd12345",
 "to": "14075551212",
 "msg": "the sky is falling."
 }

  56. Message Shortcut 108 say("Thanks for your call. We'll text you

    the information.");
 
 message("Here's what you asked for.", 
 {
 to: currentCall.callerID, 
 network: "SMS"}
 );
 
 say("This goes to the voice call.");
  57. Integration Award 112 • Build an application using Spark or

    Tropo (or both!) that connects to a third party service to do something useful. • Create a screencast, minimum length four minutes, demonstrating your application and walking through how it was built. • Post your screencast as a public YouTube video. • First 40 published screencasts receive a Cisco SX-10. • Program ends July 31, 2016. You must turn in your screencast by 11:59 UTC on July 31 to be eligible. • You are responsible for any taxes, duties, or reporting