iqual/iq_contentbird_api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iqual/iq_contentbird_api

Composer 安装命令:

composer require iqual/iq_contentbird_api

包简介

Provides integration with the contentbird Integration API for content management, publishing workflows, and webhook events.

README 文档

README

Drupal 11 module providing integration with the contentbird Integration API.

This module provides a configurable API client service and webhook endpoint to interface between Drupal and the contentbird content management platform.

Features

  • API Token Authentication: Secure communication via the X-ContentbirdApiToken header.

  • Admin Settings Form: Configure API token, base URL, and endpoints at admin/config/services/iq_contentbird_api.

  • API Client Service: Injectable service (iq_contentbird_api.client) for communicating with contentbird:

    • Fetch content statuses, custom elements, and custom fields (Utils).
    • Create, fetch, and update content items.
    • Update content status (e.g., "CMS imported", "Published").
    • Create social posts.
  • Webhook Endpoint: Receives push events from contentbird at /iq_contentbird_api/webhook.

  • Event System: Dispatches ContentbirdWebhookEvent so other modules can subscribe and react to webhook events.

Requirements

  • Drupal 11
  • PHP 8.3+
  • Guzzle HTTP client (included with Drupal core)

Installation

  1. Install the module via Composer composer require iqual/iq_contentbird_api
  2. Enable the module: drush en iq_contentbird_api
  3. Navigate to Admin > Configuration > Web services > Contentbird API Settings.
  4. Enter your contentbird API token (generated under Setup > System > Integrations > Api authentication in contentbird).
  5. Verify the connection status shows as "Connected successfully".

Configuration

API Token

Generate an API token in contentbird under Setup > System > Integrations > Api authentication and paste it into the Drupal settings form.

Webhook Setup

  1. Note the webhook URL shown on the settings page (e.g., https://your-site.com/iq_contentbird_api/webhook).
  2. Configure this URL in your contentbird webhook settings.
  3. Optionally set a webhook secret for payload signature verification.

Usage

Using the API Client Service

Inject the service iq_contentbird_api.client in your custom code:

// In a controller or service using dependency injection:
public function __construct(
  private ContentbirdApiClientInterface $contentbirdClient,
) {}

// Fetch list ids.
$list_ids = $this->contentbirdClient->getListOfIds();

// Fetch a single content item.
$content = $this->contentbirdClient->getContent(12345);

// Update content status to a published status (status ID from getListOfIds()).
$this->contentbirdClient->updateStatusPublishedContent(
  content_id: 12345,
  status_id: 3,
  published_url: 'https://your-site.com/node/42',
);

// Create a social post.
$this->contentbirdClient->createSocialPost([
  'contentId' => 12345,
  'text' => 'Check out our new article!',
]);

Subscribing to Webhook Events

Create an event subscriber in your module:

namespace Drupal\my_module\EventSubscriber;

use Drupal\iq_contentbird_api\Event\ContentbirdWebhookEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class ContentbirdWebhookSubscriber implements EventSubscriberInterface {

  public static function getSubscribedEvents() {
    return [
      ContentbirdWebhookEvent::WEBHOOK_RECEIVED => 'onWebhookReceived',
    ];
  }

  public function onWebhookReceived(ContentbirdWebhookEvent $event) {
    $data = $event->getData();
    $eventType = $event->getEventType();
    // Process the webhook data, e.g., create/update Drupal nodes.
  }

}

Register the subscriber in your module's services YAML file:

services:
  my_module.contentbird_webhook_subscriber:
    class: Drupal\my_module\EventSubscriber\ContentbirdWebhookSubscriber
    tags:
      - { name: event_subscriber }

Typical Integration Workflow

  1. Content is created and approved in contentbird.
  2. Contentbird sends a webhook to your Drupal site (or you pull via API).
  3. Your custom subscriber creates a Drupal node draft with the contentbird content.
  4. The module updates the contentbird status to "CMS imported".
  5. When the Drupal node is published, update the contentbird status with the published URL.

API Reference

See the full contentbird Integration API documentation.

License

This project is licensed under the GPL-2.0-or-later license.

iqual/iq_contentbird_api 适用场景与选型建议

iqual/iq_contentbird_api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 40 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「content management」 「drupal」 「contentbird」 「CMS integration」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 iqual/iq_contentbird_api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 iqual/iq_contentbird_api 我们能提供哪些服务?
定制开发 / 二次开发

基于 iqual/iq_contentbird_api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 40
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 21
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-03-04