question

MarcHollyoak-6307 avatar image
1 Vote"
MarcHollyoak-6307 asked ramr-msft answered

How to delete an uploaded file via Qna Maker API?

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://docs.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://docs.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-qna-maker
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ramr-msft avatar image
0 Votes"
ramr-msft answered

@MarcHollyoak-6307 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.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ramr-msft thanks for your reply.

No error yet, just was trying to understand whether I have the correct solution - use 'sources' set to the 'fileName' to be deleted.

Thanks again for your rapid and valuable support!

1 Vote 1 ·

@ramr-msft - excellent - thanks for the guidance!

Marc

1 Vote 1 ·
ramr-msft avatar image ramr-msft MarcHollyoak-6307 ·

@MarcHollyoak-6307 Yes, use 'sources' set to the 'fileName' to be deleted.

1 Vote 1 ·