I am invoking API.AI API call in Firebase Cloud function to process a message in response to Firebase childAdded event. However, I am getting the following error message. The API.AI call works fine in a standalone nodeJS app that I ported from.
Error: socket hang up
at createHangUpError (_http_client.js:254:15)
at TLSSocket.socketOnEnd (_http_client.js:346:23)
at emitNone (events.js:91:20)
at TLSSocket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
Any ideas on what could be going wrong here. I am on Firebase Spark plan.
Thanks in advance