Skip to main content

Updates an entry resource.

update(entry: Entry): Promise<Entry>

Returns

A Promise that will resolve with a Entry object.

Example

JavaScript
existingEntry['title'] = 'Back to the Future';

client.entries.update(existingEntry)
  .then(result => {      
    console.log('API call result: ', result);              
  })
  .catch(error => {
    console.log('API call fetch error: ', error);      
  });

Versioning

Contensis uses an optimistic concurrency versioning model. Rather than checking out entries and locking them we allow concurrent updating of entries. At the point in which you update an entry the version you pass in is checked to make sure it is the latest and no one else has created a newer version. If the version you pass in is the latest version then the entry will get updated. If you pass in a version which isn't now the latest then you will get the following response.

JSON
{
    "logId": "00000000-0000-0000-0000-000000000000",
    "message": "There are validation errors updating the entry",
    "data": [
        {
            "field": "Entry.Variations.Values[0].entryVariation",
            "message": "The entry variation is not the latest"
        }
    ],
    "type": "Validation"
}

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request