I'm able to get the webhook response in dialogflow cx. but I need to return my custom event name as webhook response. I used below code to trigger custom event inside the fulfillment it was not worked for me. any idea for better solution.
exports.cxWhatsappAgent = (req, res) => {
return axios
.get(
`$apiURL`,
{ data: {} }
)
.then(
(result) => {
if (result.data.length > 0) {
var responseText = "Hi Welcome";
res.status(200).send({
event: "REGISTERED-USER"
});
}
},
(error) => {
console.log(error);
}
)
.catch((error) => {
});
};