2

I'm planning to make a custom web part that using the users articles/pages that they have "saved for later". However, I have no clue to WHERE to get this information, or where its stored.

The "save for later" can be found on the social bar. enter image description here

2

"Save for later" Favorites are added and read via an undocumented API and thus not recommended for production.

If you go to F12 Dev tools you might discover calls similar to these:

https://TENANT_REGION-sphomep.svc.ms/api/v1/documents/saveForLater?start=0&count=20

You can get the URL of the endpoint for your region and the token by calling /_api/sphomeservice/context?$expand=Token from a SharePoint page.

enter image description here

After you have a token, endpoint URL and and your absolute site URL, you need to add two headers to all your GET calls:

headers: {
'authorization': `Bearer ${token}`,
'sphome-apicontext': `{"PortalUrl":"${this.props.context.pageContext.site.absoluteUrl}"}`
}

Send your GET request to https://REGION-sphomep.svc.ms/api/v1/documents/saveForLater?start=0&count=20

Update

Adding "Save for later": requres a GET call to /api/v1/documents/saveForLater/addwith these URL params: siteId, webId, listId, uniqueId

https://REGION-sphomep.svc.ms/api/v1/documents/saveForLater/add?siteId=765d4b61-1bc6-42b7-9667-94c343fbf859&webId=93e10f19-d8b4-491e-90d8-c3e766fbe497&listId=0ba06207-75ff-4aa9-87c7-f859dec39bcc&uniqueId=70e6835b-5ee0-4581-bb73-0c2ed3c43044

Removing "Save for later": requres a GET call to /api/v1/documents/saveForLater/remove with these URL params: siteId, webId, listId, uniqueId Removing "Save For later": (siteId, webId, listId, uniqueId)

https://REGION-sphomep.svc.ms/api/v1/documents/saveForLater/remove?siteId=765d4b61-1bc6-42b7-9667-94c343fbf859&webId=93e10f19-d8b4-491e-90d8-c3e766fbe497&listId=0ba06207-75ff-4aa9-87c7-f859dec39bcc&uniqueId=70e6835b-5ee0-4581-bb73-0c2ed3c43044

  • Thank you! Do you know if its possible to do a POST? Like a custom "bookmark" button that puts a article to the "save for later" page? – Arte2 Apr 17 at 15:49
  • 1
    Updated the answer. I think, there is only GET calls for adding/removing "save for later" items. – Denis Molodtsov Apr 17 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.