Skip to main content

πŸ‘·β€β™‚οΈ Custom API Integration

How to Integrate Soogle

Francisco Porto avatar
Written by Francisco Porto
Updated over a month ago

What this does

Connect Soogle 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 <SOOGLE_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 Soogle, the payload includes:

{ "test": true }

Responses Soogle 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 Soogle

  1. Go to Soogle 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

SOOGLE_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 SOOGLE_SECRET_KEY correctly

  • Copy/paste the key from Soogle (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?