Home

Error getting thumbnails with app token, works after calling once with user token

Rens Braspenning
Occasional Contributor

I'm trying to get thumbnails for new documents in SP online using an app token. This always fails at first. But when calling it once with a user token, it works with the app token. It seems like the graph api only generates the thumbnail when a request is received with a user token.

 

Steps to reproduce:

  1. Generate app token from https://login.microsoftonline.com/{tenantid}/oauth2/token
  2. GET: https://graph.microsoft.com/v1.0/drives/{driveid}/items/{itemid}/thumbnails/. This gives the following response: 
    {
    "error": {
    "code": "UnknownError",
    "message": "",
    "innerError": {
    "request-id": "640819f7-8a64-4e58-bed1-44aeef214859",
    "date": "2018-01-30T10:27:58"
    }
    }
    }
  3. Generate user token
  4. GEThttps://graph.microsoft.com/v1.0/drives/{driveid}/items/{itemid}/thumbnails/ using the user token. This gives a valid response.
  5. GEThttps://graph.microsoft.com/v1.0/drives/{driveid}/items/{itemid}/thumbnails/ using the app token from step 1. Now the response is also valid.

I hope this is not by design? :)

 

Related Conversations
Extentions Synchronization
Deleted in Discussions on
3 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
38 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies