No API? Build a Webhook Bridge to Your Messenger

A support lead at a small SaaS once told me their tool for tracking shipments had no API and no webhooks — just a web page listing every order and its status. For two years someone opened that page every morning and copy-pasted the overdue rows into Slack. The whole "integration" was a human. The day we replaced it with a bridge, the person got their mornings back, and overdue orders started landing in the messenger within minutes instead of the next working day.

That is the result you are building toward: an event from a service that officially has no API arrives in your messenger on its own, once, with the fields you care about, and you can see it works without opening a dashboard. In this walkthrough you get the three-layer model, the build steps with an owner for each, the access you actually need, the two or three places it will break, and how to check it by hand before you trust it.

The myth worth killing first: "no API means no integration." In practice almost every service emits data somewhere — a webhook, a public page, a confirmation email — and a bridge is just three layers: receive the event, normalize it into one schema, deliver it to the messenger.

The case: overdue shipments from a service with nothing but HTML

Here is the concrete situation I'll walk through. A logistics tool shows a public tracking page per order (/track/ORDER-12345) with a status line, an ETA date, and a carrier name. There is no webhook, no API key, no export. The team wants: whenever an order goes overdue, a message in the messenger channel with the order number, the carrier, and how many days late it is. More on the topic: “Build a Messenger Bot That Answers and Logs Leads in CRM”.

That single case gives you every piece of the general model. The event source is a public page. The trigger is "status changed to overdue." The normalization is "pull order number, carrier, ETA, compute days late." The delivery is "post one message to the messenger." More on the topic: “Voice Message to CRM Lead: Build an Intake Pipeline”.

The three layers are the whole product Receive (webhook, page poll, or email), normalize (map to one schema), deliver (messenger). Every no-API integration you build later is a variation on these three, not a new architecture.

What you end up with, and how you see it working

At the end you have a small service with three parts: a receiver that accepts events, a normalizer that turns them into a fixed shape, and a sender that posts to your messenger. You also have a dead-letter log — a file or table where failed events go instead of vanishing.

You'll know it works when three things happen without you touching anything:

  • A new overdue order appears in the messenger once, not twice, not five times.
  • A deliberately broken page (one field removed) does not post garbage — it lands in the dead-letter log with the raw HTML saved.
  • Restarting the service mid-run does not re-post yesterday's messages.
Every no-API bridge is the same three layers
1
Receive
webhook, page poll or email
2
Normalize
map to one schema, set the event key
3
Deliver
post once to the messenger, retry on failure

If you'd rather not build the receiver, the scheduler, the idempotency store and the retries yourself, this is exactly the kind of project asibiont.com takes on turnkey: you describe the source and the destination, the developer names the price, you top up the balance and get a working bridge. More on that at the end.

The build, step by step, with an owner for each

I'll keep the stack boring on purpose: Node.js 20+, express for the receiver, node-cron for polling, better-sqlite3 for the idempotency store, and fetch (built into Node 20) for delivery. Pin versions in package.json — express@4, node-cron@3, better-sqlite3@11 — because the code below relies on their current APIs.

Step 1 — Decide the event contract before any code

Human does this. Write down, in one line, what a message must contain: order_id, carrier, days_late, source_url, event_key. The event_key is the field that makes deduplication possible — it must be stable for the same real-world event. For our case a good key is order_id + ':' + status + ':' + eta, because if the ETA changes the event is genuinely new.

AI can draft the schema and suggest the key, but a human must confirm the key is stable. Get this wrong and you get duplicate messages forever.

Step 2 — Build the receiver (accepts webhooks and internal events)

The AI writes the receiver. For services that do have webhooks, this is the entry point. For our page-polling case, the receiver accepts an internal POST from the poller too, so both paths share one normalizer.

// server.js — ESM, Node 20+, express@4
import express from 'express';
import { normalize } from './normalize.js';
import { deliver } from './deliver.js';

const app = express();
app.use(express.json({ limit: '1mb' }));

app.post('/hook/:source', async (req, res) => {
  // Ack fast; the messenger should never wait on our processing.
  res.status(202).send('accepted');
  try {
    const event = normalize(req.params.source, req.body, req.headers);
    await deliver(event);
  } catch (err) {
    console.error('normalize/deliver failed', err.message);
  }
});

app.listen(3000, () => console.log('receiver on :3000'));

Human checks: does the endpoint return 202 before doing work? If it returns 200 only after the messenger call, a slow messenger will make the sender time out and retry — and you get duplicates. That single ordering choice prevents most duplicate floods.

Step 3 — Build the normalizer (one schema for every source)

The AI writes the parser. For the page case it fetches the HTML and extracts fields. Do not parse HTML with regex — use a real parser. cheerio@1 is the pragmatic choice and matches what you'd do by hand in devtools.

// normalize.js — ESM, cheerio@1
import * as cheerio from 'cheerio';

export async function normalize(source, body) {
  if (source === 'logistics-page') {
    const html = body.html; // poller passes raw HTML in
    const $ = cheerio.load(html);
    const order_id = $('[data-field="order"]').text().trim();
    const carrier = $('[data-field="carrier"]').text().trim();
    const status = $('[data-field="status"]').text().trim();
    const eta = $('[data-field="eta"]').attr('datetime');
    if (!order_id || !status) throw new Error('missing fields');
    const days_late = status === 'overdue' ? daysBetween(eta, new Date()) : 0;
    return { order_id, carrier, status, eta, days_late,
      source_url: body.url,
      event_key: `${order_id}:${status}:${eta}` };
  }
  throw new Error('unknown source: ' + source);
}

function daysBetween(from, to) {
  return Math.max(0, Math.floor((to - new Date(from)) / 86400000));
}

Human checks the markup, not the logic. Open the real page and confirm the selectors actually match. Pages change structure without warning; a selector that works today is the number-one silent failure. Prefer data-* attributes over CSS classes — classes get restyled, data-field usually survives.

Selectors are the fragile joint Ask the AI to fail loudly when a selector returns empty, never to fall back to a default. A missing field that becomes an empty string is a message you'll send and never notice.

Step 4 — Build the poller that turns a page into an event

The AI writes the cron job. It fetches each active order page, passes the HTML to the receiver's internal endpoint, and lets the normalizer do its job.

// poller.js — ESM, node-cron@3
import cron from 'node-cron';
import { getActiveOrderUrls } from './store.js';

cron.schedule('*/10 * * * *', async () => {
  for (const url of await getActiveOrderUrls()) {
    const res = await fetch(url);
    const html = await res.text();
    await fetch('http://localhost:3000/hook/logistics-page', {
      method: 'POST',
      headers: { 'content-type': 'application/json' },
      body: JSON.stringify({ url, html }),
    });
  }
});

Human decides the polling interval and the politeness budget. Every 10 minutes for a few dozen orders is fine. Polling hundreds of pages every minute will get you rate-limited or blocked. If the service publishes a robots.txt or terms of use, read them — public does not always mean "scrape freely."

Step 5 — Build the idempotency store and the deliverer

The AI writes both. The idempotency store is the difference between a demo and something you trust. Store the event_key before you send; if the key already exists, skip.

// deliver.js — ESM, better-sqlite3@11
import Database from 'better-sqlite3';
const db = new Database('events.db');
db.exec('CREATE TABLE IF NOT EXISTS sent (key TEXT PRIMARY KEY, sent_at TEXT)');

const WEBHOOK = process.env.MESSENGER_WEBHOOK;

export async function deliver(event) {
  const insert = db.prepare('INSERT OR IGNORE INTO sent (key, sent_at) VALUES (?, ?)');
  const info = insert.run(event.event_key, new Date().toISOString());
  if (info.changes === 0) return; // already sent

  const res = await fetch(WEBHOOK, {
    method: 'POST',
    headers: { 'content-type': 'application/json' },
    body: JSON.stringify({ text: format(event) }),
  });
  if (!res.ok) {
    db.prepare('DELETE FROM sent WHERE key = ?').run(event.event_key);
    throw new Error('messenger returned ' + res.status);
  }
}

function format(e) {
  return `Order ${e.order_id} (${e.carrier}) overdue by ${e.days_late}d — ${e.source_url}`;
}

Human checks the retry semantics. Here the key is deleted only if the send fails, so a retry re-sends. That is correct. If you instead delete the key on any error, a transient messenger blip will drop the message forever. Pick one behavior and write it down.

Idempotency is a human decision, not a library The code inserts-then-sends; the human decides what `event_key` is and what happens on failure. Get those two right and duplicates become rare and explainable instead of mysterious.

Access and data: what you need, and where it's impossible

For the messenger side you need a webhook URL — in most messengers you create an incoming webhook in the workspace settings and copy the URL. Treat it as a secret: anyone with the URL can post to your channel.

For the source side, access depends on what the service gives you:

Source type What you need Where it's impossible
Webhook A signing secret to verify the caller If the service signs nothing, you can't prove the event is genuine
Public page The URL and the right to fetch it Behind a login with 2FA and no session export — you'll need a browser automation tool, and that's a different risk profile
Email An inbox you control plus IMAP credentials If the service only sends to a shared mailbox you can't read, you're stuck

Say it plainly: some services give you nothing usable. A page behind SSO with no export and no email is a dead end until the vendor moves. Don't build a fragile scraper around it — check first.

Where it breaks: three risks for this project

1. The page changes and selectors silently return empty. This is the most common failure for page-based bridges. The fix is to fail loudly (throw, don't default) and to keep the raw HTML of every failed event in the dead-letter log so you can re-run it after fixing the selector. Check the log daily for the first week.

2. Duplicates from retries and overlapping polls. If a poll takes longer than the interval, two runs overlap and both see the same event. The event_key protects you — but only if the key is stable. If your key includes a timestamp or a random ID, it isn't stable and you'll get doubles. Keep the key derived from the real-world event.

3. Rate limits and blocks from the source. Polling too aggressively, or fetching pages in parallel without a delay, can get your IP throttled. Space requests out, respect robots.txt, and cache pages you've already processed. If the source is a paid service, check the terms — scraping can violate them even when it's technically possible.

Test the failure, not just the success Before you trust it, break a selector on purpose, kill the messenger endpoint for a minute, and restart the service mid-run. Each should produce a visible, recoverable state — not silence.

How to verify it by hand

You run these yourself; the AI can't confirm they pass for you.

  • Duplicate check: trigger the same order twice. Success sign: exactly one message in the messenger.
  • Broken page check: remove one data-field from a saved HTML sample and re-run. Success sign: nothing posted, one row in the dead-letter log with the raw HTML.
  • Restart check: stop the service, trigger an event, start it again. Success sign: the event is delivered once, not zero or two times.
  • Messenger-down check: point MESSENGER_WEBHOOK at a URL that returns 500. Success sign: the key is deleted and a retry re-sends once the endpoint is restored.
  • Timing check: confirm the message arrives within one poll interval of the status change. Success sign: the gap matches your cron schedule, not hours.

What it costs, honestly

Time: for one source and one destination, expect a few evenings if you're comfortable with Node, or a day or two if you're learning as you go. The bulk of the time is not the code — it's the selector archaeology and the verification runs.

Money: the code runs on any small VPS or free tier; the messenger webhook is usually free; the source is the page you already pay for. The real cost is maintenance — every page change is a selector fix. Budget for checking the dead-letter log weekly, because that's where a silent break shows up first.

If you want it off your plate, asibiont.com takes such bridges on turnkey: you describe the source and destination, the developer quotes a fixed price, and you pay by topping up your balance — no separate connector fees. See the plans here: https://asibiont.com/en/subscription-tiers

The rule that survives every service

"No API" is almost never the blocker people assume. The blocker is usually one of three decisions a human has to make: what counts as one event (the key), what happens when the messenger is down (the retry), and what happens when the page changes (the loud failure). The AI writes the parser and the handler quickly; those three decisions are yours, and they're what makes the difference between a bridge you trust and a script that quietly stops working on a Tuesday.

If you build it yourself, start with the event contract and the idempotency key — the rest is plumbing. If you hand it over, hand over those decisions along with the pages, and you'll get a bridge that behaves. Either way, the person who used to copy-paste every morning doesn't come back.

If you would rather not build it yourself: we take such a project on — you describe the task, we build it and bring it to a working result, and the developer names the price. The payment goes through a balance top-up on the payment page.

AssetMaterials for this article

A document from this article — download and apply it.

  • DOCXWebhook Bridge Normalization Spec & Pre-Trust Checklist.docxDOCX · 39.5 KBDownload
← All posts

Ask AI about this article

Ask a question about this article — ASI Biont will answer based on its text and the attached files.