I am successfully returning search results from a user's OneDrive for Business account using the https://graph.microsoft.com/v1.0/me/drive/root/microsoft.graph.search endpoint.
I am using those results in a federated search within our application and would like to use the api to render thumbnails for each item when available.
I have an access token for the https://graph.microsoft.com resource and everything is working well except thumbnails.
I am able to get the thumbnail collection data back, for example:
[small] => Array(
[height] => 350
[width] => 266
[url] => https: //xxxxxxxxxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxx_onmicrosoft_com/_api/v2.0/drive/items/{item id}/thumbnails/0/small/thumbnailContent )
Any attempts to access that thumbnailContent url either directly in an img tag or via curl return errors. For the curl, I am supplying the access token in the header.
I receive error information like:
HTTP/1.1 403
X-MSDAVEXT_Error: 917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.
{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":"Access denied. You do not have permission to perform this action or access this resource."}}
Any help would be appreciated in solving what is required here.
I have read I may need a sharepoint token instead of a graph token. If that is the case, I can't seem to figure out how to get the resource id I need to request the necessary sharepoint token.
Thank you.