SPO graph API is deprecated?

%3CLINGO-SUB%20id%3D%22lingo-sub-82012%22%20slang%3D%22en-US%22%3ESPO%20graph%20API%20is%20deprecated%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82012%22%20slang%3D%22en-US%22%3E%3CP%3EWe've%20been%20using%20a%20few%20simple%20web%20service%20calls%20like%20this%20for%20years%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmytenant.sharepoint.com%2F_api%2Fsearch%2Fquery%3Fquerytext%3D%2527(*)%2BAND%2B(FileExtension%3Adoc%2BOR%2BFileExtension%3Adocx%2BOR%2BFileExtension%3Appt%2BOR%2BFileExtension%3Apptx%2BOR%2BFileExtension%3Axls%2BOR%2BFileExtension%3Axlsx%2BOR%2BFileExtension%3Axlsm%2BOR%2BFileExtension%3Apdf)%2527%26amp%3BSelectProperties%3D%2527Title%2CFileExtension%2CPath%2CParentLink%2CLastModifiedTime%2CServerRedirectedURL%2CSPWebUrl%2CSiteTitle%2527%26amp%3Bclienttype%3D%2527ContentSearchRegular%2527%26amp%3Bproperties%3D%2527GraphQuery%3AACTOR(ME%5C%2Caction%5C%3A1003)%2CGraphRankingModel%3A%7B%2522features%2522%5C%3A%5B%7B%2522function%2522%5C%3A%2522EdgeTime%2522%7D%5D%7D%2527%26amp%3Brankingmodelid%3D%25270c77ded8-c3ef-466d-929d-905670ea1d72%2527%26amp%3Browlimit%3D10%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmytenant.sharepoint.com%2F_api%2Fsearch%2Fquery%3Fquerytext%3D%2527(*)%2BAND%2B(FileExtension%3Adoc%2BOR%2BFileExtension%3Adocx%2BOR%2BFileExtension%3Appt%2BOR%2BFileExtension%3Apptx%2BOR%2BFileExtension%3Axls%2BOR%2BFileExtension%3Axlsx%2BOR%2BFileExtension%3Axlsm%2BOR%2BFileExtension%3Apdf)%2527%26amp%3BSelectProperties%3D%2527Title%2CFileExtension%2CPath%2CParentLink%2CLastModifiedTime%2CServerRedirectedURL%2CSPWebUrl%2CSiteTitle%2527%26amp%3Bclienttype%3D%2527ContentSearchRegular%2527%26amp%3Bproperties%3D%2527GraphQuery%3AACTOR(ME%5C%2Caction%5C%3A1003)%2CGraphRankingModel%3A%7B%2522features%2522%5C%3A%5B%7B%2522function%2522%5C%3A%2522EdgeTime%2522%7D%5D%7D%2527%26amp%3Brankingmodelid%3D%25270c77ded8-c3ef-466d-929d-905670ea1d72%2527%26amp%3Browlimit%3D10%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20now%20it%20is%20no%20longer%20working%2C%20error%20message%20I%20get%20is%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%26lt%3Bm%3Aerror%20xmlns%3Am%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fado%2F2007%2F08%2Fdataservices%2Fmetadata%22%26gt%3B%0A%26lt%3Bm%3Acode%26gt%3B%0A-1%2C%20Microsoft.Office.Server.Search.REST.SearchServiceException%0A%26lt%3B%2Fm%3Acode%26gt%3B%0A%26lt%3Bm%3Amessage%20xml%3Alang%3D%22en-US%22%26gt%3BSPO%20graph%20API%20is%20deprecated.%26lt%3B%2Fm%3Amessage%26gt%3B%0A%26lt%3B%2Fm%3Aerror%26gt%3B%3C%2FPRE%3E%3CP%3EHow%20do%20I%20now%20call%20this%20type%20of%20WS%20from%20SharePoint%20Online%3F%20%26nbsp%3BWhich%20endpoint%20should%20we%20be%20using%20instead%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-82012%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82299%22%20slang%3D%22en-US%22%3ERe%3A%20SPO%20graph%20API%20is%20deprecated%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82299%22%20slang%3D%22en-US%22%3EMS%20Graph%20can%20be%20called%20from%20SPO%20page%2C%20but%20as%20you%20say%2C%20it%20has%20some%20Authorization%20implications.%3CBR%20%2F%3EWhen%20working%20with%20the%20new%20spfx%20framework%2C%20and%20since%20some%20weeks%20ago%2C%20there's%20a%20HttpGraphClient%20to%20call%20MS%20Graph%20inside%20an%20spfx%20webpart%20without%20dealing%20with%20Auth.%3CBR%20%2F%3EWith%20classic%20pages%2C%20is%20a%20bit%20more%20complicated%2C%20but%20you%20can%20use%20the%20same%20service%20that%20is%20using%20the%20HttpGraphClient%20to%20get%20a%20token%2C%20and%20then%20call%20the%20MS%20Graph%20API%2C%20as%20it's%20described%20in%20this%20article%3A%20%3CA%20href%3D%22http%3A%2F%2Fwww.vrdmn.com%2F2017%2F06%2Faccess-microsoft-graph-from-classic.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.vrdmn.com%2F2017%2F06%2Faccess-microsoft-graph-from-classic.html%3C%2FA%3E%3CBR%20%2F%3EHowever%2C%20all%20of%20this%20is%20still%20in%20Preview%2C%20so%20it's%20only%20available%20in%20Tenants%20with%20the%20Preview%20feature%20enable.%20Also%2C%20I'm%20not%20sure%20if%20all%20the%20current%20Office%20Graph%20queries%20are%20available%20with%20MS%20Graph%20API...%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82296%22%20slang%3D%22en-US%22%3ERe%3A%20SPO%20graph%20API%20is%20deprecated%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82296%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20could%20use%20the%20graph%20explorer%20to%20create%20your%20query..%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fgraph-explorer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fgraph-explorer%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82069%22%20slang%3D%22en-US%22%3ERe%3A%20SPO%20graph%20API%20is%20deprecated%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82069%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F637%22%20target%3D%22_blank%22%3E%40Brent%20Ellis%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20don't%20think%20that%20this%20is%20the%20case.%3C%2FP%3E%3CUL%3E%3CLI%3EBy%20June%2019%2C%202017%2C%20the%20APIs%20stop%20working%20%3CSTRONG%3Ewithout%20the%20parameter.%3C%2FSTRONG%3E%3C%2FLI%3E%3CLI%3EThe%20APIs%20stop%20working%3CSTRONG%3E%20completely%3C%2FSTRONG%3E%20on%20August%2031%2C%202017.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EWith%20APIs%2C%20I%20think%2C%20the%20article%20is%20referring%20to%20the%20search%20APIs.%20The%20Graph%20APIs%20remain%20available.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20must%20agree%20the%20document%20isn't%20very%20clear.%3C%2FP%3E%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82066%22%20slang%3D%22en-US%22%3ERe%3A%20SPO%20graph%20API%20is%20deprecated%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82066%22%20slang%3D%22en-US%22%3ESo%20that%20will%20get%20me%20working%20again%20till%208%2F31%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20the%20same%20thing%20remains%2C%20is%20it%20physically%20impossible%20to%20query%20the%20Graph%20API%20directly%20from%20SharePoint%20Online%20(as%20current%20logged%20in%20user)%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82040%22%20slang%3D%22en-US%22%3ERe%3A%20SPO%20graph%20API%20is%20deprecated%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82040%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F637%22%20target%3D%22_blank%22%3E%40Brent%20Ellis%3C%2FA%3E%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20article%20might%20help%20a%20bit%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Foffice%2Foffice365%2Fhowto%2Fquery-office-graph-using-gql-with-search-rest-api%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Foffice%2Foffice365%2Fhowto%2Fquery-office-graph-using-gql-with-search-rest-api%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82028%22%20slang%3D%22en-US%22%3ERe%3A%20SPO%20graph%20API%20is%20deprecated%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82028%22%20slang%3D%22en-US%22%3EYes%2C%20problem%20is%20I%20dont%20have%20developer%20resources%20to%20do%20this.%20This%20is%20just%20a%20simple%20script%20in%20SharePoint%20Online%20page%2C%20what%20I%20am%20seeing%20is%20that%20I%20now%20is%20I%20am%20unable%20to%20do%20these%20simple%20things%20directly%20from%20SharePoint%20Online%20page%3F%3CBR%20%2F%3E%3CBR%20%2F%3EGraph%20can't%20be%20called%20from%20SPO%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82022%22%20slang%3D%22en-US%22%3ERe%3A%20SPO%20graph%20API%20is%20deprecated%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82022%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20this%20not%20due%20to%20new%20graph%20api%20microsoft%20graph%20instead%20of%20office%20graph%3C%2FP%3E%3C%2FLINGO-BODY%3E
Valued Contributor

We've been using a few simple web service calls like this for years:

 

https://mytenant.sharepoint.com/_api/search/query?querytext=%27(*)+AND+(FileExtension:doc+OR+FileExt...

 

But now it is no longer working, error message I get is as follows:

 

<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>

How do I now call this type of WS from SharePoint Online?  Which endpoint should we be using instead?

7 Replies
Highlighted

Is this not due to new graph api microsoft graph instead of office graph

Highlighted
Yes, problem is I dont have developer resources to do this. This is just a simple script in SharePoint Online page, what I am seeing is that I now is I am unable to do these simple things directly from SharePoint Online page?

Graph can't be called from SPO?
Highlighted
So that will get me working again till 8/31

But the same thing remains, is it physically impossible to query the Graph API directly from SharePoint Online (as current logged in user)?
Highlighted

 

Hi @Brent Ellis

I don't think that this is the case.

  • By June 19, 2017, the APIs stop working without the parameter.
  • The APIs stop working completely on August 31, 2017.

With APIs, I think, the article is referring to the search APIs. The Graph APIs remain available.

 

I must agree the document isn't very clear.

 

Highlighted

You could use the graph explorer to create your query.. 

https://developer.microsoft.com/en-us/graph/graph-explorer

 

Highlighted
MS Graph can be called from SPO page, but as you say, it has some Authorization implications.
When working with the new spfx framework, and since some weeks ago, there's a HttpGraphClient to call MS Graph inside an spfx webpart without dealing with Auth.
With classic pages, is a bit more complicated, but you can use the same service that is using the HttpGraphClient to get a token, and then call the MS Graph API, as it's described in this article: http://www.vrdmn.com/2017/06/access-microsoft-graph-from-classic.html
However, all of this is still in Preview, so it's only available in Tenants with the Preview feature enable. Also, I'm not sure if all the current Office Graph queries are available with MS Graph API...