Skip to content

Commit c6eb9c4

Browse files
authored
Merge pull request #26324 from microsoftgraph/main
Merge main into live
2 parents 7d461de + 8661c7e commit c6eb9c4

23 files changed

+373
-226
lines changed

api-reference/beta/api/listitem-list.md

Lines changed: 78 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
author: spgraph-docs-team
33
description: "Get the collection of items in a list."
4-
title: Retrieve items from a SharePoint list
4+
title: "List items"
55
ms.localizationpriority: medium
66
ms.subservice: "sharepoint"
77
doc_type: apiPageType
88
ms.date: 04/05/2024
99
---
10-
# Enumerate items in a list
10+
11+
# List items
1112

1213
Namespace: microsoft.graph
1314

@@ -35,6 +36,19 @@ GET /sites/{site-id}/lists/{list-id}/items?expand=fields
3536
GET /sites/{site-id}/lists/{list-id}/items?expand=fields(select=Column1,Column2)
3637
```
3738

39+
## Optional query parameters
40+
41+
This method supports the `$filter` and `$expand` of the [OData query parameters](/graph/query-parameters) to help customize the response.
42+
43+
### Using the $filter query parameter
44+
45+
You can apply the `$filter` (`eq`, `ne`, `lt`, `gt`, `le`, `ge`, and `startswith`) query parameter to get a subset of the [listItem](../resources/listitem.md) collection. Both **listItem** properties and fields can be filtered. When filtering on indexed fields, the service can only filter one indexed field at a time.
46+
47+
> [!NOTE]
48+
> Filtering works best on indexed columns.
49+
50+
Depending on the number of items that match the filtering condition, the results are either be returned all at once or in multiple pages. For more information, see [Paging Microsoft Graph data in your app](/graph/paging).
51+
3852
## Request headers
3953

4054
| Name |Description|
@@ -49,54 +63,85 @@ Don't supply a request body for this method.
4963

5064
If successful, this method returns a `200 OK` response code and a collection of [listItem][item] objects in the response body.
5165

52-
## Example
66+
## Examples
5367

54-
### Request
68+
### Example 1: Get list items with specific fields
69+
70+
The following example shows how to get a **listItem** collection with specific fields using the `$expand` query parameter.
71+
72+
#### Request
5573

5674
The following example shows a request.
5775

58-
# [HTTP](#tab/http)
59-
<!-- { "blockType": "request", "name": "get-list-items" } -->
76+
<!-- {
77+
"blockType": "request",
78+
"name": "get-list-items",
79+
"sampleKeys": ["contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE", "243bca4b-4e5e-45af-b37d-25f6135a740d"]
80+
} -->
6081

6182
```msgraph-interactive
62-
GET https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items?expand=fields(select=Name,Color,Quantity)
83+
GET https://graph.microsoft.com/beta/sites/contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE/lists/243bca4b-4e5e-45af-b37d-25f6135a740d/items?expand=fields(select=Name,Color,Quantity)
6384
```
6485

65-
# [C#](#tab/csharp)
66-
[!INCLUDE [sample-code](../includes/snippets/csharp/get-list-items-csharp-snippets.md)]
67-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
86+
#### Response
6887

69-
# [CLI](#tab/cli)
70-
[!INCLUDE [sample-code](../includes/snippets/cli/get-list-items-cli-snippets.md)]
71-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
88+
The following example shows the response.
7289

73-
# [Go](#tab/go)
74-
[!INCLUDE [sample-code](../includes/snippets/go/get-list-items-go-snippets.md)]
75-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
90+
<!-- { "blockType": "response", "@odata.type": "Collection(microsoft.graph.listItem)", "truncated": true } -->
91+
92+
```http
93+
HTTP/1.1 200 OK
94+
Content-type: application/json
7695
77-
# [Java](#tab/java)
78-
[!INCLUDE [sample-code](../includes/snippets/java/get-list-items-java-snippets.md)]
79-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
96+
{
97+
"value": [
98+
{
99+
"id": "2",
100+
"fields": {
101+
"Name": "Gadget",
102+
"Color": "Red",
103+
"Quantity": 503
104+
}
105+
},
106+
{
107+
"id": "4",
108+
"fields": {
109+
"Name": "Widget",
110+
"Color": "Blue",
111+
"Quantity": 2357
112+
}
113+
},
114+
{
115+
"id": "7",
116+
"fields": {
117+
"Name": "Gizmo",
118+
"Color": "Green",
119+
"Quantity": 92
120+
}
121+
}
122+
]
123+
}
124+
```
80125

81-
# [JavaScript](#tab/javascript)
82-
[!INCLUDE [sample-code](../includes/snippets/javascript/get-list-items-javascript-snippets.md)]
83-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
126+
### Example 2: Get filtered list items with specific fields
84127

85-
# [PHP](#tab/php)
86-
[!INCLUDE [sample-code](../includes/snippets/php/get-list-items-php-snippets.md)]
87-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
128+
The following example shows how to get a **listItem** collection filtered by the **Quantity** field with specific fields using the `$expand` query parameter.
88129

89-
# [PowerShell](#tab/powershell)
90-
[!INCLUDE [sample-code](../includes/snippets/powershell/get-list-items-powershell-snippets.md)]
91-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
130+
#### Request
92131

93-
# [Python](#tab/python)
94-
[!INCLUDE [sample-code](../includes/snippets/python/get-list-items-python-snippets.md)]
95-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
132+
The following example shows a request.
96133

97-
---
134+
<!-- {
135+
"blockType": "request",
136+
"name": "get-list-items-with-filter",
137+
"scopes": "sites.read.all",
138+
"sampleKeys": ["contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE", "243bca4b-4e5e-45af-b37d-25f6135a740d"]
139+
} -->
140+
```http
141+
GET https://graph.microsoft.com/beta/sites/contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE/lists/243bca4b-4e5e-45af-b37d-25f6135a740d/items?expand=fields(select=Name,Color,Quantity)&$filter=fields/Quantity lt 600
142+
```
98143

99-
### Response
144+
#### Response
100145

101146
The following example shows the response.
102147

@@ -116,14 +161,6 @@ Content-type: application/json
116161
"Quantity": 503
117162
}
118163
},
119-
{
120-
"id": "4",
121-
"fields": {
122-
"Name": "Widget",
123-
"Color": "Blue",
124-
"Quantity": 2357
125-
}
126-
},
127164
{
128165
"id": "7",
129166
"fields": {

api-reference/beta/api/security-ediscoveryholdpolicy-list-usersources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Get a list of the [userSource](../resources/security-usersource.md) objects asso
2121
## Permissions
2222
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions [only if your app requires it](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference).
2323

24-
<!-- { "blockType": "permissions", "name": "security_ediscoverycustodian_list_usersources" } -->
24+
<!-- { "blockType": "permissions", "name": "security_ediscoveryholdpolicy_list_usersources" } -->
2525
[!INCLUDE [permissions-table](../includes/permissions/security-ediscoveryholdpolicy-list-usersources-permissions.md)]
2626
## HTTP request
2727

api-reference/beta/api/security-ediscoveryreviewset-addtoreviewset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,4 @@ The following example shows the response.
168168
-->
169169
``` http
170170
HTTP/1.1 202 Accepted
171-
```
171+
```

api-reference/beta/api/subscriptions-socketio.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,29 @@ The part of the string before `/callback?` is the socket.io endpoint URL and the
112112
The following example shows how to use the `notificationUrl` with socket.io in JavaScript.
113113

114114
```javascript
115-
// this is the notificationUrl returned from this API
116-
var notificationUrl = "https://f3hb0mpua.svc.ms/zbaehwg/callback?snthgk=1ff3-2345672zz831837523";
117-
118-
// after the split, split[0] will be everything leading up to '/callback?' and split[1] will be everything after.
119-
var split = notificationUrl.split("/callback?");
120-
121-
// 'io' comes from the socket.io client library
122-
var socket = io(split[0], { query: split[1] });
123-
124-
// these examples log to the console.
125-
// your app would provide its own callbacks
126-
socket.on("connect", ()=>console.log("Connected!"));
127-
socket.on("notification", (data)=>console.log("Notification!", data));
115+
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.8.1/socket.io.js"></script>
116+
<script>
117+
// This is the notificationUrl returned from this API
118+
var notificationUrl = "https://f3hb0mpua.svc.ms/zbaehwg/callback?snthgk=1ff3-2345672zz831837523";
119+
120+
// 'io' comes from the socket.io client library
121+
var socket = io(notificationUrl, {
122+
transports: ['websocket'] // Make sure to use "websocket" instead of the default value of "polling" which isn't supported
123+
});
124+
125+
socket.on("connect", () => {
126+
console.log(`connect`, socket.id);
127+
});
128+
129+
socket.on("disconnect", () => {
130+
// Returns "undefined" on disconnect
131+
console.log(`disconnect`, socket.id);
132+
});
133+
134+
socket.on("notification", (data) => {
135+
console.log(`Notification received:`, data);
136+
});
137+
</script>
128138
```
129139

130140
<!-- uuid: 8fcb5dbc-d5aa-4681-8e31-b001d5168d79

api-reference/beta/includes/permissions/onlinemeeting-getalltranscripts-permissions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.localizationpriority: medium
66

77
|Permission type|Least privileged permissions|Higher privileged permissions|
88
|:---|:---|:---|
9-
|Delegated (work or school account)|OnlineMeetings.Read|OnlineMeetings.ReadWrite|
9+
|Delegated (work or school account)|Not supported.|Not supported.|
1010
|Delegated (personal Microsoft account)|Not supported.|Not supported.|
11-
|Application|OnlineMeetings.Read.All|OnlineMeetings.ReadWrite.All|
11+
|Application|OnlineMeetings.Read.All|Not available.|
1212

api-reference/beta/includes/permissions/security-ediscoveryholdpolicy-delete-usersources-permissions.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

api-reference/beta/includes/permissions/security-ediscoveryholdpolicy-list-usersources-permissions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ ms.localizationpriority: medium
99
|Delegated (work or school account)|eDiscovery.Read.All|eDiscovery.ReadWrite.All|
1010
|Delegated (personal Microsoft account)|Not supported.|Not supported.|
1111
|Application|eDiscovery.Read.All|eDiscovery.ReadWrite.All|
12+

api-reference/beta/resources/listitem.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ All examples are relative to a **[list][]**; for example, `https://graph.microso
2727

2828
| Method | Return Type | Description |
2929
|:-------------------------------------------------------------------------|:-----------------------------------|:--------------------------------------------------------------------------|
30+
| [List](../api/listitem-list.md) | listItem collection | Get the collection of items in a list. |
3031
| [Create][] | listItem | Create a new listItem in a list. |
3132
| [Get][] | listItem | Get an item in a list. |
3233
| [Update][] | [fieldValueSet][] | Update the properties on a listItem. |

api-reference/beta/resources/signinactivity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Effective December 1, 2023, the **lastSuccessfulSignInDateTime** property is ava
2626
|lastNonInteractiveSignInRequestId|String|Request identifier of the last non-interactive sign-in performed by this user.|
2727
|lastSignInDateTime|DateTimeOffset|The last interactive sign-in date and time for a specific user. You can use this field to calculate the last time a user attempted (either successfully or unsuccessfully) to sign in to the directory the directory with an interactive authentication method. This field can be used to build reports, such as inactive users. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`. Microsoft Entra ID maintains interactive sign-ins going back to April 2020. For more information about using the value of this property, see [Manage inactive user accounts in Microsoft Entra ID](/azure/active-directory/reports-monitoring/howto-manage-inactive-user-accounts).|
2828
|lastSignInRequestId|String|Request identifier of the last interactive sign-in performed by this user.|
29-
|lastSuccessfulSignInDateTime|DateTimeOffset|The date and time of the user's most recent successful sign-in activity. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`.|
29+
|lastSuccessfulSignInDateTime|DateTimeOffset|The date and time of the user's most recent successful interactive or non-interactive sign-in. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`.|
3030
|lastSuccessfulSignInRequestId|String|The request ID of the last successful sign-in.|
3131

3232
## JSON representation

api-reference/beta/toc/sites-and-lists/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ items:
152152
items:
153153
- name: List item
154154
href: ../../resources/listitem.md
155+
- name: List
156+
href: ../../api/listitem-list.md
155157
- name: Create
156158
href: ../../api/listitem-create.md
157159
- name: Get

0 commit comments

Comments
 (0)