Retrieve overview of users recent documents

%3CLINGO-SUB%20id%3D%22lingo-sub-325004%22%20slang%3D%22en-US%22%3ERetrieve%20overview%20of%20users%20recent%20documents%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-325004%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20there%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20made%20a%20SPFx%20WebPart%20which%20also%20contains%20a%20list%20of%20recent%20documents%20of%20the%20user%20which%20is%20using%20the%20WebPart.%20The%20recent%20documents%20is%20retrieved%20by%20Graph%20call.%20It%20now%20turns%20out%20that%20the%20returned%20set%20of%20recent%20documents%20is%20not%20complete%20if%20we%20compare%20this%20for%20example%20with%20the%20list%20of%20recent%20documents%20within%20the%20Delve%20page%20or%20within%20Teams.%20Both%20the%20Delve%20page%20and%20Teams%20are%20using%20their%20own%20API%60s%20to%20retrieve%20the%20recent%20documents%20of%20a%20user%20and%20are%20NOT%20using%20the%20Graph%20API.%3CBR%20%2F%3E%3CBR%20%2F%3EDoes%20anyone%20has%20an%20idea%20which%20Graph%20call%20to%20do%20to%20get%20the%20same%20list%20of%20recent%20documents%20as%20specified%20within%20Delve%20and%20Teams.%20If%20Graph%20is%20not%20able%20to%20make%20this%20call%20which%20API%20could%20I%20use%20to%20collect%20this%20data%3F%3C%2FP%3E%3CP%3EThe%20documents%20are%20mostly%20saved%20within%20SharePoint.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%20for%20the%20answers%20and%20your%20time!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-364050%22%20slang%3D%22en-US%22%3ERe%3A%20Retrieve%20overview%20of%20users%20recent%20documents%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-364050%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F138334%22%20target%3D%22_blank%22%3E%40Federico%20Porceddu%3C%2FA%3E%2C%26nbsp%3Bthank%20you%20for%20the%20response.%3CBR%20%2F%3EThe%20links%20posted%20are%20not%20working%20anymore%20and%20have%20changed%20a%20bit.%20Here%20are%20the%20new%20links%20which%20you%20are%20refering%20to%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-fx-webparts%2Ftree%2Fmaster%2Fsamples%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-fx-webparts%2Ftree%2Fmaster%2Fsamples%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-fx-webparts%2Fblob%2Fmaster%2Fsamples%2Freact-officegraph%2Fsrc%2Fwebparts%2FmyRecentDocuments%2Fcomponents%2FMyRecentDocuments.tsx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-fx-webparts%2Fblob%2Fmaster%2Fsamples%2Freact-officegraph%2Fsrc%2Fwebparts%2FmyRecentDocuments%2Fcomponents%2FMyRecentDocuments.tsx%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20you%20mentioned%20there%20is%20the%20Social%20Intelligence%20Graph%20API.%20This%20is%20also%20the%20API%20we%20are%20using.%20The%20following%20query%20is%20used%20in%20our%20case%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Eapi%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%22me%2Finsights%2Fused%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%20.%3C%2FSPAN%3E%3CSPAN%3Eversion%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%22beta%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20have%20checked%20the%20usage%20of%20the%20Office%20Graph%20but%20when%20I%20tried%20to%20execute%20a%20query%20within%20the%20browser%20I%20got%20the%20following%20message%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22line%22%3E%3CSPAN%20class%3D%22html-tag%22%3E%3CERROR%3E%3CSPAN%20class%3D%22html-attribute%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22html-attribute-name%22%3Exmlns%3Am%3C%2FSPAN%3E%3D%22%3CSPAN%20class%3D%22html-attribute-value%22%3E%3CA%20href%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fado%2F2007%2F08%2Fdataservices%2Fmetadata%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fschemas.microsoft.com%2Fado%2F2007%2F08%2Fdataservices%2Fmetadata%3C%2FA%3E%3C%2FSPAN%3E%22%3C%2FSPAN%3E%26gt%3B%3C%2FERROR%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22collapsible-content%22%3E%3CDIV%20class%3D%22collapsible%22%3E%3CDIV%20class%3D%22expanded%22%3E%3CDIV%20class%3D%22line%22%3E%3CSPAN%20class%3D%22html-tag%22%3E%26nbsp%3B%20%3CCODE%3E%3C%2FCODE%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22collapsible-content%22%3E%3CSPAN%20class%3D%22text%22%3E-1%2C%20Microsoft.Office.Server.Search.REST.SearchServiceException%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22line%22%3E%3CSPAN%20class%3D%22html-tag%22%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CDIV%20class%3D%22line%22%3E%3CSPAN%20class%3D%22html-tag%22%3E%3CMESSAGE%3E%3CSPAN%20class%3D%22html-attribute%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22html-attribute-name%22%3Exml%3Alang%3C%2FSPAN%3E%3D%22%3CSPAN%20class%3D%22html-attribute-value%22%3Een-US%3C%2FSPAN%3E%22%3C%2FSPAN%3E%26gt%3B%3C%2FMESSAGE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22text%22%3ESPO%20graph%20API%20is%20deprecated.%3C%2FSPAN%3E%3CSPAN%20class%3D%22html-tag%22%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22line%22%3E%3CSPAN%20class%3D%22html-tag%22%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22line%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22line%22%3E%3CSPAN%20class%3D%22html-tag%22%3EThe%20query%20we%20used%20was%3A%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22line%22%3E%3CSPAN%20class%3D%22html-tag%22%3Ehttps%3A%2F%2F%7BTENANTNAME%7D.sharepoint.com%2F_api%2Fsearch%2Fquery%3Fquerytext%3D%2527*%2527%26amp%3Bproperties%3D%2527GraphQuery%3Aactor(me%5C%5C%2Cor(action%5C%5C%3A1001%5C%5C%2Caction%5C%5C%3A1003))%2CGraphRankingModel%3A%7B%2522features%2522%5C%5C%3A%5B%7B%2522function%2522%5C%5C%3A%2522EdgeTime%2522%7D%5D%7D%2527%3C%2FSPAN%3E%3C%2FDIV%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ESo%20it%20looks%20like%20this%20is%20not%20supported%20and%20not%20working%26nbsp%3Banymore.%3CBR%20%2F%3EDoes%20anyone%20have%20other%20ideas%20which%20we%20can%20test%20or%20try%3F%3C%2FSPAN%3E%3C%2FP%3E%3CLINGO-SUB%20id%3D%22lingo-sub-354253%22%20slang%3D%22en-US%22%3ERe%3A%20Retrieve%20overview%20of%20users%20recent%20documents%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-354253%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F182313%22%20target%3D%22_blank%22%3E%40Sander%20Simons%3C%2FA%3E%20%2C%3C%2FP%3E%3CP%3Etake%20a%20look%20here%3A%20Social%20Intelligence%20Graph%20api%2C%20mainly%20are%20in%20beta%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fit-it%2Fgraph%2Fapi%2Fresources%2Fsocial-overview%3Fview%3Dgraph-rest-beta%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fit-it%2Fgraph%2Fapi%2Fresources%2Fsocial-overview%3Fview%3Dgraph-rest-beta%3C%2FA%3E%20but%20start%20to%20follow%20%3A)%3C%2Fimg%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMeanwhile%2C%20you%20can%20use%20this%20approach%2C%20waiting%20GA%20of%20graph%20api%3A%26nbsp%3B%20Office%20Graph%20instead%20Microsoft%20Graph%20.%3C%2FP%3E%3CP%3ELook%20at%20this%20sample%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-fx-webparts%2Ftree%2Fmaster%2Fsamples%2Freact-officegraph%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-fx-webparts%2Ftree%2Fmaster%2Fsamples%2Freact-officegraph%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20you%20can%20find%20the%20right%20query%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-fx-webparts%2Fblob%2Fmaster%2Fsamples%2Freact-officegraph%2Fsrc%2Fwebparts%2FmyRecentDocuments%2Fcomponents%2FMyRecentDocuments.tsx%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-fx-webparts%2Fblob%2Fmaster%2Fsamples%2Freact-officegraph%2Fsrc%2Fwebparts%2FmyRecentDocuments%2Fcomponents%2FMyRecentDocuments.tsx%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%2C%3C%2FP%3E%3CP%3EFederico%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted

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

Highlighted

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?