Hi @martin.palma,
Officially, we only expose this info in the UI:
Now, unofficially, under the hood that uses a secret API that you can technically access yourselfā¦ however, that endpoint is deprecated (edit: actually, itās new and still under development, i.e., āalphaā), undocumented, and subject to change at any time without warning (i.e. it may break tomorrow!). Iāll check with the devs about why this is deprecated unofficial, but for now, itās very much āuse at your own riskā ā please donāt make any long-lasting scripts with it, because it may suddenly break without warning. That said, if you want to try it anyway, here are the details (click to unblur):
The API endpoint is: https://site-api.datocms.com/items/itemId/current-vs-published-state
Or in the CMA JS client as the deprecated method client.items.currentVsPublishedState(itemId, {nested: boolean})
That will get you a response like:
{
"id": "181065759",
"type": "item_current_vs_published_state",
"current_version_locales": [
"de",
"en",
"es",
"fr",
"it",
"pt",
"ru",
"sv"
],
"published_version_locales": [
"de",
"en",
"es",
"fr",
"it",
"pt",
"ru",
"sv"
],
"changed_locales": [
"fr"
],
"added_locales": [],
"removed_locales": [],
"non_localized_fields_changed": true,
"scheduled_publication": null,
"scheduled_unpublishing": null,
"published_version": {
"id": "337327958",
"type": "item_version"
}
}
The fields changed_locales
, added_locales
, and removed_locales
will show you locale changes. Additionally, non_localized_fields_changed
will tell you whether there are also unlocalized fields that are not yet published. If you need to do a more detailed diff, you can compare versions manually using the item-version endpoint.
Iāll check with the devs to see if thereās a reason this is deprecated unofficial and whether there are any replacements planned. (Edit: Not immediately, see posts below. Maybe someday!) Hope that helps in the meantime?