PaadamപാഠംGuides

For developers

n8n

Run your own automations on Paadam's events, on your own server.

Receiving events

  1. Add a Webhook node: method POST, and under Options turn on Raw Body so the signature can be checked.
  2. Copy its production URL into Paadam's Settings → Developers → New webhook, and pick the events.
  3. Add a Code node to check the signature (keep the secret in an n8n credential or environment variable):
const crypto = require("crypto");
const item = $input.first();
const ts = item.json.headers["x-paadam-timestamp"];
const raw = Buffer.from(item.binary.data.data, "base64").toString("utf8");
const want = crypto.createHmac("sha256", $env.PAADAM_WEBHOOK_SECRET).update(ts + "." + raw).digest("hex");
if (want !== item.json.headers["x-paadam-signature"] || Math.abs(Date.now() / 1000 - Number(ts)) > 300) {
  throw new Error("Not from Paadam");
}
return [{ json: JSON.parse(raw) }];
  1. Use a Switch node on event to handle each kind differently, and Send a test from Paadam to try it.

Calling the API

Add an HTTP Request node with Authentication Generic credential → Header Auth: name Authorization, value Bearer pdk_…. Point it at https://learn.yourschool.in/api/v1/…; the API reference lists every endpoint.

Ideas

  • A new enquiry (lead.created): add it to your CRM and give it to whoever's on call.
  • A payment (payment.paid): put it in your accounts spreadsheet.
  • A form sent (form.submitted): copy the answers to Google Sheets.
  • A learner who missed three classes: read attendance from the API every evening and message the parent.