Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Record

Retrieve information regarding changes between current and published versions of the record

Returns

Returns a resource object of type item_current_vs_published_state

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const itemId = "hWl-mnkWRYmMCSTq4z_piQ";
const item = await client.items.currentVsPublishedState(itemId);
// Check the 'Returned output' tab for the result ☝️
console.log(item);
}
run();
{
id: "EnO-NF5wRy6K-cxGt1doqg",
current_version_locales: [""],
published_version_locales: [""],
changed_locales: [""],
added_locales: [""],
removed_locales: [""],
non_localized_fields_changed: true,
scheduled_publication: { type: "scheduled_publication", id: "34" },
scheduled_unpublishing: { type: "scheduled_unpublishing", id: "34" },
published_version: { type: "item_version", id: "59JSonvYTCOUDz_b7_6hvA" },
}