curl --request PATCH \
--url https://api.dittowords.com/v2/components/upgrade \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"textItemIds": [
"text-item-id-1",
"text-item-id-2"
]
}
'{
"success": true,
"upgradedTextItemIds": [
"text-item-id-1"
],
"unchangedTextItemIds": [
"text-item-id-2"
]
}{
"message": "Text items are not linked to a library component: text-item-id-1"
}{
"message": "This workspace hasn't opted into library component versioning"
}{
"message": "Text item with developer ID text-item-id-1 has local edits that upgrading would discard. Set discardLocalEdits to discard them, or update the component to match first.",
"modifiedTextItemIds": [
"text-item-id-1"
]
}Upgrade component instances
Brings library component instances in projects up to date with the latest published version of their component, by the text items’ Developer IDs. Instances that are already up to date are returned in unchangedTextItemIds. The operation is all-or-nothing: if any instance can’t be upgraded due to an error condition, none are.
Only available in workspaces that have opted into library component versioning.
curl --request PATCH \
--url https://api.dittowords.com/v2/components/upgrade \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"textItemIds": [
"text-item-id-1",
"text-item-id-2"
]
}
'{
"success": true,
"upgradedTextItemIds": [
"text-item-id-1"
],
"unchangedTextItemIds": [
"text-item-id-2"
]
}{
"message": "Text items are not linked to a library component: text-item-id-1"
}{
"message": "This workspace hasn't opted into library component versioning"
}{
"message": "Text item with developer ID text-item-id-1 has local edits that upgrading would discard. Set discardLocalEdits to discard them, or update the component to match first.",
"modifiedTextItemIds": [
"text-item-id-1"
]
}Authorizations
Body
Developer IDs of the project text items to bring up to date with their library component. Each must be a library instance.
1 - 100 elementsDeveloper ID of the project to scope the upgrade to. If provided, each given Developer ID must match a text item in this project, and only that text item is upgraded. Required when a Developer ID is shared by text items spawned from the same base text item in multiple projects.
Whether to discard the local edits held by any of the text items (those in the modified or conflict state), resetting them to match their component. When omitted or false, the request fails if any text item holds local edits.
Response
Returns success status of the upgrade operation, the Developer IDs of the text items that were upgraded, and the Developer IDs of any that were already up to date
Indicates whether the upgrade was successful
Developer IDs of the text items brought up to date with their component, in request order. Each is now current.
Developer IDs of the text items that were already current, in request order