Forum Discussion
Following O365 Sites API
Ref this post :
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:
This seems to give me the needed data but I guess this is not a documented approach? Is there any other option?
- Brent EllisSilver 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 AnderssonBrass Contributor
Thanks. I think we go for the same option for now. :-) Nice finding!
- Sigi Van GinhovenCopper Contributor
Brent Ellis and Örjan Andersson what a great solution! I'm looking for some time for this one.
Is there a (small) chance to get the code for this webpart you use?
Thanks,
Sigi
- Örjan AnderssonBrass 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 RiestererCopper 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?