首页 > 解决方案 > 使用 Contentful REST API 获取包含图像的所有条目

问题描述

我正在使用 typescript 和 Contentful-ManagementAPI(这就是我不使用 SDK 客户端的原因),并且我想从特定类型中检索所有条目。我这样称呼 Api: axios.get("https://api.contentful.com/spaces/" + space_id + "/entries?content_type=" + content_type+"&include="+2)

我收到了所有请求的条目,但在图像字段中我得到了这个:

poster:en-US: sys: {type: "Link", linkType: "Asset", id: "222xxm9aaAu4GiAc2ESw0Q"}

那么,我怎样才能获得图像 URL?我将不胜感激任何帮助。谢谢

标签: contentfulcontentful-management

解决方案


来自内容丰富的文档:

CMA 不支持 include 和 locale 参数。

所以,我可能会更好地使用交付 api 来检索内容,使用管理 api 来创建/更新/删除。这就是它应该使用的方式。


推荐阅读