Docs/CMS Integrations/Strapi Integration

Strapi Integration

CMS Integrations
6 min read

Strapi Integration

Connect your iContentForge project to a Strapi CMS (self-hosted or Strapi Cloud) to automatically publish generated articles. This guide covers the required API token permissions, base URL configuration, version selection, and content type mapping.

Prerequisites

Before you begin, ensure you have:

  • An active iContentForge project with articles in Ready status.
  • Admin access to your Strapi dashboard to create an API token.
  • Your Strapi instance must be accessible via a public URL (for iContentForge's servers to connect).
  • Know your Strapi version (v3, v4, or v5) this affects how iContentForge formats API requests.

Step 1: Identify Your Strapi Version

This step is required. The iContentForge Strapi connector sends different API request formats depending on your Strapi version. Using the wrong version setting is a common cause of publishing failures.

Strapi VersionRequest Body FormatResponse ID Field
v3Fields sent directly: { "title": "...", "content": "..." }result.id
v4Fields wrapped in data: { "data": { "title": "...", "content": "..." } }result.data.id
v5Fields sent directly (like v3): { "title": "...", "content": "..." }result.documentId

To check your version: look at your Strapi dashboard footer, or check your package.json for the @strapi/strapi dependency version.

Step 2: Generate a Strapi API Token

You need a Strapi API Token with the correct permissions to allow iContentForge to create articles.

  1. Log in to your Strapi admin panel.
  2. Navigate to Settings API Tokens (under Global Settings).
  3. Click Create new API Token.
  4. Configure the token as follows:
    • Name: e.g., iContentForge Publishing
    • Token type: Select Full-access for simplicity, or create a Custom type with the specific permissions listed below.
    • Description: (Optional) Note that this token is for automated article publishing.
鈿狅笍

If creating a Custom token type, you must grant it create (and optionally publish) permissions for the specific Content-Type you intend to publish to (e.g., api::article.article). Without the create permission, the integration will fail.

  1. Click Save. Copy the generated token immediately攜ou will not be able to see it again.

Step 3: Configure the Connector in iContentForge

  1. In your iContentForge dashboard, go to your Project.

  2. Navigate to the CMS Integrations tab.

  3. Click Add New Connector and select Strapi from the list.

  4. Fill in the connection details:

    • Connection Name: A friendly name for this connection (e.g., "Company Blog").
    • Base URL: The full URL to your Strapi instance root, without the /api path.
      • Strapi Cloud Example: https://your-project.strapiapp.com
      • Self-hosted Example: https://strapi.yourdomain.com
    • API Token: Paste the token you copied from Strapi.
    • Content Type (slug): The plural API ID of your collection type (e.g., articles, posts, blogs). Found in Strapi under Content-Type Builder > your collection > Advanced Settings > API ID (Plural).
    • Strapi Version: Select v3, v4, or v5 to match your installation. Default is v4.
鈩癸笍

How we explicitly target your blogs (Schema Isolation): Strapi manages multiple types of content (e.g., Pages, Products, Articles). We prevent cross-contamination by routing content strictly through the Content Type (slug) boundary. By specifying your blog's exact API ID (like articles), our system targets only the POST /api/articles endpoint. Strapi will automatically isolate the data into your blog collection, leaving your general pages and other collections completely untouched and protected.

馃挕

Base URL format changed: Unlike earlier versions of this guide, the Base URL should not include /api. iContentForge automatically appends /api/ for v4 and v5, or the correct path for v3, based on your version selection.

  1. Click Test Connection. A success message confirms iContentForge can communicate with your Strapi instance.
  2. Click Save Connector.

Step 4: Map Content Types and Fields

After a successful connection, you must map iContentForge's article data to your Strapi Content-Type fields.

  1. In the Strapi connector settings, find the Content Type Mapping section.

  2. Select your target Content-Type from the dropdown (e.g., article).

  3. Map the required fields. At a minimum, you should map:

    • Title: Map to your Strapi field for the article title (e.g., title).
    • Content (HTML): Map to your Strapi field that accepts rich text/HTML (e.g., content or body).
  4. You can optionally map other iContentForge data:

    • Excerpt: Map to a text field.
    • Featured Image URL: Map to a media or text field.
    • Meta Title / Meta Description: Map to SEO plugin fields (e.g., seo.metaTitle, seo.metaDescription).
    • Slug: Map to a UID field.
    • Tags/Categories: Map to relation fields.
  5. Configure the Default Article Status in Strapi. Choose whether articles should be created as Draft or published immediately (Published).

  6. Click Save Configuration.

How Publishing Works

Once configured, articles will be published according to your project's Drip Feed schedule (approximately every 5 minutes).

  1. An article in Ready status is queued for publishing.
  2. iContentForge sends a POST request to your Strapi API endpoint, formatted according to your selected version:
    • v3: POST /[content-type] with fields directly in the body.
    • v4: POST /api/[content-type] with fields wrapped in { "data": {...} }.
    • v5: POST /api/[content-type] with fields directly in the body.
  3. The article is created in Strapi with the status you configured.
  4. In iContentForge, the article status updates to Published.
  5. If an error occurs (e.g., invalid token, field mismatch), the status changes to Error, and you can check the logs for details.

Troubleshooting

SymptomLikely CauseSolution
Test Connection failsIncorrect Base URL or invalid API Token.Ensure the Base URL is the site root do not include /api. Regenerate the token in Strapi and update the connector.
400 Bad Request on publishWrong Strapi version selected.Check which version of Strapi you're running and update the Strapi Version field in the connector settings.
Article status is "Error"Missing field permissions or data type mismatch.Ensure the API Token has create permission for the Content-Type. Check that the mapped Strapi fields exist and accept the correct data type (e.g., HTML for content).
Article created as Draft when expected PublishedDefault status in iContentForge is set to "Draft".Update the Default Article Status in the connector configuration to "Published".
Images or media not appearingFeatured Image URL is not mapped, or Strapi cannot handle external images.Ensure the Featured Image URL is mapped to a media field. Strapi may require uploading the image first; consider using a plugin to handle external image URLs.

Next Steps

Your Strapi integration is now complete. Articles will be published automatically based on your schedule.