실시간 업데이트

실시간 업데이트를 사용하면 Google과 제안 인벤토리를 동기화할 수 있습니다. 거의 실시간으로 증분 업데이트를 푸시할 수 있습니다. 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는 dataRecord가 아닌 protoRecord만 사용하도록 구성됩니다.
  • 할당량 한도: 이러한 API의 할당량은 파트너 계정당 분당 요청 1,500개 입니다. 각 요청은 upsert 또는 삭제를 위해 레코드 1,000개 를 전송하도록 제한됩니다.
  • 엔티티 매핑 제한: 각 제안에 대해 파트너는 엔티티 ID 1개의 업데이트를 전송할 수 있습니다. 여러 엔티티 ID에서 동일한 제안을 업데이트하려면 파트너가 레코드 1개entityId를 전송해야 합니다. entityId는 레코드당 항상 단수여야 합니다.
  • 부가기능 제안: 엔티티 매핑 제한으로 인해 부가기능 제안은 RTU 업데이트에서 실제로 지원되지 않으며 이 방법 (피드를 통해서만)으로 업데이트할 수 없습니다.addOnOfferApplicableToAllEntities

일괄 업데이트 예시

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