node.jsgupshup

Gupshup whatsApp api sends 'ok' message on returning 200 after receiving webhook


I am using nodejs for backend. I am able to receive webhooks from Gupshup api. After receiving webhook, I am responding with status 200.

res.sendStatus(200);

Gupshup whatsApp api sends 'ok' message to user on returning 200 after receiving webhook automatically.

enter image description here

Here ok is not message by outbound api. Rather its automatically responded by Gupshup api.


Solution

  • Instead of,

    res.sendStatus(200) // equivalent to res.status(200).send('OK')
    

    You should send a nil response.

     res.end()
    

    The OK is forwarded by gupshup to the user as a message