定制 woutersf/mautic-openapi-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

woutersf/mautic-openapi-bundle

Composer 安装命令:

composer require woutersf/mautic-openapi-bundle

包简介

Exposes a public OpenAPI 3.1.0 specification endpoint and Swagger UI viewer for the Mautic REST API.

README 文档

README

A Mautic plugin that generates and exposes an OpenAPI 3.1.0 specification for the Mautic REST API, with a built-in Swagger UI explorer.

Features

  • Serves the full OpenAPI 3.1.0 spec at /openapi (JSON or YAML)
  • Interactive Swagger UI at /openapi/view (loaded from CDN, zero install)
  • Respects the Mautic API enabled/disabled setting
  • Optional login gate: toggle between public and authenticated-only access
  • Enable/disable via the standard Mautic Plugins screen

Requirements

  • Mautic 4.x or 5.x
  • PHP 8.1+
  • Mautic REST API enabled (Configuration → API Settings)

Installation

Copy MauticOpenApiBundle/ into your Mautic plugins/ directory, then clear the cache:

php bin/console cache:clear

Go to Settings → Plugins, find OpenAPI Specification and enable it.

Endpoints

URL Response Description
/openapi application/json OpenAPI 3.1.0 spec
/openapi?format=yaml application/yaml Same spec in YAML
/openapi/view text/html Swagger UI explorer

The spec and viewer honour the same availability gate: both return 503 if the plugin or the Mautic API is disabled.

Configuration

Under Configuration → OpenAPI Settings:

Setting Default Description
Publicly available Yes When No, /openapi returns 401 Unauthorized and /openapi/view redirects to the Mautic login page

API coverage

The OpenAPI spec documents all standard Mautic REST API resources:

Swagger UI

The /openapi/view page loads Swagger UI v5 from a CDN and points it at this instance's /openapi endpoint. Features enabled by default:

  • Try-it-out (live API calls against this Mautic instance)
  • Persistent authorization across page reloads
  • Filter / search across all endpoints
  • Deep linking to specific operations

About the spec

The spec is generated at runtime so the servers.url always reflects the current Mautic instance URL. Format negotiation supports:

  • Query param: ?format=yaml
  • Accept header: application/yaml, text/yaml, application/x-yaml

License

GNU GPL v3: same as Mautic.

Built by Dropsolid

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固