Add SharePoint Document URL to QnAMaker - Cognitive Service Knowledge Base using API

Amit Thakkar 1 Reputation point
2020-06-02T13:17:52.733+00:00

It is allowed to add a SharePoint Document URL to Cognitive Service URL as per this article which works fine when we add URL manually from the portal.

However, if we use the Knowledgebase - Update API, it works fine to add a new anonymous URL to the existing knowledge base. But, if we try adding a URL to SharePoint Document with the same method, it does not work.

Request Payload is as below:

{  
  "add": {  
    "urls": [  
      "https://<tenant-name>.sharepoint.com/Shared%20Documents/sample.docx"  
    ],  
     "qnaList": []  
  },  
  "delete": {},  
  "update": {},  
  "name": "SampleQnA"  
}  

Response Payload is as below, but URL is not added to the Knowledge Base:

{  
  "operationState": "NotStarted",  
  "createdTimestamp": "2020-06-02T13:12:13.1640525Z",  
  "lastActionTimestamp": "2020-06-02T13:12:13.1640525Z",  
  "userId": "7fca1258ffc8455ea10a47e4d4ccdf51",  
  "operationId": "7a21036d-4a61-43db-a3db-7592b2cae3b0"  
}  

Appreciate any help on this, Thanks in advance.

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

1 answer

Sort by: Most helpful
  1. GiftA-MSFT 11,151 Reputation points
    2020-06-04T15:46:59.163+00:00

    Adding SharePoint URLs through API is currently not supported by QnAMaker. If your application using the APIs to do QnAMaker operations has the permission to the SharePoint document, you may download the SharePoint document on the client side and use the UpdateKB/CreateKB API with the document. QnAMaker portal works in the similar way - asks permissions for SharePoint, accesses the document on client side, and uses the UpdateKB/CreateKB API in a similar way. Please refer to the following document for more details.