Let's get started
With so many options available to you,
we suggest you start with the following:
- Read the Documentation
- Watch video tutorials at Laracasts
v13.32.0 View changelog
With so many options available to you,
we suggest you start with the following:
v13.32.0 View changelog
基础地址:https://cms.cooope.com/api/v1,所有接口仅返回已发布内容,无需鉴权。
GET https://cms.cooope.com/api/v1/{类型slug}/entries
例如获取产品列表:
GET https://cms.cooope.com/api/v1/products/entries
返回 data(条目数组)与 meta(total 总数、per_page 每页条数、current_page 当前页码)。
可用 GET https://cms.cooope.com/api/v1/content-types 查询所有可用类型 slug。
| 参数 | 说明 | 示例 |
|---|---|---|
filter[taxonomy] |
按分类 slug 过滤,逗号分隔多个分类(或关系),也可用 filter[taxonomies] |
?filter[taxonomy]=smart-terminals,hardware |
filter[字段名] |
按内容类型定义的字段精确过滤(翻译字段查译文,其他查 data) | ?filter[brand]=acme |
q |
关键词搜索,匹配文本 / 富文本 / 数字类字段 | ?q=边缘计算 |
page / per_page |
分页,per_page 最大 100 | ?page=2&per_page=20 |
sort |
排序,支持 id / created_at / published_at / sort,前缀 - 为倒序 |
?sort=-published_at |
lang |
输出指定语言内容(默认中文) | ?lang=en |
组合示例——搜索「智能终端」分类下价格字段过滤并分页:
GET https://cms.cooope.com/api/v1/products/entries?filter[taxonomy]=smart-terminals&page=1&per_page=10
GET https://cms.cooope.com/api/v1/{类型slug}/entries/{id或slug}
支持数字 ID 或任意语言的 slug:
GET https://cms.cooope.com/api/v1/products/entries/24
GET https://cms.cooope.com/api/v1/products/entries/e200
返回单条条目,包含 fields、taxonomies(分类)、封面 cover 与图集 gallery 等。
GET https://cms.cooope.com/api/v1/taxonomies/{slug}/children?lang=zh
返回指定分类的完整子树(含 entries_count 发布计数),可用于前端筛选菜单。