Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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