How to get a single custom sized thumbnail binary? #2686
-
I'm migrating from SDK 4 to SDK 5 and ran into the issue that I cannot find how to convert this code: return await myDriveItemRequestBuilder
.Thumbnails["0"]["c256x256"]
.Content
.Request()
.GetAsync(cancellationToken); Which generates a URI like:
I've managed to get to return await myDriveItemRequestBuilder
.Thumbnails["0"]
.GetAsync(request => request.QueryParameters.Select = ["c256x256"], cancellationToken); However this generates a "wrong" URI for the thumbnail, which isn't suitable for getting the binary data AFAICS. It generates OData select, and it seemingly cannot be made to download content. Both get a single thumbnail and retrieve thumbnail binary content have no documentation that pertains to the C# SDK. It says:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Thanks for raising this @Ghostbird This is a issue with the metadata used to generate the SDK. In the meantime you can work around this with a code sample like below. var thumbnailContent = graphClient.Drives["drive-id"].Items["item-id"].Content.WithUrl("https://graph.microsoft.com/me/drive/items/{item-id}/thumbnails/{thumb-id}/{size}/content").GetAsync(); |
Beta Was this translation helpful? Give feedback.
Thanks for raising this @Ghostbird
This is a issue with the metadata used to generate the SDK. In the meantime you can work around this with a code sample like below.