Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  How do I update the default variant / answer of a newly created article in the knowledgebase?

    Posted 03-28-2025 08:45
    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
    ------------------------------


  • 2.  RE: How do I update the default variant / answer of a newly created article in the knowledgebase?

    Posted 04-08-2025 03:14

    Anybody something I can try or take a look at? Thanks.



    ------------------------------
    Richard Kiewiet
    Product Owner
    ------------------------------



  • 3.  RE: How do I update the default variant / answer of a newly created article in the knowledgebase?

    Posted 04-09-2025 07:33

    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
    ------------------------------