Receiving Events - Webhooks

When new messages come into any of your channels or you want to be notified immediately we have any updates on your conversations, we trigger events that your application can listen to. We do this using webhooks.

A webhook is a URL on your server where we send payloads for such events.

You can specify your webhook URL on your Settings page or on individual channels where we would send POST requests to whenever an event occurs.

Kindly ensure your webhook URL is publicly available (localhost URLs cannot receive events).

Receiving Events

To receive the event, you will have to create an unauthenticated POST route on your application that returns a 200 status code as it's response.

// Using Express
app.post("/my/webhook/url", function(req, res) {
    // Retrieve the request's body
    var event = req.body;
    // Do something with event
    res.send(200);
});

Supported Events

{
    "event": "compaignDeliveryReport",
    "message": "campaign completed. https://api.oneroute.io/api/public/logs?page[size]=10&page[number]=1&campaign_id=campaign_id",
    "conversation": {
        "id": "id",
        "firm_id": "firm id"
    }
}

Last updated