1

I am looking at the Modern experience in documents and lists, and specifically the tiles view option.

I can see that the tile preview img tag src attribute for each of the tiles points to the following url:

<img class="od-ImageTile-image" src="https://australiasoutheast1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat=png&cs=fFNQTw&docid=https%3A%2F%2Fmytenant.sharepoint.com%3A443%2F_api%2Fv2.0%2Fdrives%2Fb!QTd0bWaqp0m9xt6dA0TZpPKwJE7AaWJPnQIO7sEpJGXSgX2dXgwXR4orEx4jtBgl%2Fitems%2F013366R3CR7MYYFKOSE5EZRQFVHK452X7P%3Fversion%3DPublished&access_token=...&encodeFailures=1&width=172&height=172&srcWidth=&srcHeight=&cropMode=dochead" style="left: 0%; top: 0%; width: 100%;">

Does anyone know if it is possible to call this “service” https://australiasoutheast1-mediap.svc.ms/transform/thumbnail from your own code?

I would love to be able to use this service to generate previews of content in a similar way that the OOTB “tiles” view is doing.

Is there any documentation or other guidance around this?

Thanks in advance

3

You can make use of the built-in getpreview.ashx handler to generate thumbnails for your document as well as images.

So, for example, if you have uploaded an image in the Images library named test.jpg, then your file path would be something like:

https://tenant.sharepoint.com/sites/test/Images/test.jpg

To get the image preview, you can use the below url:

https://tenant.sharepoint.com/sites/test/_layouts/15/getpreview.ashx?
path=https://tenant.sharepoint.com/sites/test/Images/test.jpg

The same will work for Office documents as well.

Related reading -

Generate thumbnail of a document stored in SharePoint from its URL

Image Renditions available in Modern Team Sites

0

The following works for files stored in SharePoint Online document libraries using the Graph API to retrieve the thumbnail URLs:

  1. Open the Microsoft Graph Explorer site to check your REST call syntax.
  2. 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".

  3. 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.

  4. 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

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.