Nguồn cấp dữ liệu lịch hẹn còn trống

Tạo và tải nguồn cấp dữ liệu về tình trạng rảnh/bận lên

Khi tạo và tải nguồn cấp dữ liệu về tình trạng còn trống của lịch hẹn lên, hãy làm theo các hướng dẫn sau:

  • Làm theo thông số kỹ thuật được mô tả trong nguồn cấp dữ liệu về tình trạng rảnh để đặt lịch hẹn đối với các tệp dữ liệu về tình trạng rảnh để đặt lịch hẹn. Bạn nên sử dụng tên tệp dữ liệu riêng biệt cho mỗi lần tải lên thông tin về tình trạng rảnh để đặt lịch hẹn. Thêm dấu thời gian vào tên tệp, ví dụ: appointment availability_1633621547.json.
  • Trong phần mô tả nhóm tệp, hãy đặt trường name thành appointment.availability. Để xem ví dụ về tệp mô tả, hãy tham khảo mẫu JSON. Bạn nên sử dụng tên tệp mô tả riêng biệt cho mỗi lần tải lên. Thêm dấu thời gian vào tên tệp, ví dụ: appointment availability_1633621547.filesetdesc.json. Bạn phải tải tệp mô tả lên máy chủ SFTP chung.
  • Tải nguồn cấp dữ liệu lên máy chủ SFTP chung sau mỗi 30 phút dưới dạng làm mới toàn bộ.
  • Bạn có thể tìm thấy thông tin chi tiết về máy chủ SFTP trong mục Cấu hình > Nguồn cấp dữ liệu của Partner Portal.
  • Chọn máy chủ nguồn cấp dữ liệu

    Chọn máy chủ nguồn cấp dữ liệu trong Partner Portal
  • Xem trạng thái nhập nguồn cấp dữ liệu trong phần Nhập > Nhật ký của Partner Portal.

Tải nguồn cấp dữ liệu gia tăng lên

Lịch hẹn còn hỗ trợ nguồn cấp dữ liệu gia tăng, cho phép đối tác chỉ tải những thay đổi về lịch hẹn lên bằng cách tải nguồn cấp dữ liệu lên.

Để tải nguồn cấp dữ liệu gia tăng lên, hãy định cấu hình hộp thả Generic_Incremental trong thẻ "Nhập dữ liệu > Cấu hình" của Actions Center cho cả hai môi trường, rồi tải tất cả nguồn cấp dữ liệu gia tăng về tình trạng còn hàng lên đó.

Cấu hình nhập dữ liệu cho nguồn cấp dữ liệu tăng dần

Cấu hình truyền dẫn cho nguồn cấp dữ liệu gia tăng

Bản cập nhật gia tăng cung cấp các thao tác sau:

Không có thay đổi
Đừng thêm mã tình trạng còn phòng/vé cho những thực thể không có thay đổi.
Cập nhật tình trạng còn hàng
Để cập nhật một tình trạng còn hàng, hãy tải mục tình trạng còn hàng cụ thể (cùng availability_id) cần sửa đổi lên, thay đổi bất kỳ trường nào đã chọn.
Xoá lịch rảnh/bận
Nếu một mục tình trạng còn hàng không còn áp dụng hoặc cần được xoá, hãy tải tình trạng còn hàng đó lên (cùng availability_id) với spots_available được đặt thành 0 và hệ thống sẽ tự động xoá mục đó. Hơn nữa, để xoá tất cả dữ liệu của một người bán / đơn vị, hãy đặt spots_available của tất cả khung giờ còn trống của họ thành 0. Thao tác này sẽ xoá chính người bán / đơn vị đó khỏi mục Tình trạng còn hàng.
Thêm phạm vi cung cấp
Đối với các khung giờ rảnh mới, hãy thêm mục mới về tình trạng rảnh/bận cùng với availability_id mới và riêng biệt trong tệp tải lên nguồn cấp dữ liệu. Hệ thống sẽ xử lý tệp này giống như khi tệp được đưa vào một nguồn cấp dữ liệu thông thường.

Định nghĩa

Định nghĩa về AppointmentAvailabilityFeed

message AppointmentAvailabilityFeed {
  option features.(pb.java).nest_in_file_class = YES;

  repeated AppointmentAvailability data = 1;
}

Định nghĩa về AppointmentAvailability

// This represents the availability data for a bookable service provided by a
// merchant.
// For example, it can be a haircut/nail manicure service for a beauty salon or
// a massage service for a spa.
// The availability feed should be a list of this message.
message AppointmentAvailability {
  option features.(pb.java).nest_in_file_class = YES;

  // An opaque string generated by the partner that identifies a service time
  // slot. Must be unique across all entities and service time slots.
  // Strongly recommended to only include URL-safe characters.
  // Required.
  string availability_id = 1;

  // An opaque string generated by the partner that identifies an Entity.
  // Must be unique across all entities.
  // Strongly recommended to only include URL-safe characters.
  // Required.
  string entity_id = 2;

  // An opaque string of ASCII characters from an aggregator partner which
  // uniquely identifies the Service (haircut, nail manicure, massage).
  // Strongly recommended to only include URL-safe characters.
  // Required.
  string service_id = 3;

  // The name of the service provider. For example, the name of the
  // hairdresser or the spa staff member.
  // Optional.
  string provider = 12;

  // Timestamp of when this availability slot starts in UTC.
  // Given in seconds since the unix epoch.
  // For example, 1735714800 seconds for 1 Jan 2025, 07:00:00 (UTC).
  // Required.
  int64 start_time_sec = 4;

  // The minimum number of minutes in advance before the start time that this
  // availability slot can be booked.
  // For example, if the start time is 10:00 AM and the min_advance_minutes is
  // 60, then the latest time this slot can be booked is 9:00 AM on the day of
  // the appointment.
  // If not set, it is assumed to be 0, meaning the slot can be booked at any
  // time before the start time.
  // Optional.
  int32 min_advance_minutes = 13;

  // Number of total spots of this booking availability.
  // Optional.
  int32 spots_total = 5;

  // Number of available spots of this booking availability.
  // Required.
  int32 spots_available = 6;

  // The minimum number of spots that should be booked for this availability.
  // For example, a user has to book at least 2 spots for a time slot sometimes.
  // If set, spots_minimum_book should be less or equal to spots_available.
  // Optional.
  int32 spots_minimum_book = 7;

  // Link of this booking availability. Users will be redirected to partner
  // website to continue booking after clicking this link.
  // Required.
  string booking_link = 8;

  // Base price per person.
  // Optional.
  google.type.Money base_price = 9;

  // Fee per person.
  // Optional.
  google.type.Money fee_price = 10;

  // Whether the feed is incremental or not.
  // By default it is false, meaning the Availability feed will override the
  // previous data for the same entity_id.
  // If this is set to be true, the Availability feed will be proceeded as
  // incremental updates for the same entity_id.
  //    1) If it is a new availability_id, the entry is added.
  //    2) If it is an existing availability_id and the spots_available is 0,
  //       the entry is removed.
  //    3) If it is an existing availability_id and the spots_available is not
  //    0, the entry is updated.
  bool is_incremental = 11;
}

Tham chiếu proto bên ngoài:

Mẫu nguồn cấp dữ liệu về tình trạng rảnh/bận cho cuộc hẹn

Nguồn cấp dữ liệu về lịch hẹn còn trống

{
  "data": [
    {
      "availability_id": "availability_id_1",
      "entity_id": "entity_id_1",
      "service_id": "service_id_1",
      "start_time_sec": 1728257400,
      "spots_total": 4,
      "spots_available": 4,
      "spots_minimum_book": 2,
      "booking_link": "https://www.googleappointments.com/a_link_direct_to_booking_page",
      "base_price": {
        "currency_code": "USD",
        "units": 80,
        "nanos": 0
      },
      "fee_price": {
        "currency_code": "USD",
        "units": 1,
        "nanos": 750000000
      }
    },
    {
      "availability_id": "availability_id_2",
      "entity_id": "entity_id_2",
      "service_id": "service_id_2",
      "start_time_sec": 1728259200,
      "spots_total": 4,
      "spots_available": 4,
      "spots_minimum_book": 2,
      "booking_link": "https://googlegolfappointments.com/a_link_direct_to_booking_page",
      "base_price": {
        "currency_code": "USD",
        "units": 80,
        "nanos": 0
      },
      "fee_price" : {
        "currency_code": "USD",
        "units": 2,
        "nanos": 850000000
      }
    }
  ]
}

Tệp mô tả

{
  "generation_timestamp": 1663347730,
  "name": "appointment.availability",
  "data_file": [
    "appointment_availability_1663347730.json"
  ]
}