列出 bookingBusinesses
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
获取为租户创建的 bookingBusiness 对象的集合。
此操作仅返回集合中每个Microsoft Bookings企业的 ID 和 displayName 。 出于性能考虑,它不会返回其他属性。 可以通过在 GET 操作中指定其 ID 来获取Bookings业务的其他属性。
还可以通过在参数中query指定字符串来查询Bookings企业,以便在租户的业务之间进行子字符串匹配。 请参阅以下示例 。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
Bookings。Read.All,BookingsAppointment.ReadWrite.All,Bookings。ReadWrite.All,Bookings。Manage.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
不支持。
HTTP 请求
GET /bookingBusinesses
可选的查询参数
此方法支持 OData 查询参数 来帮助自定义响应。
此方法还支持 query 接受字符串值的参数。 此参数将 GET 结果限制为与指定字符串匹配的企业。 可在下面看到一个 示例 。
名称
说明
Authorization
Bearer {code}
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回一个 200 OK 响应代码和 bookingBusiness 对象集合。
示例
请求 1
以下示例获取租户中的Bookings企业。
GET https://graph.microsoft.com/beta/bookingBusinesses
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var bookingBusinesses = await graphClient.BookingBusinesses
.Request()
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let bookingBusinesses = await client.api('/bookingBusinesses')
.version('beta')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/bookingBusinesses"]]];
[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];
MSGraphBookingBusiness *bookingBusiness = [[MSGraphBookingBusiness alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
BookingBusinessCollectionPage bookingBusinesses = graphClient.bookingBusinesses()
.buildRequest()
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
result, err := graphClient.BookingBusinesses().Get()
Import-Module Microsoft.Graph.Bookings
Get-MgBookingBusiness
响应 1
下面介绍响应示例。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/beta/$metadata#bookingBusinesses",
"value":[
{
"id":"Contosolunchdelivery@contoso.onmicrosoft.com",
"displayName":"Contoso lunch delivery",
},
{
"id":"Fabrikam@contoso.onmicrosoft.com",
"displayName":"Fabrikam",
}
]
}
请求 2
以下示例演示如何使用query该参数获取租户中一个或多个匹配Bookings企业。
GET https://graph.microsoft.com/beta/bookingBusinesses?query=Adventure
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var queryOptions = new List<QueryOption>()
{
new QueryOption("query", "Adventure")
};
var bookingBusinesses = await graphClient.BookingBusinesses
.Request( queryOptions )
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let bookingBusinesses = await client.api('/bookingBusinesses?query=Adventure')
.version('beta')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/bookingBusinesses?query=Adventure"]]];
[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];
MSGraphBookingBusiness *bookingBusiness = [[MSGraphBookingBusiness alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new QueryOption("query", "Adventure"));
BookingBusinessCollectionPage bookingBusinesses = graphClient.bookingBusinesses()
.buildRequest( requestOptions )
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.BookingBusinessesRequestBuilderGetQueryParameters{
Query: "Adventure",
}
options := &msgraphsdk.BookingBusinessesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.BookingBusinesses().GetWithRequestConfigurationAndResponseHandler(options, nil)
Import-Module Microsoft.Graph.Bookings
Get-MgBookingBusiness -Query "Adventure"
响应 2
下面展示了示例响应。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/beta/$metadata#bookingBusinesses",
"value":[
{
"id":"AdventureWorksCycles@M365B960066.onmicrosoft.com",
"displayName":"Adventure Works Cycles",
}
]
}