Skip to content

Instantly share code, notes, and snippets.

@spalladino
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save spalladino/1de06680365bce639435 to your computer and use it in GitHub Desktop.

Select an option

Save spalladino/1de06680365bce639435 to your computer and use it in GitHub Desktop.
Small mBuilder demo firing external trigger and requesting table data
// Small mBuilder demo firing external trigger and requesting table data
var request = require('request');
var http = require('http');
// Fire external trigger
var symptom = 'headache';
var message = 'Rest well';
var projectId = 278;
var auth = 'Basic ' + new Buffer(process.env.INSTEDD_USER + ':' + process.env.INSTEDD_PASS).toString('base64');
var url ='http://mbuilder.instedd.org/external/application/'+ projectId +'/trigger/Broadcast?symptom='+ symptom +'&message=' + message;
request.post(url, {
headers: {
'Authorization': auth
}
}, function(err, response, body) {
console.log(body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment