Forum Discussion

Örjan Andersson's avatar
Örjan Andersson
Brass Contributor
Feb 10, 2017

Following O365 Sites API

Ref this post :

https://techcommunity.microsoft.com/t5/Office-365-Groups/Following-O365-Group-Sites-excluded-in-API/td-p/28494.

 

 

I have the same need for an API endpoint to retrieve all sites i'm following regardless of classic vs o365 group site. The existing API : https://mytenant.sharepoint.com/_api/social.following/my/followed(types=14) does not return any O365 Group Sites.

 

The post refers to a solution to make use of an existing http handler:

https://mytenant.sharepoint.com/_vti_bin/homeapi.ashx/sites/followed?mostRecentFirst=true&start=0&count=100&fillSiteData=true

 

This seems to give me the needed data but I guess this is not a documented approach? Is there any other option?

  • Brent Ellis's avatar
    Brent Ellis
    Silver Contributor

    We made the same modification and shifted to using this url, like you mentioned, not really formally documented, but there is a ton that isnt.  This was the best (only?) option we were able to find.

     

    url : _spPageContextInfo.webAbsoluteUrl + "/_vti_bin/homeapi.ashx/sites/followed?mostRecentFirst=true&start=0&count=100&fillSiteData=true",

     

    We created a web part for our intranet homepage that shows these sites

     

      • Örjan Andersson's avatar
        Örjan Andersson
        Brass Contributor

        I can send you the React Component + "service" that returns the "followed sites". The React component refers to other libraries so not very easy to send full working code. My implementation just display a list and is not that fancy as Brent Ellis implementation for filtering and paging. That was not required for me :-) See example below.

         

         

         

    • Mirko Riesterer's avatar
      Mirko Riesterer
      Copper Contributor

      Is there any option that can be passed in the url to text-filter the results?

      I ask, because your screenshot shows a search box.

      Or are you filtering the results after the api response?

Share