Skip to main content

Updating an entity

Submitting the request#

Updating an entity in Architect is done by sending a PUT request to the entity path with the body parameters that represent field values we want updated.

Updating a todo
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({"title":"Update an app using Architect"});
const requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw
};
fetch("https://your_app_id.essentialz.cloud/api/todos", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Example response
{
"title": "Update an app using Architect",
"id": "87af6b75-485e-4262-8031-0ee2784213b8",
"created_at": "1623835509.4978082",
"updated_at": "1624847614.4978082"
}

Effects#

Updating an entity dispatches an event {{entity_name}}_updated to which you can subscribe with {insert link to webhook subscribe}