As you can check below screenshot I tried to make PUT api call in the Contentful to update the entry.
When I try to hit GET call, everything works fine but don't understand here what is reason of this below error while making PUT call.
Did I missed anything here or anything wrong here?
NOTE: I changed all the variable while making call, spaceId, env, entryId and authorisation(passing access_token)
From what I see in your URL, it looks like you are trying to hit the Contentful Preview API
, which is read-only.
API Base URL https://preview.contentful.com This is a read-only API
Therefore, updating an entry via a PUT
request cannot be done with the url you are using.
However, I believe your PUT
request should work if you update the base url to be https://api.contentful.com/
instead. This is the endpoint for the Content Management API
.
Important note:
Content Management API
.Using https://api.contentful.com/
hits the writable Content Management API
, which has documentation for the PUT
request you are making.
Importing the corresponding curl
command into your Postman client will confirm this.
So in the end, the url would be this:
https://api.contentful.com/spaces/{space_id}/environments/{environment_id}/entries/{entry_id}
Again, the bearer token will have to come from the writable Content Management API.