I think I understand you want to call an external API (URL) and get the json data back.
var got = require('got');
exports.handler = function(context, event, callback) {
let twiml = new Twilio.twiml.MessagingResponse();
got(url, {json: true})
.then(function(response) {
console.log(response.body)
twiml.message(JSON.stringify(response.body))
callback(null, twiml);
})
.catch(function(error) {
callback(error)
})
};