操作 Feed

创建和上传操作 Feed

创建和上传操作 Feed 时,请务必按照以下说明操作:

  • 请遵循操作 Feed 中所述的操作数据文件规范。在两次上传操作之间,您必须使用唯一的操作数据文件名。建议在文件名中包含时间戳,例如 action1_1633621547.json
  • 在文件集描述符中,将 name 字段设置为 reservewithgoogle.action.v2。如需查看描述符文件的示例,请参阅描述符文件 JSON 示例。 您必须在两次上传之间使用唯一的描述符文件名。建议在文件名中包含时间戳,例如 action1_1633621547.filesetdesc.json。描述符文件必须上传到通用 SFTP Dropbox。
  • Feed 每天必须完全刷新到常规 SFTP Dropbox 中。
  • 您可以在合作伙伴门户的配置 > Feed 部分找到常规 Feed SFTP Dropbox 信息。
  • 选择 Feed Dropbox

  • 您可以在合作伙伴门户的 Feed > 历史记录部分找到通用 Feed 提取状态。

定义

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 [features.field_presence = IMPLICIT];
}

Action Feed 示例

仅提供送货服务

文件名:actions1_1697754089.json

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

仅提供外卖服务

文件名:actions1_1697754089.json

{
  "data": [
    {
      "actions": [{ "food_ordering_info": { "service_type": "TAKEOUT" } }],
      "entity_id": "entity002",
      "link_id": "takeout_link/entity002",
      "url": "https://www.restaurant.com/takeout/entity002"
    }
  ]
}

配送和外带

文件名:actions1_1697754089.json

{
  "data": [
    {
      "actions": [
        { "food_ordering_info": { "service_type": "DELIVERY" } },
        { "food_ordering_info": { "service_type": "TAKEOUT" } }
      ],
      "entity_id": "entity002",
      "link_id": "common_link/entity002",
      "url": "https://www.restaurant.com/commonlink/entity002"
    }
  ]
}

“送餐+外卖”其他网址

文件名:actions1_1697754089.json

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

描述符文件

文件名:actions1_1697754089.filesetdesc.json

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