Skip to main content

👷‍♂️ Custom API Integration

How to Integrate Rankaria Blog Automation

Written by Francisco Porto

What this does

Connect Rankaria to your website/CMS by creating one webhook endpoint that receives AI-generated articles and publishes them automatically.


Requirements

Your endpoint must:

  • Method: POST

  • Content-Type: application/json

  • Auth: Bearer token via Authorization header

    • Example: Authorization: Bearer <RANKARIA_SECRET_KEY>

  • Return: HTTP 200–299 on success

Recommended endpoint path:

/api/webhook/blog/publish

{
"title": "Article Title",
"content": "<p>Full HTML content of the article...</p>",
"excerpt": "Short description or excerpt",
"featuredImage": "https://cdn.example.com/image.jpg",
"category": "Technology",
"tags": ["AI", "Automation", "SEO"],
"author": { "name": "John Doe", "email": "[email protected]" },
"publishedAt": "2024-01-15T10:30:00Z",
"metaTitle": "SEO optimized title",
"metaDescription": "SEO optimized description",
"slug": "article-url-slug",
"test": false
}

Test webhooks

When you click “Test” in Rankaria, the payload includes:

{ "test": true }

Responses Rankaria expects

✅ Success (HTTP 200–299)

{
"success": true,
"message": "Article published successfully",
"id": "123",
"url": "https://your-site.com/blog/article-url-slug"
}

❌ Error (HTTP 400–499)

{
"success": false,
"message": "Error description"
}

Important: For success, both must indicate success:

  1. HTTP status code 200–299

  2. Response body (if present) should also reflect success


Configure inside Rankaria

  1. Go to Rankaria Dashboard → Integrations → Custom API

  2. Add your Webhook URL

  3. Click Generate to create your Secret Key

  4. Save it as an environment variable on your server

  5. Click Test → then Save & Activate


Environment variable

RANKARIA_SECRET_KEY=whsec_YOUR_SECRET_KEY

Quick test with curl

curl -X POST https://your-site.com/api/webhook/blog/publish \
-H "Authorization: Bearer whsec_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"test": true,
"title": "Test Article",
"content": "<p>Test content</p>",
"excerpt": "Test excerpt"
}'


Common issues

Invalid authentication token

  • Ensure the header is exactly Authorization: Bearer <token>

  • Confirm your server loaded RANKARIA_SECRET_KEY correctly

  • Copy/paste the key from Rankaria (no extra spaces)

Connection timeout

  • Endpoint must be publicly reachable

  • Use HTTPS in production

  • If testing locally, expose with a tunnel (ngrok, etc.)

Test works but real articles fail

  • Your CMS/database publish logic is failing

  • Ensure you handle required fields like title + content

  • Check server logs for the exact error

Did this answer your question?