question

ChandaniPrajapati-7959 avatar image
0 Votes"
ChandaniPrajapati-7959 asked ZehuiYaoMSFT-7151 edited

Follow and unfollow sites using REST and Graph API - Strange behaviour

I am using Graph API to follow/unfollow sites for SPFx. But while calling API, I am always getting a successful response but when I check it in particular SharePoint site, It does not reflect the update. Also tried the same thing using REST API but unfortunately, got the same issue.

http://domain.sharepoint.com/_layouts/15/sharepoint.aspx?v=following

e.g. When I am using followedSites endpoint, I am getting 10 followed sites but after following/unfollowing any sites I am getting an updated response in followedSites. while I am checking the particular SharePoint site, it's not reflecting updates over there.

Graph API

I am using the below endpoints,
followedSites - to get all followed sites,
followedSites/add - to follow site
followedSites/remove - to unfollow site


193350-image.png
193369-image.png

REST API


Using below ednpoints,
/_api/social.following/follow - to follow
/_api/social.following/stopfollowing - to stop follow
/_api/social.following/isfollowed - to check is followed or not so based on this can follow/unfollow


193394-image.png
193418-image.png
193419-image.png

Is it default behavior or I am missing something?



microsoft-graph-general
image.png (46.9 KiB)
image.png (47.4 KiB)
image.png (4.0 KiB)
image.png (50.6 KiB)
image.png (79.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ShivaniRai-MSFT-7217 avatar image
0 Votes"
ShivaniRai-MSFT-7217 answered

Hi @ChandaniPrajapati-7959,

As per my testing using Graph API, I found out that it takes couple of minutes to get reflected in SharePoint site UI after making Graph call to follow site. You can verify the same at your end.

If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.