Skip to content

Commit debfafd

Browse files
authored
Merge pull request #28218 from microsoftgraph/main
Merge to publish.
2 parents 05f8d0a + ad20c40 commit debfafd

File tree

6 files changed

+104
-34
lines changed

6 files changed

+104
-34
lines changed

api-reference/beta/api/restorepoint-search.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,13 @@ Content-Type: application/json
217217
218218
{
219219
"artifactQuery": {
220-
"queryExpression": "(Sender -like 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '2024-09-21T08:20:00.0000000Z')",
220+
"queryExpression": "(Sender -like 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true')",
221221
"artifactType": "message"
222222
},
223223
"protectionUnitIds": ["23014d8c-71fe-4d00-a01a-31850bc5b42a"],
224224
"protectionTimePeriod": {
225-
"startDateTime": "2021-01-01T00:00:00Z"
225+
"startDateTime": "2021-01-01T00:00:00Z",
226+
"endDateTime": "2021-01-30T00:00:00Z"
226227
},
227228
"restorePointPreference": "oldest"
228229
}

api-reference/beta/resources/artifactquery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17-
Contains an expression that specifies the criteria for search.
17+
Contains an expression that specifies the criteria for search. For more information, see [Filtering mailbox artifacts with granular search queries](/graph/concepts/backup-restore-granular-search.md).
1818

1919
## Properties
2020
|Property|Type|Description|

api-reference/v1.0/api/driveitem-createlink.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The request should be a JSON object with the following properties.
5656
| Name | Type | Description |
5757
| :------------| :----- | :--------------------------------------------------------------------------- |
5858
| **type** | string | The type of sharing link to create. Either `view`, `edit`, or `embed`. |
59-
| **password** | string | The password of the sharing link that is set by the creator. Optional and OneDrive Personal only.
59+
| **password** | string | The password of the sharing link set by the creator. Optional and OneDrive Personal only.
6060
| **expirationDateTime** | string | A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates the expiration time of the permission. |
6161
| **retainInheritedPermissions** | Boolean | Optional. If `true` (default), any existing inherited permissions are retained on the shared item when sharing this item for the first time. If `false`, all existing permissions are removed when sharing for the first time. |
6262
| **scope** | string | Optional. The scope of link to create. Either `anonymous`, `organization`, or `users`. |
@@ -74,11 +74,11 @@ The following values are allowed for the **type** parameter.
7474
### Scope types
7575

7676
The following values are allowed for the **scope** parameter.
77-
If the **scope** parameter is not specified, the default link type for the organization is created.
77+
If the **scope** parameter isn't specified, the default link type for the organization is created.
7878

7979
| Value | Description
8080
|:---------------|:------------------------------------------------------------
81-
| `anonymous` | Anyone with the link has access, without needing to sign in. This may include people outside of your organization. Anonymous link support may be disabled by an administrator.
81+
| `anonymous` | Anyone with the link has access, without needing to sign in. It may include people outside of your organization. Anonymous link support may be disabled by an administrator.
8282
| `organization` | Anyone signed into your organization (tenant) can use the link to get access. Only available in OneDrive for Business and SharePoint.
8383
| `users` | Share only with people you choose inside or outside the organization.
8484

@@ -87,15 +87,17 @@ If the **scope** parameter is not specified, the default link type for the organ
8787

8888
If successful, this method returns a single [Permission](../resources/permission.md) resource in the response body that represents the requested sharing permissions.
8989

90-
The response will be `201 Created` if a new sharing link is created for the item or `200 OK` if an existing link is returned.
90+
The response is `201 Created` if a new sharing link is created for the item or `200 OK` if an existing link is returned.
9191

92-
## Example
92+
## Examples
9393

94-
The following example requests a sharing link to be created for the DriveItem specified by {itemId} in the user's OneDrive.
94+
### Example 1: Creating sharable links
95+
96+
The following example requests a sharing link to be created for the DriveItem specified by {item-id} in the user's OneDrive.
9597
The sharing link is configured to be read-only and usable by anyone with the link.
9698
All existing permissions are removed when sharing for the first time if `retainInheritedPermissions` is false.
9799

98-
### Request
100+
#### Request
99101

100102

101103
# [HTTP](#tab/http)
@@ -146,7 +148,7 @@ Content-type: application/json
146148

147149
---
148150

149-
### Response
151+
#### Response
150152

151153
<!-- { "blockType": "response", "@odata.type": "microsoft.graph.permission" } -->
152154

@@ -170,13 +172,13 @@ Content-Type: application/json
170172
}
171173
```
172174

173-
## Creating company sharable links
175+
### Example 2: Creating company sharable links
174176

175177
OneDrive for Business and SharePoint support company sharable links.
176-
These are similar to anonymous links, except they only work for members of the owning organization.
178+
They are similar to anonymous links, except they only work for members of the owning organization.
177179
To create a company sharable link, use the **scope** parameter with a value of `organization`.
178180

179-
### Request
181+
#### Request
180182

181183

182184
# [HTTP](#tab/http)
@@ -222,7 +224,7 @@ Content-Type: application/json
222224

223225
---
224226

225-
### Response
227+
#### Response
226228

227229
<!-- { "blockType": "response", "@odata.type": "microsoft.graph.permission" } -->
228230

@@ -245,14 +247,14 @@ Content-Type: application/json
245247
}
246248
```
247249

248-
## Creating embeddable links
250+
### Example 3: Creating embeddable links
249251

250252
When using the `embed` link type, the webUrl returned can be embedded in an `<iframe>` HTML element.
251253
When an embed link is created the `webHtml` property contains the HTML code for an `<iframe>` to host the content.
252254

253255
**Note:** Embed links are only supported for OneDrive personal.
254256

255-
### Request
257+
#### Request
256258

257259

258260
# [HTTP](#tab/http)
@@ -297,7 +299,7 @@ Content-Type: application/json
297299

298300
---
299301

300-
### Response
302+
#### Response
301303

302304
<!-- { "blockType": "response", "@odata.type": "microsoft.graph.permission" } -->
303305

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: "Filtering mailbox artifacts with granular search queries"
3+
description: "Learn how to create granular search expressions to filter mailbox artifacts during backup and restore operations with Microsoft Graph APIs."
4+
author: "subham-rkb"
5+
ms.date: 02/04/2026
6+
ms.localizationpriority: medium
7+
ms.subservice: "m365-backup-storage"
8+
---
9+
10+
# Granular search queries for backup and restore APIs
11+
12+
Use granular search queries to filter and search for specific mailbox artifacts when using the Microsoft Graph backup and restore APIs. Granular search enables you to construct precise query expressions to find emails, calendar events, contacts, tasks, and notes based on various criteria such as sender, subject, participants, and attachments.
13+
14+
## Overview
15+
16+
The [artifactQuery](../api-reference/beta/resources/artifactquery.md) resource contains a `queryExpression` property that allows you to specify search criteria for mailbox artifacts. You can combine multiple properties using logical operators to create complex search expressions that filter restore points based on your specific requirements.
17+
18+
## Supported properties
19+
20+
The following table describes the properties you can use in query expressions.
21+
22+
| Property | Description | Value type | Supported operators | Wildcard support |
23+
|----------|-------------|------------|---------------------|------------------|
24+
| Subject | The subject of the message or primary searchable string for other item types | String | -like, -and (up to 3) | * (after string) |
25+
| Sender | Messages from the specified sender | Display name, Alias, SMTP address, or LegacyDN | -like | * (after string) |
26+
| Participants | Messages with specified recipient in To, Bcc, or Cc fields | Display name, Alias, SMTP address, or LegacyDN | -like, -and (up to 3) | * (after string) |
27+
| HasAttachment | Whether the message has an attachment | Boolean (true or false) | -eq | No |
28+
| MessageKind | The mailbox item type for which to search | Enum: Email, Note, Task, Contact, Calendar | -eq | No |
29+
30+
#### Examples
31+
32+
Search for emails from a specific sender with attachments
33+
34+
```
35+
(Sender -like 'abc@contoso.com') -and (HasAttachment -eq 'true')
36+
```
37+
38+
Search for emails with specific subject keywords and multiple participants
39+
40+
```
41+
(Subject -like 'Project Alpha*') -and (Participants -like 'john@contoso.com' -and Participants -like 'sarah@contoso.com')
42+
```
43+
44+
Search for calendar events organized by a specific user
45+
46+
```
47+
(MessageKind -eq 'Calendar') -and (Sender -like 'admin@contoso.com')
48+
```
49+
50+
Search for contacts by name pattern
51+
52+
```
53+
(MessageKind -eq 'Contact') -and (Subject -like 'Smith*')
54+
```
55+
56+
Search for emails combining multiple criteria including message type, subject, sender, and attachments
57+
58+
```
59+
(MessageKind -eq 'Email') -and (Subject -like 'Invoice*') -and (Sender -like 'vendor*') -and (HasAttachment -eq 'true')
60+
```

concepts/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ items:
350350
href: backup-storage-concept-overview.md
351351
- name: Managing information barriers for file storage containers
352352
href: information-barrier-for-file-storage-containers.md
353+
- name: Filtering mailbox artifacts with granular search queries
354+
href: backup-restore-granular-search.md
353355
- name: Error codes
354356
href: backup-storage-error-codes.md
355357
- name: Calendar

0 commit comments

Comments
 (0)