This is an example bot that uses RESTful API calls to monitor a conversation on circuit. The bot will log the most recent items in the conversation, post a new item once it is listening, and then log any new items posted in the conversation.
- Developer account on circuitsandbox.net. Get it for free at developer registration.
- OAuth 2.0
client_id
and optionallyclient_secret
. Get if for free at circuit.github.com/oauth.
Other examples of RESTful API's with circuit can be found here.
- Clone the respository.
- Run :
$ npm install
. - Rename
config.json.template
toconfig.json
after adding yourclient_id
,client_secret
,url
, and theport
the bot will run on. Theurl
field should refer to the return url the webhook should send data to. Once you have done so all you need to do is run$ npm start
and the bot will begin.
- Note: The bot must be a part of the conversation it is listening to.
- If you want to host this on your local machine you can use something like ngrok to host the bot. For the webhooks just add the ngrok url as the
url
field in theconfig.json
file, make sure you serve the ngrok tunnel on the same port as the bot.