Contentful logo

Contentful Community

Unable to publish data into Contentful

I am trying to read an entry from Contentful and modifying it and later trying to publish the entry, since it is an existing entry in Contentful, I am not providing any Content-Type and was encountered with below error. This is happening only for few entries.
Can someone please help me with this?
2021-01-19 19:52:10.695 ERROR 1 — [skExecutor-9489] .r.o.e.b.j.p.w.ContentfulEntryItemWriter : [XXXXXX57] ErrorBody { message = You should provide a content type in X-Contentful-Content-Type request header., requestId = ce0f7d30372893fa94aac0d3df31a761, sys = Sys { id = BadRequest, type = Error } }

Hi, I believe you are sending the entry id and “X-Contentful-Version”.
When updating an entry, need to follow three steps:

  1. Get the data from contentful
  2. Update the data
  3. Publish the data

For updating an entry, passing the ID of the entry’s content type is not required.

You can refer the below links, that will help and working for me.
https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries/entry

Thanks