用户:findRoomLists
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
获取租户中定义的会议室列表,如其 emailAddress 对象所表示。
租户可以将会议室整理到会议室列表。 在此 API 中,每个会议室和会议室列表由 emailAddress 实例表示。
可以获取租户中的所欲会议室列表、获取租户中的所有会议室 或获取特定会议室列表的所有会议室 。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
User.ReadBasic.All、User.Read.All
委派(个人 Microsoft 帐户)
不支持。
Application
User.Read.All
HTTP 请求
GET /me/findRoomLists
GET /users/{id}/findRoomLists
名称
类型
说明
Authorization
string
Bearer {token}。必需。
Content-Type
string
application/json. Required.
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法将在响应主体中返回 200 OK 响应代码和 emailAddress 对象集合。
如果租户中未定义任何列表,则会返回空数组。
示例
请求
下面是一个请求示例。
GET https://graph.microsoft.com/beta/me/findRoomLists
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var findRoomLists = await graphClient.Me
.FindRoomLists()
.Request()
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let findRoomLists = await client.api('/me/findRoomLists')
.version('beta')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/me/findRoomLists"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphEmailAddress *emailAddress = [[MSGraphEmailAddress alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
UserFindRoomListsCollectionPage findRoomLists = graphClient.me()
.findRoomLists()
.buildRequest()
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
result, err := graphClient.Me().FindRoomLists()().Get()
Import-Module Microsoft.Graph.Users.Functions
# A UPN can also be used as -UserId.
Find-MgUserRoomList -UserId $userId
响应
下面是一个响应示例。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.emailAddress)",
"value": [
{
"name": "Building 1 Rooms",
"address": "Building1Rooms@contoso.onmicrosoft.com"
},
{
"name": "Building 2 Rooms",
"address": "Building2Rooms@contoso.onmicrosoft.com"
}
]
}