Schema for body for postKnowledgeKnowledgebaseDocuments unclear + followup

The postKnowledgeKnowledgebaseDocuments api call (and some others) is requiring a body parameter. I cant find the body schema so I have no idea what I must and can send.

Could you share this schema or send me to the documentation about this? Thanks.

postKnowledgeKnowledgebaseDocuments api call

Hello,

You can find the description of the request body schema on the Dev Center API Explorer:
POST /api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents

Regards,

1 Like

Thanks, I wasnt aware of the api explorer.

I have 2 followup questions:

  1. It seems like I cant get documents through the API which are in draft. Is this by design? If so; how do I publish a document with the API because there doesnt seem to be a published field in the schema for creating or updating a document?

  2. There isnt a content field when creating or updating a document. I think I need to update the content of the variation. How do I update the content of the default variation? I could get the variations for a document and filter by the variant name but that breaks if the variant name get updated?

Hello,

It is always better to create a new post if you have followup questions.
I am not expert on Knowledge Base and answered for the API schema/body question you had. With a fresh new question/post, people participating on this forum will see more easily that there is a pending question to answer.

To answer your questions, what I usually do is to check what the Genesys Desktop UI is doing when creating articles or publishing them (doing this via the UI). It will help fill the gaps.

I see that it uses 2 endpoints (one or the other) to retrieve documents.
POST /api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/query
and
GET /api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents
Note that the GET endpoint has a query parameter to define if you want to includeDrafts or not.

As of the publication. I see that the Genesys Desktop is using the following endpoint in preview to publish a set of drafts at once: POST /api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/versions/bulk/add

For unitary publish, I have the feeling that this should be this endpoint: POST /api/v2/knowledge/knowledgebases/{knowledgeBaseId}/documents/{documentId}/versions
The description of the restoreFromVersionId body attribute says: The globally unique identifier for the document version. If the value is provided, the document is restored to the given version. If not, it publishes the draft changes as a new version of the document.

Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.