リアルタイム更新により、オファーの在庫を Google と同期できます。増分更新を準リアルタイムで push できます。YouTube のシステムは、フィードと 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
Offer JSON オブジェクトの定義について詳しくは、Offer をご覧ください。特典のプロパティの詳細については、特典のリファレンス ページをご覧ください。
API に対する認証方法
API に接続するには、Mapsbooking API で認証するをご覧ください。
制限事項
リアルタイム更新 API を使用する場合は、次の制限事項に注意してください。
- protoRecord のみ:
protoRecord(dataRecordではない)のみを使用するように API が構成されています。 - 割り当て上限: これらの API の割り当ては、パートナー アカウントごとに 1 分あたり 1,500 リクエストです。各リクエストは、更新または削除のために 1,000 件のレコードを送信するように制限されています。
- エンティティ マッピングの制限: パートナーは、オファーごとに 1 つのエンティティ ID の更新を送信できます。複数のエンティティ ID で同じ提案を更新する場合は、パートナーは
entityIdごとに 1 つのレコードを送信する必要があります。entityIdはレコードごとに常に単数形である必要があります。 - アドオン オファー: エンティティ マッピングの制限により、
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