Skip to content

填字游戏 API 参考

填字游戏: 本参考直接读取 API 共用注册表与输入契约中的模式、预设、格式和字段。

请求示例

curl -X POST https://puzzlegenio.com/api/v1/puzzles \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Idempotency-Key: task-000000000001' \
  -H 'Content-Type: application/json' \
  -d '{ "type": "crossword", "title": "Nature crossword", "input": { "entries": [ { "word": "RIVER", "clue": "A flowing body of water" }, { "word": "TREE", "clue": "A woody plant" } ] } }'

模式

normal · solution-word

页面预设

浏览器导出格式

pdf · answer-pdf

导出格式取决于题目配置和账户套餐。创建响应中的 viewUrl 与 exportPageUrl 用于浏览器下载,不包含 PDF、PNG 或 STL 文件内容。发布时确定导出权限,再次发布时重新检查。

通用请求字段

字段允许的值必填
preset文本否
mode文本否
locale任选其一; en | zh | es | de | fr | pt | it | id | ja | ko否
contentLanguage任选其一; en | zh | es | de | fr | pt | it | id | ja | ko否
title文本是
retentionDays数字; 整数否
appearance.fontFamily任选其一; sans | serif | handwriting | playful | mono否
appearance.themeColor文本否
appearance.footerText文本; 最大 200否
appearance.borderStyle任选其一; solid | dashed | dotted否
appearance.layoutMode任选其一; default | worksheet否
appearance.pillTitle是/否否
appearance.showWorksheetHeader是/否否
appearance.outerBorder是/否否
export.paperSize任选其一; A3 | A4 | A4-landscape | A5 | B5 | Letter | Letter-landscape | Legal | Half-Letter | Tabloid | custom否
export.widthMm数字; 最小 50; 最大 2000否
export.heightMm数字; 最小 50; 最大 2000否
export.unit任选其一; mm | cm | in | px否
export.quality任选其一; standard | high | print否
input.entries列表; 最小 1; 最大 200否
input.entries[].word文本; 最小 1; 最大 50否
input.entries[].clue文本; 最小 1; 最大 300否
input.templateId文本; 最小 1; 最大 100否
input.solutionWord文本; 最小 1; 最大 50否
options.seed数字; 整数; 最小 0; 最大 2147483647否
options.difficulty任选其一; easy | medium | hard否
options.gridSize数字; 整数; 最小 5; 最大 50否

模板与主题

查询 /api/v1/capabilities 获取当前可用的模板编号、主题与账户限额。选择模板后创建的结果同样占一个保存名额。

图片与文件

图片输入使用本账户预先上传或导入的 assetId。下载在浏览器结果页进行;结果页链接并不是文件直链。

失败情形

未知字段、冲突的 type、mode 与 preset 返回 422。无法生成完整谜题的输入也返回 422。实际可用格式取决于配置和账户权益。

填字游戏 API 参考