Forum Discussion
Levi Johnson
Apr 30, 2018Brass Contributor
Sharepoint Search and .tif files - need help with better image preview
Hello, Hoping to find some guidance here. I'm trying to do some customizations to my search page (trying to make a photo search much like that most photo library sites, where it just lays out previe...
Deleted
Jan 10, 2019It seems that these thumbnails are dynamically generated with access tokens that expire, so a static link in the search results won't be possible now until the new customizations for Microsoft Search are available.
In the meantime, using JS and the Graph API you can get the thumbnail URLs:
- Open the https://developer.microsoft.com/en-us/graph/graph-explorer site to check your REST call syntax.
- Call https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/anothersitecollection:/drives to get the document libraries as drives and save the ID of the document library you need. Substitute your SharePoint tenant for "contoso" and your site collection URL component for "anothersitecollection".
- Call https://graph.microsoft.com/v1.0/drives/b!aXYZmss8ZEiVokyC-JytN274MKTABCdAqaqixLW2-0JqtL9COCftQr9Ct9neeDKJ/root/children to get the documents in the document library. Substitute your long drive ID for the example.
- Call https://graph.microsoft.com/v1.0/drives/b!aXYZmss8ZEiVokyC-JytN274MKTABCdAqaqixLW2-0JqtL9COCftQr9Ct9neeDKJ/items/01EQBDECC66F3P3O5YI5ABCIGG7O6M4Q23/thumbnails to get the thumbnail URLs. Substitute your long document ID for the example.
From my blog post: http://blog.larslynch.com/2019/01/3d-and-other-thumbnails-in-sharepoint.html