สร้างและอัปโหลดฟีดเวลาว่างสำหรับการนัดหมาย
เมื่อสร้างและอัปโหลดฟีดความพร้อมในการนัดหมาย ให้ทำตามวิธีการต่อไปนี้
- ทำตามข้อกำหนดที่อธิบายไว้ใน
ฟีดความพร้อมในการนัดหมาย
สำหรับไฟล์ข้อมูลความพร้อมในการนัดหมาย เราขอแนะนำให้ใช้ชื่อไฟล์ข้อมูลความพร้อมในการนัดหมายที่ไม่ซ้ำกันสำหรับการอัปโหลดแต่ละครั้ง
ใส่การประทับเวลาในชื่อไฟล์ เช่น
appointment availability_1633621547.json - ในตัวอธิบายชุดไฟล์ ให้ตั้งค่าช่อง
nameเป็นappointment.availabilityดูตัวอย่างไฟล์ตัวอธิบายได้ที่ตัวอย่าง JSON เราขอแนะนำให้ใช้ชื่อไฟล์ตัวอธิบายที่ไม่ซ้ำกันสำหรับการอัปโหลดแต่ละครั้ง ใส่การประทับเวลาในชื่อไฟล์ เช่นappointment availability_1633621547.filesetdesc.jsonคุณต้องอัปโหลดไฟล์ตัวอธิบายไปยังเซิร์ฟเวอร์ SFTP ทั่วไป - อัปโหลดฟีดไปยังเซิร์ฟเวอร์ SFTP ทั่วไปทุกๆ 30 นาทีเป็นการรีเฟรชแบบเต็ม
- คุณดูรายละเอียดเซิร์ฟเวอร์ SFTP ได้ในส่วนการกำหนดค่า > ฟีดของพอร์ทัลพาร์ทเนอร์
- ดูสถานะการนำเข้าฟีดได้ในส่วนฟีด > ประวัติของพอร์ทัลพาร์ทเนอร์
การอัปโหลดฟีดที่เพิ่มขึ้น
ความพร้อมในการนัดหมายยังรองรับฟีดที่เพิ่มขึ้นด้วย ซึ่งช่วยให้พาร์ทเนอร์อัปโหลดได้เฉพาะการเปลี่ยนแปลงที่เกิดขึ้นกับความพร้อมโดยใช้การอัปโหลดฟีด
หากต้องการอัปโหลดฟีดส่วนเพิ่ม ให้ตั้งค่า is_incremental: true ภายในช่วงเวลาที่พร้อมให้บริการอย่างน้อย 1 ช่วงในฟีด หากฟีดบางรายการis_incrementalตั้งค่าเป็น true และบางรายการตั้งค่าเป็น false ระบบจะถือว่าฟีดทั้งหมดเป็นแบบเพิ่มทีละรายการ
การอัปเดตแบบเพิ่มทีละรายการจะมีการดำเนินการต่อไปนี้
- ไม่มีการเปลี่ยนแปลง
- อย่าระบุรหัสความพร้อมสำหรับเอนทิตีที่ไม่มีการเปลี่ยนแปลง
- อัปเดตความพร้อมจำหน่ายสินค้า
- หากต้องการอัปเดตห้องว่างรายการเดียว ให้อัปโหลดรายการห้องว่างที่เฉพาะเจาะจง (
availability_idเดียวกัน) ที่ต้องแก้ไข โดยเปลี่ยนฟิลด์ที่เลือก - ลบความพร้อม
- หากรายการความพร้อมไม่พร้อมใช้งานอีกต่อไปหรือควรถูกลบ ให้อัปโหลดความพร้อมดังกล่าว (
availability_idเดียวกัน) โดยตั้งค่าspots_availableเป็น 0 แล้วระบบจะลบรายการนั้นโดยอัตโนมัติ นอกจากนี้ หากต้องการนำข้อมูลทั้งหมดของผู้ขาย / เอนทิตีออก ให้ตั้งค่าspots_availableของช่วงเวลาที่พร้อมให้บริการทั้งหมดเป็น 0 ซึ่งจะนำผู้ขาย / เอนทิตีออกจากความพร้อมให้บริการ - เพิ่มความพร้อม
- สำหรับช่วงเวลาว่างใหม่ ให้รวมรายการความพร้อมใหม่พร้อมด้วย
availability_idใหม่ที่ไม่ซ้ำกันในการอัปโหลดฟีด ระบบจะถือว่าเหมือนกับว่ารวมอยู่ในฟีดปกติ
คำจำกัดความ
คำจำกัดความของฟีดความพร้อมในการนัดหมาย
message AppointmentAvailabilityFeed { repeated AppointmentAvailability data = 1; }
คำจำกัดความของ 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 { // 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 and available spots of this booking availability. // Required. int32 spots_total = 5; // 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. // Required. google.type.Money base_price = 9; // Fee per person. // Required. 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; }
การอ้างอิง Proto ภายนอก
ตัวอย่างฟีดความพร้อมของสนามกอล์ฟ
ฟีดความพร้อมในการนัดหมาย
{ "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 } } ] }
ไฟล์ข้อบ่งชี้
{ "generation_timestamp": 1663347730, "name": "appointment.availability", "data_file": [ "appointment_availability_1663347730.json" ] }