Skip to content

Commit f9c253f

Browse files
authored
Merge pull request #9792 from rykoma/patch-12
Update examples and response sections in documentation
2 parents 8ee4bf2 + 347b135 commit f9c253f

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

api-reference/v1.0/api/driveitem-list-thumbnails.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ This is currently only supported on OneDrive Personal.
6868

6969
If successful, this method returns a `200 OK` response code and collection of [ThumbnailSet](../resources/thumbnailset.md) objects in the response body.
7070

71-
## Example
71+
## Examples
72+
73+
### Example 1: Retrieve available thumbnails for an item in the current user's OneDrive
74+
75+
#### Request
7276

7377
The following example shows a request which retrieves available thumbnails for an item in the current user's OneDrive.
7478

@@ -117,7 +121,7 @@ Any item in a drive can have zero or more thumbnails.
117121
For example, `/thumbnails?select=medium` retrieves only the medium sized thumbnails.
118122

119123

120-
### Response
124+
#### Response
121125

122126
<!-- { "blockType": "response", "@odata.type": "Collection(microsoft.graph.thumbnailSet)" } -->
123127

@@ -137,11 +141,11 @@ Content-type: application/json
137141
}
138142
```
139143

140-
## Get a single thumbnail
144+
### Example 2: Get a single thumbnail
141145

142146
Retrieve the metadata for a single thumbnail and size by addressing it directly in a request.
143147

144-
### HTTP request
148+
#### Request
145149

146150

147151
# [HTTP](#tab/http)
@@ -181,14 +185,15 @@ GET /me/drive/items/{item-id}/thumbnails/{thumb-id}/{size}
181185

182186
---
183187

184-
### Path parameters
188+
##### Path parameters
185189

186190
| Name | Type | Description |
187191
|:-------------|:-------|:-----------------------------------------------------------------------------------------|
188192
| **item-id** | string | The unique identifier for the item referenced. |
189193
| **thumb-id** | number | The index of the thumbnail, usually 0-4. If there is a custom thumbnail, its index is 0. |
190194
| **size** | string | The size of the thumbnail requested. This can be one of the standard sizes listed below or a custom size. |
191195

196+
#### Response#
192197
<!-- { "blockType": "response", "@odata.type": "microsoft.graph.thumbnail" } -->
193198

194199
```http
@@ -202,11 +207,11 @@ Content-Type: application/json
202207
}
203208
```
204209

205-
## Retrieve thumbnail binary content
210+
### Example 3: Retrieve thumbnail binary content
206211

207212
You can directly retrieve the content of the thumbnail by requesting the **content** property of the thumbnail.
208213

209-
### HTTP request
214+
#### Request
210215

211216

212217
# [HTTP](#tab/http)
@@ -246,7 +251,7 @@ GET /me/drive/items/{item-id}/thumbnails/{thumb-id}/{size}/content
246251

247252
---
248253

249-
### Response
254+
#### Response
250255

251256
The service responds with a redirect to the thumbnail URL.
252257

@@ -260,12 +265,12 @@ Location: https://b0mpua-by3301.files.1drv.com/y23vmagahszhxzlcvhasdhasghasodfi
260265
Thumbnail URLs are cache-safe. The URL will change, if the item changes in a way that requires a new thumbnail to be generated.
261266

262267

263-
## Getting thumbnails while listing DriveItems
268+
### Example 4: Getting thumbnails while listing DriveItems
264269

265270
If you are retrieving a list of DriveItem resources to display, you can use the _$expand_ query string parameter to also include the thumbnails for those resources.
266271
This enables your app to retrieve thumbnails and items in a single request, instead of issuing many requests.
267272

268-
### HTTP request
273+
#### Request
269274

270275

271276
# [HTTP](#tab/http)
@@ -305,7 +310,7 @@ GET /me/drive/items/{item-id}/children?$expand=thumbnails
305310

306311
---
307312

308-
### Response
313+
#### Response
309314

310315
The service responses with the list of DriveItems and their thumbnails.
311316

@@ -345,8 +350,6 @@ Content-type: application/json
345350
}
346351
```
347352

348-
## Size options
349-
350353
This table defines the possible thumbnail sizes.
351354
While you can request any arbitrary thumbnail size, the defined values are likely to exist and return a value quickly:
352355

@@ -359,11 +362,12 @@ While you can request any arbitrary thumbnail size, the defined values are likel
359362
| `mediumSquare` | 176x176 | Square Crop | Small square thumbnail |
360363
| `largeSquare` | 800x800 | Square Crop | Large square thumbnail |
361364

362-
## Requesting custom thumbnail sizes
365+
### Example 5: Requesting custom thumbnail sizes
363366

364367
In addition to the defined sizes, your app can request a custom thumbnail size by specifying the dimensions of the thumbnail prefixed with `c`.
365368
For example if your app needs thumbnails that are 300x400, it can request that size like this:
366369

370+
#### Request
367371

368372
# [HTTP](#tab/http)
369373
<!-- { "blockType": "request", "name": "get-thumbnail-custom-size", "scopes": "files.read", "tags": "service.graph" } -->
@@ -402,6 +406,8 @@ GET /me/drive/items/{item-id}/thumbnails?select=c300x400_crop
402406

403407
---
404408

409+
#### Response
410+
405411
Which responds with just the custom thumbnail size selected:
406412

407413
<!-- { "blockType": "response", "@odata.type": "Collection(microsoft.graph.thumbnailSet)" } -->
@@ -445,8 +451,7 @@ Thumbnails are not supported on SharePoint Server 2016.
445451

446452
### Error responses
447453

448-
See [Error Responses][error-response] for more info about
449-
how errors are returned.
454+
See [Error Responses][error-response] for more info about how errors are returned.
450455

451456
[error-response]: /graph/errors
452457

0 commit comments

Comments
 (0)