動作動態

建立及上傳動作動態饋給

建立及上傳動作動態饋給時,請按照下列操作說明進行:

  • 請按照動作動態饋給所述規格,建立動作資料檔案。建議每次上傳時,都為動作資料檔案命名專屬名稱。 在檔案名稱中加入時間戳記,例如 action_1633621547.json
  • 在檔案集描述元中,將 name 欄位設為 reservewithgoogle.action.v2。如需描述元檔案範例,請參閱 JSON 範例。 建議您為每次上傳作業使用專屬的描述元檔案名稱。 在檔名中加入時間戳記,例如 action_1633621547.filesetdesc.json。 描述元檔案必須上傳至一般 SFTP 伺服器。
  • 每天將動態饋給上傳至一般安全檔案傳輸通訊協定伺服器,進行完整重新整理。
  • 你可以在合作夥伴入口網站的「設定」>「動態饋給」部分找到 SFTP 伺服器詳細資料。
  • 選取動態饋給伺服器

    在合作夥伴入口網站中選取動態饋給伺服器
  • 在合作夥伴入口網站的「動態消息」>「記錄」專區中,查看動態消息擷取狀態。

定義

ActionFeed 定義

message ActionFeed {
  repeated ActionDetail data = 1;
}

ActionDetail 定義

message ActionDetail {
  string entity_id = 2;
  string link_id = 3;

  // Deep link for action detail
  string url = 4;
  repeated Action actions = 1;
}

動作定義

// Information about an Action which could be performed.
message Action {
  // Deprecated fields not to be reused.
  reserved 1;

  oneof action_info {
    FoodOrderingInfo food_ordering_info = 3;
  }
}

FoodOrderingInfo 定義

message FoodOrderingInfo {
  // Service type for food ordering action.
  enum ServiceType {
    UNKNOWN = 0;
    DELIVERY = 1;
    TAKEOUT = 2;
  }

  ServiceType service_type = 1
      ;
}

動作動態消息範例

僅供外送

檔案名稱:actions_1697754089_0001.json

{
  "data": [
    {
      "actions": [{ "food_ordering_info": { "service_type": "DELIVERY" } }],
      "entity_id": "dining-1",
      "link_id": "delivery-dining-1",
      "url": "https://www.restaurant.com/delivery/dining-1"
    }
  ]
}

僅供外帶

檔案名稱:actions_1697754089_0001.json

{
  "data": [
    {
      "actions": [{ "food_ordering_info": { "service_type": "TAKEOUT" } }],
      "entity_id": "dining-1",
      "link_id": "takeout-link-dining-1",
      "url": "https://www.restaurant.com/takeout/dining-1"
    }
  ]
}

外送和外帶

檔案名稱:actions_1697754089_0001.json

{
  "data": [
    {
      "actions": [
        { "food_ordering_info": { "service_type": "DELIVERY" } },
        { "food_ordering_info": { "service_type": "TAKEOUT" } }
      ],
      "entity_id": "dining-1",
      "link_id": "common-link-dining-1",
      "url": "https://www.restaurant.com/commonlink/dining-1"
    }
  ]
}

外送和外帶的網址不同

檔案名稱:actions_1697754089_0001.json

{
  "data": [
    {
      "actions": [
        {
          "food_ordering_info": {
            "service_type": "TAKEOUT"
          }
        }
      ],
      "entity_id": "dining-1",
      "link_id": "takeout-dining-1",
      "url": "https://www.restaurant.com/takeout/dining-1"
    },
    {
      "actions": [
        {
          "food_ordering_info": {
            "service_type": "DELIVERY"
          }
        }
      ],
      "entity_id": "dining-1",
      "link_id": "delivery-dining-1",
      "url": "https://www.restaurant.com/delivery/dining-1"
    }
  ]
}

描述元檔案

檔案名稱:actions_1697754089.filesetdesc.json

{
  "generation_timestamp": 1697754089,
  "name": "reservewithgoogle.action.v2",
  "data_file": [
    "actions_1697754089_0001.json",
    "actions_1697754089_0002.json"
  ]
}