Turns out you will get the variations using the API call above if you first save content for the variation through the UI. But to save content into a variation through the API you need the variation id which isnt possible if the id of the default variation isnt returned initially.
My current workaround: create a new variation right away; in the UI this seems to show up as the only default variation. This indicates to me that the "default" variation you see in the UI isnt existing untill you actually press save. At that moment its probably created which explains why it wont show up in the GET variation calls right after article creation.
------------------------------
Richard Kiewiet
Product Owner
------------------------------
Original Message:
Sent: 03-28-2025 08:44
From: Richard Kiewiet
Subject: How do I update the default variant / answer of a newly created article in the knowledgebase?
Looking at the UI it seems like a variation is updated with the id of the default variant. Im trying to retrieve that id so I can do the same through the API. However; after creating the article and retrieving the variations for the article the entities array is empty.
How can I update the default variant?
Example:
const res = await Instance.postKnowledgeKnowledgebaseDocuments(knowledgeBaseId, body)const variantionRes = await Instance.getKnowledgeKnowledgebaseDocumentVariations(knowledgeBaseId, res.id, {"documentState": "draft"})console.log(variantionRes)"{ entities: [] }"
#PlatformAPI
#PlatformSDK
------------------------------
Richard Kiewiet
Product Owner
------------------------------