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:
- Generate app token from https://login.microsoftonline.com/{tenantid}/oauth2/token
- 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"
}
}
}
- Generate user token
- GET: https://graph.microsoft.com/v1.0/drives/{driveid}/items/{itemid}/thumbnails/ using the user token. This gives a valid response.
- GET: https://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? :)