Updating entry fails with 'X-Contentful-Version' error
See original GitHub issueI’m trying to update an entry like so:
client
.getSpace()
.then(space => space.getEntry('entryId`))
.then((entry) => {
entry.fields.someField = 'some new value'
return entry.update()
})
I get the following error message:
Error: “value” required in setHeader(“X-Contentful-Version”, value)
According to the docs, this should be managed by the API:
When updating an existing resource, you need to specify its current version with the X-Contentful-Version HTTP header (this header is automatically set when using our official SDKs).
I’m also seeing these warnings (could this be the cause?):
Deprecated: Space.getEntry() will be removed in future major versions.
Please migrate your code to use Environment.getEntry()
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Errors | Contentful
HTTP status code Error code Description
401 Unauthorized AccessTokenInvalid The authorization token was invalid.
422 Unprocessable Entity UnknownField The triggered query references an unknown...
422 Unprocessable...
Read more >Updating a Contentful entry - Stack Overflow
This error occurs when you're trying to update an existing asset, entry or content type, and you didn't specify the current version of...
Read more >Unable to publish data into Contentful - APIs
Hi, I believe you are sending the entry id and “X-Contentful-Version”. When updating an entry, need to follow three steps: Get the data...
Read more >Updating entry fails with 'X-Contentful-Version' error
I'm trying to update an entry like so: client .getSpace() .then(space => space.getEntry('entryId`)) .then((entry) => { entry.fields.
Read more >Home - Contentful Developer Documentation
JavaScript SDK for Contentful's Content Management API. ... If it is a bug related to the code create a GitHub issue and make...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nevermind, it actually worked, I was moving the entry around functions and it might have misplaced its reference.
So, @umair00, you can just do as I did there.
I’m experiencing the same issue as described by @umair00