How to delete an uploaded file via Qna Maker API?

Marc Hollyoak 61 Reputation points
2021-08-07T06:56:06.43+00:00

Hi team,

I understand that I can add another file to an existing KB via API using Update (Add) KB using 'fileName' and 'fileURI' of FileDTO:
https://learn.microsoft.com/en-us/rest/api/cognitiveservices-qnamaker/qnamaker5.0preview2/knowledgebase/update#add

However, after the file is uploaded, is it possible to delete the same file via API (as you can easily do in the QnA Maker portal). The delete function refers to 'sources', but not 'fileName' as in the FileDTO: https://learn.microsoft.com/en-us/rest/api/cognitiveservices-qnamaker/qnamaker5.0preview2/knowledgebase/update#delete.

1) Do I use this delete function with 'sources' set to the 'fileName(s)' required to be deleted?
2) Is 'fileName' just used as a label 'source' within the KB, thus QnA Maker uses the 'fileURI' only to locate and upload the file?

Many thanks

Marc

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,420 questions
0 comments No comments
{count} vote

Accepted answer
  1. Ramr-msft 17,616 Reputation points
    2021-08-09T10:24:44.797+00:00

    @Marc Hollyoak Thanks for the question. Yes, you can use the 'sources' set to List of source to be deleted from knowledgebase. Can you please share the sample and any error that you are getting.

    Here is the quickstart sample using preview SDK.


0 additional answers

Sort by: Most helpful