Webhooks: publish to any site
After this article, your site will receive articles from Florank through your own endpoint and verify that each request really comes from Florank.
Updated November 8, 20262 min read
Who this method is for
A webhook suits sites built on custom code (Next.js, Laravel, any backend) that do not use WordPress or Shopify. You need a developer: the endpoint on your side receives the article and saves it in your CMS or database.
Prepare the endpoint
Your URL must accept POST with JSON and respond with a 2xx code. Any other response or a 20-second timeout counts as a publishing error. After an error, Florank retries delivery automatically: up to 5 attempts in total, with increasing pauses. If all attempts fail, the account owner gets an email about the failed publication.
Florank sends three events in the event field:
| Event | When |
|---|---|
connection.test | "Test connection" or "Connect" was clicked |
article.published | An article is published |
article.updated | A changed article is published again |
Fields of the article object: id, title, slug, content_html, content_markdown, meta_title, meta_description, featured_image_url, featured_image_alt, excerpt, as_draft, published_at, language, tags, categories, word_count, schema_json_ld, indexnow_key, author (name, job_title, bio, profile_url, avatar_url, same_as).
The as_draft field is true if "Publish immediately (not as draft)" is not turned on in the connection.
Verify the signature
Every request has the X-FloRank-Signature and X-FloRank-Delivery-Id headers. The signature is sha256= plus an HMAC-SHA256 of the raw request body, with your secret as the key.
// app/api/florank/route.ts (Next.js)
import { createHmac, timingSafeEqual } from "node:crypto";
export async function POST(req: Request) {
const raw = await req.text();
const expected = "sha256=" + createHmac("sha256", process.env.FLORANK_WEBHOOK_SECRET!).update(raw).digest("hex");
const got = req.headers.get("x-florank-signature") ?? "";
if (got.length !== expected.length || !timingSafeEqual(Buffer.from(got), Buffer.from(expected))) {
return new Response("bad signature", { status: 401 });
}
const body = JSON.parse(raw);
if (body.event === "connection.test") return Response.json({ ok: true });
// save body.article in your CMS
return Response.json({ url: `https://example.com/blog/${body.article.slug}` });
}Connect the webhook in Florank
Open the form
"Content" → "Integrations" → Webhooks.
Fill in the fields
"Webhook URL" and, if you like, "Secret (optional)" and "Article URL template". If you leave the secret empty, Florank generates one for you.
Connect
click "Test connection", then "Connect".
Save the secret
Florank shows the "Save your webhook secret" window with your secret. Click "Copy" and put it in your site's environment variables if you have not done so yet.
Published article URL
Florank determines the article's URL on your site in this order:
Endpoint response
the
url,link,permalink,post_url, orexternal_urlfield in the JSON response (also insidedata,post, orarticle).Article URL template
for example,
https://example.com/blog/{slug}. The template must contain{slug}.Common URLs
if neither is available, Florank checks common patterns such as
/blog/{slug}and takes the first URL that opens.
Was this article helpful?