Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 2.93 KB

2.md

File metadata and controls

68 lines (49 loc) · 2.93 KB

Prepare yourself

  1. Create a Cisco Spark account if you don't have one.
  2. NodeJS & NPM installed?
  • Windows: Open a command prompt and type node -v and npm -v
  • Mac: Open a terminal window and type node -v and npm -v
  1. Install NodeJS and NPM when needed:
  1. Install BotKit:
  • Open terminal or command prompt
  • Create folder for your lab and type cd <your-folder-name>
  • Install BotKit: npm install --save botkit. At some point you will see something like this:       




Create a Cisco Spark Bot

  1. Go to https://developer.ciscospark.com and login (top right)
  2. Click ‘My Apps’ (top right)
  3. Add an application, click the ‘+’ sign.
  4. Click ‘Create a Bot’ button
  5. Display Name: botkitlab 2017 YourUserID
    example: “botkitlab 2017 duittenb” note the spaces!
  6. Bot Username: botkitlab2017YourUserID
    example: “botkitlab2017duittenb” note there are NO spaces.
  7. Icon: http://placekitten.com/g/512/512
  8. Click add bot
  9. Check out the access token that is generated. You have to copy/paste this somewhere as you won’t see it again. You can only regenerate it.

      

GOAL: You now have a bot account with a “@sparkbot.io” email address that you can invite to a room OR have a 1:1 conversation. The token is used by the Botscript to create a webhook and reply to your messages.





Setup NGROK Tunnel

Your laptop is not accessible from the internet. In order to run this lab you can use NGROK to setup a tunnel between Ngrok and your laptop. Figure

  1. Download NGROK from https://ngrok.com/download
  2. Unzip it and copy ngrok to the folder you created in prepare yourself.
  3. Open a SECOND terminal/command-prompt and go to the same folder
  4. Create an NGROK tunnel by typing: ngrok http 3000 (on a mac you sometimes have to prefix dot-slash: ./ngrok http 3000)

   

This creates a tunnel from the UNIQUE NGROK URL to your laptop on Port 3000. Our NodeJS Bot script will run on port ...... yes, 3000 !

You will need this Unique URL in the next steps.

NOTE: when the ngrok application stops, your unique URL is gone.