Influence Craft

Developer Documentation

Blog Integration Guide

Connect your website to Influence Craft and receive auto-published blog content directly to your CMS or custom endpoint. Influence Craft generates and pushes content to you — all you need is an endpoint to receive it.

Overview

Influence Craft creates blog content for your team through its content strategy engine. When a post is ready, Influence Craft sends it directly to your blog via an HTTP endpoint you provide. Your website receives the content and publishes it — no manual copy-paste needed.

Direction of data flow:

Influence Craft Your Website

Content is generated and pushed by Influence Craft. Your endpoint receives and stores it.

How It Works

1

Your team configures a blog campaign in Influence Craft

Set topics, frequency, and content strategy from the Teams dashboard.

2

Connect your blog endpoint

In Settings → Destinations, add your endpoint URL and an API key for authentication.

3

Influence Craft generates and pushes content

On your configured schedule, Influence Craft creates blog posts and sends them to your endpoint via HTTP POST.

4

Your endpoint receives and publishes the post

Store the content, create the page, and return a success response with the published URL.

Setup in Influence Craft

To connect your blog, a team admin navigates to Settings → Destinations and adds a new Direct Publish connection with:

  • Endpoint URL — The full URL of your receiving endpoint (e.g., https://yourdomain.com/api/blog/receive)
  • API Key — A secret key you generate on your side. Influence Craft sends this in the Authorization header so your endpoint can verify requests are legitimate.
  • Site URL — Your blog's public URL (e.g., https://yourdomain.com/blog)

Authentication

Every request from Influence Craft includes a Bearer token in the Authorization header. This is the API key you provided when setting up the connection. Your endpoint should validate this token before accepting the request.

Header sent by Influence Craft
Authorization: Bearer your_secret_api_key
Content-Type: application/json

Important: Always validate the Bearer token on your endpoint. Reject requests with missing or invalid tokens to prevent unauthorized content injection.

Incoming Request

When Influence Craft publishes a blog post, it sends an HTTP request to your endpoint:

POSThttps://yourdomain.com/your-endpoint

Content-Type: application/json

Request Body

The JSON payload Influence Craft sends to your endpoint contains these fields:

titlestringrequired

The blog post title.

contentstringrequired

The full post content in Markdown format.

excerptstringrequired

A short summary of the post, suitable for meta descriptions or listing pages.

slugstringrequired

A URL-safe identifier for the post (e.g., guide-to-content-strategy).

categorystringrequired

The post category.

tagsstring[]required

Array of tags for the post.

coverImagestring | nullrequired

URL to a featured/hero image, or null if none.

publishDatestringrequired

Publication date in YYYY-MM-DD format.

authorobjectrequired

Author information with name (string) and role (string) fields.

faqsobject[]required

Array of FAQ objects, each with question and answer strings. May be an empty array. See FAQ Schema below.

publishedbooleanrequired

Whether the post should be published immediately (true) or saved as a draft (false).

Example payload
{
  "title": "The Complete Guide to Multi-Platform Publishing",
  "content": "# Multi-Platform Publishing\n\nIn today's digital landscape...",
  "excerpt": "Learn how to publish content across multiple platforms efficiently.",
  "slug": "guide-multi-platform-publishing",
  "category": "Content Strategy",
  "tags": ["publishing", "content", "strategy"],
  "coverImage": "https://images.unsplash.com/photo-example",
  "publishDate": "2026-03-01",
  "author": {
    "name": "Jane Smith",
    "role": "Content Director"
  },
  "faqs": [
    {
      "question": "What platforms are supported?",
      "answer": "Influence Craft supports LinkedIn, X, Instagram, and 7 more platforms."
    }
  ],
  "published": true
}

Expected Response

Your endpoint must return a JSON response so Influence Craft knows whether the publish succeeded.

200Success

Return this when the post was successfully received and created.

Your response
{
  "success": true,
  "slug": "guide-multi-platform-publishing",
  "url": "https://yourdomain.com/blog/guide-multi-platform-publishing"
}
successbooleanrequired

Must be true to indicate the post was created.

slugstringrequired

The slug used for the published post (may differ from the one sent if your system adjusted it).

urlstringrequired

The full public URL where the post can be viewed.

4xx / 5xxError

Return an error status code with a JSON body if something goes wrong. Influence Craft will log the error and surface it in the campaign dashboard.

Your error response
{
  "success": false,
  "slug": "",
  "url": "",
  "error": "Duplicate slug already exists"
}

Endpoint Examples

Here are example implementations of a receiving endpoint in common languages. These show the minimum logic needed to accept content from Influence Craft.

Node.js (Express)

server.js
const express = require("express");
const app = express();
app.use(express.json());

const API_KEY = process.env.BLOG_API_KEY;

app.post("/api/blog/receive", (req, res) => {
  // 1. Validate the API key
  const authHeader = req.headers.authorization;
  if (!authHeader || authHeader !== `Bearer ${API_KEY}`) {
    return res.status(401).json({
      success: false, slug: "", url: "",
      error: "Unauthorized"
    });
  }

  // 2. Extract the post data
  const { title, content, slug, excerpt, category,
          tags, coverImage, publishDate, author, faqs, published } = req.body;

  if (!title || !content) {
    return res.status(400).json({
      success: false, slug: "", url: "",
      error: "Missing title or content"
    });
  }

  // 3. Store the post in your database / CMS
  // ... your database logic here ...

  // 4. Return success with the published URL
  const url = `https://yourdomain.com/blog/${slug}`;
  res.json({ success: true, slug, url });
});

app.listen(3000);

Python (Flask)

app.py
from flask import Flask, request, jsonify
import os

app = Flask(__name__)
API_KEY = os.environ["BLOG_API_KEY"]

@app.route("/api/blog/receive", methods=["POST"])
def receive_blog():
    # 1. Validate the API key
    auth = request.headers.get("Authorization", "")
    if auth != f"Bearer {API_KEY}":
        return jsonify(success=False, slug="", url="",
                       error="Unauthorized"), 401

    # 2. Extract the post data
    data = request.json
    title = data.get("title")
    content = data.get("content")
    slug = data.get("slug")

    if not title or not content:
        return jsonify(success=False, slug="", url="",
                       error="Missing title or content"), 400

    # 3. Store the post in your database / CMS
    # ... your database logic here ...

    # 4. Return success with the published URL
    url = f"https://yourdomain.com/blog/{slug}"
    return jsonify(success=True, slug=slug, url=url)

PHP

receive.php
<?php
header('Content-Type: application/json');

$apiKey = getenv('BLOG_API_KEY');
$authHeader = $_SERVER['HTTP_AUTHORIZATION'] ?? '';

// 1. Validate the API key
if ($authHeader !== "Bearer $apiKey") {
    http_response_code(401);
    echo json_encode([
        'success' => false, 'slug' => '', 'url' => '',
        'error' => 'Unauthorized'
    ]);
    exit;
}

// 2. Extract the post data
$data = json_decode(file_get_contents('php://input'), true);
$title = $data['title'] ?? null;
$content = $data['content'] ?? null;
$slug = $data['slug'] ?? null;

if (!$title || !$content) {
    http_response_code(400);
    echo json_encode([
        'success' => false, 'slug' => '', 'url' => '',
        'error' => 'Missing title or content'
    ]);
    exit;
}

// 3. Store the post in your database / CMS
// ... your database logic here ...

// 4. Return success with the published URL
$url = "https://yourdomain.com/blog/$slug";
echo json_encode(['success' => true, 'slug' => $slug, 'url' => $url]);

FAQ Schema

When the faqs array is not empty, we recommend generating schema.org FAQPage structured data and embedding it in your page. This helps search engines display rich FAQ results for the post.

Recommended JSON-LD to embed in the page
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What platforms are supported?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Influence Craft supports LinkedIn, X, Instagram, and more."
      }
    }
  ]
}
</script>

Testing

Before going live, you can test your endpoint by sending a sample request with cURL:

Test your endpoint
curl -X POST https://yourdomain.com/api/blog/receive \
  -H "Authorization: Bearer your_secret_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Test Post from Influence Craft",
    "content": "# Hello\n\nThis is a test post.",
    "excerpt": "A test post to verify the integration.",
    "slug": "test-post-ic",
    "category": "Test",
    "tags": ["test"],
    "coverImage": null,
    "publishDate": "2026-01-01",
    "author": { "name": "Test Author", "role": "Engineer" },
    "faqs": [],
    "published": false
  }'

Use "published": false during testing so the post is created as a draft.

Once your endpoint is working: Connect it in your Influence Craft team settings under Settings → Destinations → Direct Publish. Influence Craft will begin sending content on your campaign schedule.

Need help setting up?

Reach out to our team and we'll help you get your blog integration connected.

Contact help@influencecraft.com