Forum Discussion
SharePoint Online: Following and Graph API issues
We are working on the feature that collects information about sites followed by users in SharePoint Online. While digging dipper, we found out few issues connected with “follow” functionality.
We have:
- SharePoint site: https://contoso.sharepoint.com/sites/test,
- User added to the Visitors group on the site (mailto:test@contoso.sharepoint.com),
- Graph API v1.0,
- Graph explorer (https://developer.microsoft.com/en-us/graph/graph-explorer) with test user logged in,
- MS Graph Postman collection copied and configured according to official documentation: https://docs.microsoft.com/en-us/graph/use-postman?context=graph%2Fapi%2F1.0&view=graph-rest-1.0
Issues we noticed:
1.
As logged test user on the https://contoso.sharepoint.com/sites/test site, when I click “follow” action at the right top corner for the very first time everything works fine and I can see that both:
- on the site:
https://contoso.sharepoint.com/_layouts/15/sharepoint.aspx test site is listed and marked as followed, - using Graph explorer endpoint:
https://graph.microsoft.com/v1.0/me/followedSites test site is listed.
Things complicate when we are trying to unfollow site. Then on the SharePoint we have information that site is unfollowed, but both on the /_layouts/15/sharepoint.aspx Site and Graph Explorer we still have information that site is followed. Even worst – we can see that on the /_layouts/15/sharepoint.aspx site there are listed sites that were followed but fully deleted from SharePoint (removed after 93 days from sites recycle bin).
All requests were completed successfully with no errors in the network and browser developer console. We waited one day to give time for synchronization, but with no result.
2.
We used Graph API endpoint to add site to the followed:
/users/{user-id}/followedSites/add
Due to description in the MS Graph API documentation:
https://docs.microsoft.com/en-us/graph/api/site-follow?view=graph-rest-1.0&tabs=http
In this case we also can see on the /_layouts/15/sharepoint.aspx site and Graph API endpoint (https://graph.microsoft.com/v1.0/me/followedSites) that site is followed, but on the SharePoint /sites/test there is information that site is unfollowed.
Here we also waited one day to give time for synchronization, but with no result.
3.
According to the MS Graph API documentation:
https://docs.microsoft.com/en-us/graph/api/sites-list-followed?view=graph-rest-1.0&tabs=http
There is possibility to get user’s list of followed sites (using application permissions). But calling /users/{user-id}/followedSites endpoint gives "General exception while processing” error for a lot of users (not for all). On the other side calling /me/followedSites returns appropriate data when we are logged as those users (for which we have error using application permissions) in the Graph API Explorer.
How to resolve those problems?