Retrieve overview of users recent documents

Copper Contributor

Hi there,

 

We have made a SPFx WebPart which also contains a list of recent documents of the user which is using the WebPart. The recent documents is retrieved by Graph call. It now turns out that the returned set of recent documents is not complete if we compare this for example with the list of recent documents within the Delve page or within Teams. Both the Delve page and Teams are using their own API`s to retrieve the recent documents of a user and are NOT using the Graph API.

Does anyone has an idea which Graph call to do to get the same list of recent documents as specified within Delve and Teams. If Graph is not able to make this call which API could I use to collect this data?

The documents are mostly saved within SharePoint.

 

Thanks in advance for the answers and your time!

2 Replies

Hi @Sander Simons ,

take a look here: Social Intelligence Graph api, mainly are in beta https://docs.microsoft.com/it-it/graph/api/resources/social-overview?view=graph-rest-beta but start to follow :) 

 

Meanwhile, you can use this approach, waiting GA of graph api:  Office Graph instead Microsoft Graph .

Look at this sample https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-officegraph 

Here you can find the right query

https://github.com/SharePoint/sp-dev-fx-webparts/blob/master/samples/react-officegraph/src/webparts/...

 

Cheers,

Federico

Hi @Federico Porceddu, thank you for the response.
The links posted are not working anymore and have changed a bit. Here are the new links which you are refering to:

 

As you mentioned there is the Social Intelligence Graph API. This is also the API we are using. The following query is used in our case: 

.api("me/insights/used") .version("beta")

 

I have checked the usage of the Office Graph but when I tried to execute a query within the browser I got the following message:

  <m:code>
-1, Microsoft.Office.Server.Search.REST.SearchServiceException
</m:code>
<m:message xml:lang="en-US">SPO graph API is deprecated.</m:message>
</m:error>
 
The query we used was:
https://{TENANTNAME}.sharepoint.com/_api/search/query?querytext=%27*%27&properties=%27GraphQuery:actor(me\\,or(action\\:1001\\,action\\:1003)),GraphRankingModel:{%22features%22\\:[{%22function%22\\:%22EdgeTime%22}]}%27

 

So it looks like this is not supported and not working anymore.
Does anyone have other ideas which we can test or try?