การอัปเดตแบบเรียลไทม์

การอัปเดตแบบเรียลไทม์ช่วยให้คุณซิงค์สินค้าคงคลังของข้อเสนอกับ Google ได้ คุณสามารถพุชการอัปเดตแบบเพิ่มทีละรายการได้ในเวลาที่ใกล้เคียงกับเวลาจริง ระบบจะรวบรวมการเปลี่ยนแปลงจากฟีด + RTU เพื่อแสดงข้อมูลล่าสุดแก่ผู้ใช้

ปลายทาง API

หากต้องการพุชหรือลบข้อมูลอัปเดตแบบเรียลไทม์ ให้ใช้ปลายทาง REST API ต่อไปนี้

การพุชแบบกลุ่ม

  • แซนด์บ็อกซ์: https://partnerdev-mapsbooking.googleapis.com/v1alpha/inventory/partners/{partner_id}/feeds/google.offer/record:batchPush
  • การผลิต: https://mapsbooking.googleapis.com/v1alpha/inventory/partners/{partner_id}/feeds/google.offer/record:batchPush

ลบแบบเป็นชุด

  • แซนด์บ็อกซ์: https://partnerdev-mapsbooking.googleapis.com/v1alpha/inventory/partners/{partner_id}/feeds/google.offer/record:batchDelete
  • การผลิต: https://mapsbooking.googleapis.com/v1alpha/inventory/partners/{partner_id}/feeds/google.offer/record:batchDelete

ดูข้อมูลเพิ่มเติมเกี่ยวกับคำจำกัดความของออบเจ็กต์ JSON ของข้อเสนอได้ที่ข้อเสนอ ดูรายละเอียดเพิ่มเติมเกี่ยวกับพร็อพเพอร์ตี้ของข้อเสนอได้ที่หน้าข้อมูลอ้างอิงของข้อเสนอ

วิธีตรวจสอบสิทธิ์ไปยัง API

หากต้องการเชื่อมต่อกับ API โปรดดูตรวจสอบสิทธิ์ด้วย Mapsbooking API

ข้อจำกัด

เมื่อใช้ API การอัปเดตแบบเรียลไทม์ โปรดคํานึงถึงข้อจํากัดต่อไปนี้

  • protoRecord เท่านั้น: API ได้รับการกำหนดค่าให้ใช้เฉพาะ protoRecord (ไม่ใช่ dataRecord)
  • ขีดจำกัดโควต้า: API เหล่านี้มีโควต้าคำขอ 1,500 รายการต่อนาทีต่อบัญชีพาร์ทเนอร์ คำขอแต่ละรายการจะจำกัดการส่ง1,000 ระเบียนสำหรับการแทรก/อัปเดตหรือการลบ
  • ข้อจำกัดในการแมปเอนทิตี: พาร์ทเนอร์สามารถส่งการอัปเดตรหัสเอนทิตี 1 รายการสำหรับแต่ละข้อเสนอ หากต้องการอัปเดตข้อเสนอเดียวกันในรหัสเอนทิตีหลายรายการ พาร์ทเนอร์ต้องส่ง1 ระเบียนต่อ entityId entityIdต้องเป็นเอกพจน์เสมอต่อ 1 ระเบียน
  • ข้อเสนอส่วนเสริม: เนื่องจากข้อจำกัดในการแมปเอนทิตี ข้อเสนอส่วนเสริมที่addOnOfferApplicableToAllEntitiesจึงไม่รองรับการอัปเดต RTU และอัปเดตด้วยวิธีนี้ไม่ได้ (อัปเดตได้ผ่านฟีดเท่านั้น)

ตัวอย่าง

ตัวอย่างการอัปเดตเป็นกลุ่ม

ตัวอย่างการพุชข้อมูลอัปเดตแบบเรียลไทม์ผ่าน curl มีดังนี้

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth application-default print-access-token --impersonate-service-account=test@myproject.gserviceaccount.com --scopes=https://www.googleapis.com/auth/mapsbooking)" \
  -H "Content-Type: application/json" \
  -d '{
  "records": [
    {
      "generationTimestamp": {
        "seconds": 100
      },
      "protoRecord": {
        "@type": "type.googleapis.com/madden.ingestion.offer.Offer",
        "offerId": "1",
        "entityIds": [
          "1234567890"
        ],
        "addOnOfferApplicableToAllEntities": false,
        "offerSource": "OFFER_SOURCE_AGGREGATOR",
        "actionType": "ACTION_TYPE_FOOD_DELIVERY",
        "offerModes": [
          "OFFER_MODE_WALK_IN"
        ],
        "offerCategory": "OFFER_CATEGORY_BASE_OFFER",
        "tags": [
          "OFFER_TAG_NEW_YEAR_SPECIAL"
        ],
        "offerDetails": {
          "offerDisplayText": "FLAT 10% off",
          "offerSummaryText": "MONDAY TO FRIDAY",
          "discountPercent": 10
        },
        "offerRestrictions": {
          "combinableWithOtherOffers": true,
          "inclusions": [
            {
              "description": "complementary drink"
            },
            {
              "description": " starters"
            }
          ],
          "exclusions": [
            {
              "description": "taxes and Tips"
            }
          ]
        },
        "validityPeriods": [
          {
            "timeOfDay": {
              "timeWindows": [
                {
                  "openTime": {
                    "hours": 10
                  },
                  "closeTime": {
                    "hours": 20
                  }
                }
              ]
            },
            "validPeriod": {
              "validFromTime": {
                "seconds": 10
              }
            }
          }
        ],
        "offerUrl": "https://www.google.com/offer"
      }
    }
  ]
}' \
  https://partnerdev-mapsbooking.googleapis.com/v1alpha/inventory/partners/20000123/feeds/google.offer/record:batchPush

ตัวอย่างการลบแบบเป็นกลุ่ม

ตัวอย่างการลบข้อเสนอผ่าน curl มีดังนี้

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth application-default print-access-token --impersonate-service-account=test@myproject.gserviceaccount.com --scopes=https://www.googleapis.com/auth/mapsbooking)" \
  -H "Content-Type: application/json" \
  -d '{
  "records": [
    {
      "deleteTime": {
        "seconds": 150
      },
      "protoRecord": {
        "@type": "type.googleapis.com/madden.ingestion.offer.Offer",
        "offerId": "1",
        "entityIds": [
          "1234567890"
        ]
      }
    }
  ]
}' \
  https://partnerdev-mapsbooking.googleapis.com/v1alpha/inventory/partners/20000123/feeds/google.offer/record:batchDelete