Twilio developer evangelist here.
Your Function is called by Twilio when you receive an SMS, so the response of the Function is going back to Twilio to tell it what to do. You do so by returning TwiML. This means that if you return TwiML like this, you will get a message sent back from the Twilio number:
const twiml = new Twilio.twiml.MessagingResponse();
twiml.message("Hello from your function");
callback(null, twiml);
In your code, you are returning the result of your API call to Hologram straight to Twilio. Since that result is JSON instead of TwiML, Twilio doesn't know what to do with it and you get an error.
If you don't want to respond to the incoming text message, you can return empty TwiML, like this:
instance.post('/api/1/sms/incoming', {
// hologram data
})
.then((response) => {
const twiml = new Twilio.twiml.MessagingResponse();
callback(null, twiml);
});
Let me know if this helps.