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"
]
}Versioning
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.
PATCH
/
components
/
upgrade
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"
]
}Body
application/json
Developer IDs of the project text items to bring up to date with their library component. Each must be a library instance.
Required array length:
1 - 100 elementsResponse
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