使用在 Microsoft Graph 中 Microsoft 预订 APIUse the Microsoft Bookings API in Microsoft Graph

重要说明: Microsoft Graph 中 /beta 版本下的 API 是预览版,可能会发生变化。Important: APIs under the /beta version in Microsoft Graph are in preview and are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported.

Microsoft 预订允许小型企业所有者管理客户的预定和通过少量设置的信息。Microsoft Bookings lets small business owners manage customer bookings and information with minimal setup. 业务所有者可以提供一组服务的每个业务部门创建一个或多个企业版。A business owner can create one or more businesses, with each business offering a set of services. 所有者可以设置人员,并指定每个员工成员执行的服务。The owner can set up staff members, and specify the services that each staff member performs. 客户可以在联机或移动应用程序中的业务书籍特定服务的约会。A customer can book an appointment for a specific service in that business in an online or mobile app. 预订确保的约会时间保持最新的人员,业务和客户涉及。Bookings ensures that the appointment time is kept up-to-date for the business, staff members, and customers involved.

以编程方式预订 API 中bookingBusiness涉及以下对象:Programmatically, a bookingBusiness in the Bookings API involves the following objects:

使用预订 REST APIUsing the Bookings REST API

预订第一次的业务的客户约会之前逐步完成以下步骤。Walk through the following steps before booking customer appointments for a business the first time. 请确保您为相应的操作提供适当的访问令牌Make sure you provide the appropriate access tokens for the corresponding operations.

  1. 确保业务具有的Office 365 企业高级版订阅。Make sure the business has an Office 365 Business Premium subscription.
  2. 创建新bookingBusiness通过将 POST 操作发送到的实体集。Create a new bookingBusiness by sending a POST operation to the entity set. 至少应指定客户将看到新的业务的名称:At minimum, you should specify a name for the new business that customers will see:
POST https://graph.microsoft.com/beta/bookingBusinesses
Authorization: Bearer {access token}
Content-Type: application/json

{
    "displayName":"Contoso"
}

POST 响应中返回新bookingBusinessid属性用于继续自定义业务设置,并添加员工和业务的服务。Use the id property of the new bookingBusiness returned in the POST response to continue to customize business settings, and add staff members and services for the business.

  1. 添加业务的人员成员:Add individual staff members for the business:
POST https://graph.microsoft.com/beta/bookingBusinesses/{id}/staffMembers
Authorization: Bearer {access token}
Content-Type: application/json

{
    "displayName":"Dana Swope",
    "emailAddress": "danas@contoso.com",
    "role": "externalGuest"
}
  1. 定义由业务提供每个服务:Define each service offered by the business:
POST https://graph.microsoft.com/beta/bookingBusinesses/{id}/services
Authorization: Bearer {access token}
Content-Type: application/json

{
    "displayName":"Bento"
}
  1. 发布的企业,可以让客户和业务运算符启动预订约会的计划页:Publish the scheduling page for the business, to let customers and business operators start booking appointments:
POST https://graph.microsoft.com/beta/bookingBusinesses/{id}/publish
Authorization: Bearer {access token}

通常,列出 Office 365 租户中的所有预订企业: 中In general, to list all the booking businesses in the Office 365 tenant:

GET https://graph.microsoft.com/beta/bookingBusinesses
Authorization: Bearer {access token}

常见用例Common use cases

下表列出了业务预订 API 中的常见操作。The following table lists the common operations for a business in the Bookings API.

用例Use cases REST 资源REST resources 另请参阅See also
创建、 获取、 更新或删除业务Create, get, update, or delete a business bookingBusinessbookingBusiness BookingBusiness 方法Methods of bookingBusiness
更新计划策略Update the scheduling policy bookingSchedulingPolicybookingSchedulingPolicy 更新 bookingBusinessUpdate a bookingBusiness
添加、 获取、 更新或删除员工成员Add, get, update, or delete staff members bookingStaffMemberbookingStaffMember BookingStaffMember 方法Methods of bookingStaffMember
添加、 获取、 更新或删除服务Add, get, update, or delete services bookingServicebookingService BookingService 方法Methods of bookingService
公开或取消公开计划页Publish or unpublish the scheduling page bookingBusinessbookingBusiness 发布publish
取消发布unpublish
创建、 获取、 更新、 删除或取消约会Create, get, update, delete, or cancel an appointment bookingAppointmentbookingAppointment BookingAppointment 方法Methods of bookingAppointment
获取约会中的日期范围Get appointments in a date range bookingBusinessbookingBusiness 列表的预定 calendarViewList Bookings calendarView
获取货币Get currency bookingCurrencybookingCurrency BookingCurrency 方法Methods of bookingCurrency

另请参阅See also