Forum Discussion
Sander Simons
Jan 24, 2019Copper Contributor
Retrieve overview of users recent documents
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...
Feb 20, 2019
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
Cheers,
Federico
Sander Simons
Mar 11, 2019Copper Contributor
Hi FedericoPorceddu82, 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:
- https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples
- https://github.com/SharePoint/sp-dev-fx-webparts/blob/master/samples/react-officegraph/src/webparts/myRecentDocuments/components/MyRecentDocuments.tsx
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:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<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?