如何使用 contentful.com 中的 API 更新内容的状态

问题描述 投票:0回答:0

我在 contentful.com 中创建了一个内容。在浏览 api 文档时,我尝试使用 GET API 来访问内容,但我在文档的任何地方都看不到编辑/更新内容 API。有人对此有任何解决方案吗?

我找到了一个文档https://www.contentful.com/developers/docs/references/content-management-api/#/introduction/updating-content 该文档说“Contentful 不会合并对内容所做的更改,因此在更新内容时,您需要发送整个条目。”

为此我做了一个 GET 调用,收集了整个身体。但是我没有看到我需要升级的全身状态。

以下是正文:

    {
        "metadata": {
            "tags": []
        },
        "sys": {
            "space": {
                "sys": {
                    "type": "Link",
                    "linkType": "Space",
                    "id": "fdgre4353"
                }
            },
            "id": "xzvcfd5434",
            "type": "Entry",
            "createdAt": "2023-04-14T05:46:22.768Z",
            "updatedAt": "2023-04-14T05:47:27.521Z",
            "environment": {
                "sys": {
                    "id": "master",
                    "type": "Link",
                    "linkType": "Environment"
                }
            },
            "revision": 2,
            "contentType": {
                "sys": {
                    "type": "Link",
                    "linkType": "ContentType",
                    "id": "carousal"
                }
            },
            "locale": "en-US"
        },
        "fields": {
            "name": "Test-by-dnt",
            "panels": [
                {
                    "sys": {
                        "type": "Link",
                        "linkType": "Entry",
                        "id": "dsfw4e54332432fvdf"
                    }
                },
                {
                    "sys": {
                        "type": "Link",
                        "linkType": "Entry",
                        "id": "dsfvdft5e4tr43fg"
                    }
                }
            ]
        }
    }
api contentful contentful-api contentful-management
© www.soinside.com 2019 - 2024. All rights reserved.