Cisco Spark Webhooks using Node.js

I’ve been trying to come up with a reason to play around with node.js. I’ve also been trying to make some time to play around with the Cisco Spark API. So I figured I would merry the two of them. My intention was to setup a webhook on a channel, then in my node application display the messages being posted in my room. Pretty simple example, but it touches a few different things.

First, you need to setup your webhook to point to your server.

Second, you need to have node installed, in this case I’m using Ubuntu 16.04.

Third, write some code. Check out my comments to follow along.

//will use these for the POST request var express = require("express");
var myParser = require("body-parser");
var app = express(); //will use this for the GET request var http = require('https'); app.use(myParser.json());
app.post("/", function(request, response){ console.log(request.method); //console the webhook name as well as the name of the author of the message
console.log('Webhook:'+request.body.name);
console.log('Email:'+request.body.data.personEmail); //setup your GET request to find out the actual message posted by the author
var options = {
host: 'api.ciscospark.com',
path: '/v1/messages/'+request.body.data.id,
headers: {
  'User-Agent': 'request',
  'Authorization': 'Bearer MyAuth'
}
} //make the request
http.request(options, OnResponse).end();
}); //capture the request response function OnResponse(response){
var data = '';
response.on('data', function(chunk){
  data += chunk;
}); response.on('end', function(){
  data = JSON.parse(data); //console out the actual text
  console.log(data.text);
});
} app.listen(8080);

~david

No comments yet

On Bluesky

@dmacias.bsky.social on Bluesky

David Macias@dmacias.bsky.social

Anyone actually seen an outcome-based contract from a BPO or a CCaaS vendor? Those documents must run to encyclopedia length, no room for error on what an outcome is or how it's measured. Maybe the only ones winning this AI race are the lawyers.

1 reply · View on Bluesky

David Macias@dmacias.bsky.social

Magic Quadrant poll results: 23 votes, 15 leaned disagree, 8 agreed. The 2026 quadrant does not match the reality most of my network sees.

1 reply · View on Bluesky

David Macias@dmacias.bsky.social

New Five9 survey: 46% of customers rated their last chatbot experience positively, vs about two-thirds for a human. The top reason people bail on the bot? It repeatedly misunderstood them. Turns out the human exit isn't the failure mode, it's the feature.

1 reply · 1 like · View on Bluesky

David Macias@dmacias.bsky.social

Remember when every vendor said AI's focus was not to reduce agent count? Well how about it reducing your agent license count? Zoom CX is moving to one spend pool for seats, apps, and AI. A seat you can count. A draw-down pool is their meter, and renewals just got harder to justify.

1 reply · View on Bluesky

David Macias@dmacias.bsky.social

A VC firm read 67 SaaS earnings calls and concluded AI is great for SaaS valuations. Anyway, the underlying numbers on outcome pricing and MCP growth are worth your time if you read past the pitch.

1 reply · View on Bluesky