In our project we're trying to integrate with SharePoint Online using SharePoint App-Only authentication method and client-side object model (CSOM) to retrieve data. This solution seems to be working fine but the problems start when we're trying to get 'Thumbnail' image for the document. The default way of getting document data with CSOM never returns any thumbnail data. Instead, we've started using SharePoint's API method /_layouts/15/getpreview.ashx. By default, it doesn't return any thumbnail data when used with the same access token as we used for CSOM but when used in browser from the context of user that is logged in Sharepoint Online platform (i.e. authenticated via cookies) it works fine. From now on (after getting this specific thumbnail in a browser for the first time) it will also work from our integration (authenticated with bearer token).

Any ideas what can be the cause of this and how to fix it? Are there better ways to get thumbnail data from the document in SharePoint?

1 Answer 1



MS Graph API provides an endpoint that could request document thumbnail.

  • GET /me/drive/items/{item-id}/thumbnails

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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