- Create a Cisco Spark account if you don't have one.
- NodeJS & NPM installed?
- Windows: Open a command prompt and type
node -v
andnpm -v
- Mac: Open a terminal window and type
node -v
andnpm -v
- Install NodeJS and NPM when needed:
- Windows: instructions
- Mac: instructions
- 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:
- Go to https://developer.ciscospark.com and login (top right)
- Click ‘My Apps’ (top right)
- Add an application, click the ‘+’ sign.
- Click ‘Create a Bot’ button
- Display Name: botkitlab 2017 YourUserID
example:“botkitlab 2017 duittenb”
note the spaces! - Bot Username: botkitlab2017YourUserID
example:“botkitlab2017duittenb”
note there are NO spaces. - Icon: http://placekitten.com/g/512/512
- Click add bot
- 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.
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.
- Download NGROK from https://ngrok.com/download
- Unzip it and copy ngrok to the folder you created in prepare yourself.
- Open a SECOND terminal/command-prompt and go to the same folder
- 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.