Webhook Integration

Connect your website with Rank Sector using our webhook integration.

Setting Up Your Webhook

To set up a webhook integration, you will need to specify:

  • Integration Name: A friendly name for your webhook (2-50 characters), no special characters
  • Webhook URL: The URL where you want to receive article data (must be a valid HTTPS URL)
  • Secret Token: A signing token used for the authenticity of incoming webhook payloads

Implementing Webhook Secret Mechanism

For production environments, we strongly recommend implementing the webhook secret mechanism that helps to verify the authenticity and integrity of webhook payloads.

Example in Node.js
const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const hmac = crypto.createHmac('sha256', secret);
  hmac.update(payload);
  return hmac.digest('hex') === signature;
}

Publish Articles Event

When an article is published, Rank Sector sends an HTTP request to your webhook endpoint with a JSON payload.

Article Data Properties

event_typeThe type of event that occurred (always "content_publish" in this case)
titleThe title of the article
slugThe URL-friendly version of the title
statusThe publication status (draft or published)
content_htmlThe article content in HTML format
content_markdownThe article content in Markdown format
meta_titleSEO meta title for the article
meta_descriptionSEO meta description for the article
created_atThe timestamp when the article was created (ISO 8601 format)
featured_imageURL of the featured image
tagsThe URL-friendly version of the article's tags for permalinks
Example Payload
{
  "event_type": "content_publish",
  "title": "How to Boost Your SEO Rankings",
  "slug": "how-to-boost-your-seo-rankings",
  "status": "published",
  "content_html": "<h1>How to Boost...</h1>",
  "meta_title": "SEO Rankings Guide 2025",
  "meta_description": "Learn proven strategies...",
  "created_at": "2025-01-15T10:30:00Z",
  "featured_image": "https://...",
  "tags": ["seo", "marketing"]
}
Always validate webhook signatures in production to prevent spoofed payloads.

Testing Your Webhook

After you have set up your webhook configuration, you can test it by publishing an article:

  1. Click the Publish button to publish the article.
  2. Monitor your webhook endpoint for incoming HTTP requests with the article data.
  3. Check your server logs to verify the webhook was received and processed successfully.

Best Practices

  • Always verify the webhook secret token in your handler to prevent spoofed payloads.
  • Respond with a 200 OK status code to acknowledge receipt promptly to your webhook handler.
  • Implement retry logic in case of temporary failures.
  • Consider implementing a retry mechanism for failed webhook deliveries.

Troubleshooting

Webhook not receiving payloads

Ensure your webhook URL is publicly accessible and using HTTPS. Check your server logs and firewall rules.

401 Unauthorized

Verify your secret token matches exactly what you configured in the integration settings. Check for extra spaces.

Webhook endpoints must return a 200 status code within 10 seconds. Slow or non-responsive endpoints may be automatically disabled after repeated failures.

Start creating magic today with a free trial!

Get Started For Free →