对外 API

对外 API

合光尘软件官网基于 Halo 2.27(社区版,免费) 构建,对外提供开放接口,供第三方软件接收与对接需求数据。

访问方式

  • 站点地址:https://heguangchen.com
  • 认证方式:Authorization: Bearer <个人访问令牌 PAT>(后台 → 个人资料 → 个人访问令牌 创建)
  • 接口格式:JSON(Halo Content API / Console API)

注意:PAT 属于私密凭据,仅可保存在服务端或第三方软件中,严禁写入公开前端页面。

内容类接口(免费开放,无需鉴权)

接口 方法 说明
/apis/content.halo.run/v1alpha1/posts GET 获取文章列表(含行业案例)
/apis/content.halo.run/v1alpha1/categories GET 获取行业分类列表
/apis/content.halo.run/v1alpha1/posts?labelSelector=... GET 按行业分类过滤文章
/apis/content.halo.run/v1alpha1/singlepages GET 获取自定义页面

需求提交接口(公网提交,无需鉴权)

官网「需求提交」页面的表单即调用此接口,第三方系统亦可直接调用,帮助用户把需求写入本站:

POST /apis/api.forms.halo.run/v1alpha1/forms/submit-request/submissions

请求头需携带 Idempotency-Key(防重复提交),请求体示例:

{
  "revisionHash": "175ac0766204ee478163bd0f76e8e83584dd5e25596fcccd8707656ff286dd4b",
  "values": {
    "name": "张三",
    "phone": "13800138000",
    "industry": "retail",
    "req_type": "website",
    "description": "希望实现一个会员积分小程序。",
    "deadline": "2026-12-31"
  },
  "startedAt": "2026-11-01T00:00:00.000Z",
  "timezone": "Asia/Shanghai"
}
  • industry 取值:education 教育 / medical 医疗 / retail 零售 / manufacturing 制造 / finance 金融 / government 政务 / internet 互联网 / other 其他
  • req_type 取值:info-system 信息系统 / website 官网·小程序 / app 移动应用 / automation 流程自动化 / data 数据分析 / other 其他
  • 成功返回 201:{"receiptId":"cf_xxx","acceptedAt":"...","revisionNumber":1,"replayed":false}

需求读取接口(第三方接收,需 PAT 鉴权)

第三方软件可用如下接口拉取全部已提交需求:

GET /apis/console.api.forms.halo.run/v1alpha1/submissions?page=0&size=10&formName=form-c2bdd7bd19bb4d3d88ba5ca02575795b

响应示例:

{
  "items": [{
    "name": "submission-xxx",
    "formName": "form-c2bdd7bd19bb4d3d88ba5ca02575795b",
    "formTitle": "需求提交",
    "revisionNumber": 1,
    "receiptId": "cf_xxx",
    "status": "new",
    "read": false,
    "spamState": "suspected",
    "acceptedAt": "2026-11-01T04:48:49.680948425Z",
    "answerCount": 6
  }],
  "total": 1, "page": 1, "size": 10
}

单条详情:GET /apis/console.api.forms.halo.run/v1alpha1/submissions/{name}(含全部字段答案)。

数据导出与进阶接入

  • CSV 导出:后台控制台 → 联系表单 → 需求提交 → 导出,无需开发即可与 Excel / 低代码平台离线对接;
  • MCP 服务:免费接入 MCP,供 AI 助手直接读取需求数据;
  • Webhook 实时推送:需求提交后实时推送到第三方系统,需购买联系表单插件许可证(进阶能力,按需开通)。

免费额度说明

社区版免费额度:每站点 1 张表单(当前已使用 1 张),提交条数不限。官方公告(2026-09-30):https://www.halo.run/archives/appstore-freemium-type