GET https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}
GET https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-title}
GET https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}?expand=columns,items(expand=fields)
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var list = await graphClient.Sites["{site-id}"].Lists["{list-id}"]
.Request()
.GetAsync();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
siteId := "site-id"
listId := "list-id"
result, err := graphClient.SitesById(&siteId).ListsById(&listId).Get()
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var list = await graphClient.Sites["{site-id}"].Lists["{list-id}"]
.Request()
.GetAsync();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
siteId := "site-id"
listId := "list-id"
result, err := graphClient.SitesById(&siteId).ListsById(&listId).Get()
GET /sites/{site-id}/lists/{list-id}?select=name,lastModifiedDateTime&expand=columns(select=name,description),items(expand=fields(select=Name,Color,Quantity))
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var queryOptions = new List<QueryOption>()
{
new QueryOption("select", "name,lastModifiedDateTime"),
new QueryOption("expand", "columns(select=name,description),items(expand=fields(select=Name,Color,Quantity))")
};
var list = await graphClient.Sites["{site-id}"].Lists["{list-id}"]
.Request( queryOptions )
.GetAsync();
HTTP/1.1 200 OK
Content-type: application/json
{
"name": "Inventory",
"lastModifiedDateTime": "2016-08-30T08:32:00Z",
"columns": [
{
"name": "Name",
"description": "Customer-facing name of the SKU"
},
{
"name": "Color",
"description": "Color of the item in stock"
},
{
"name": "Quantity",
"description": "Number of items in stock"
}
],
"items": [
{
"id": "2",
"fields": {
"Name": "Gadget",
"Color": "Red",
"Quantity": 503
}
},
{
"id": "4",
"fields": {
"Name": "Widget",
"Color": "Blue",
"Quantity": 2357
}
},
{
"id": "7",
"fields": {
"Name": "Gizmo",
"Color": "Green",
"Quantity": 92
}
}
]
}
请求
以下示例演示如何获取包含三列的列表的元数据:名称、数量和类别。
托管元数据 列, Category 如作为术语 ID 和术语名称对的返回值。
GET /sites/{site-id}/lists/{list-id}?select=name,lastModifiedDateTime&expand=columns(select=name,description),items(expand=fields(select=Name,Quantity,Category))