创建和上传 Action 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 > 历史记录部分找到常规 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]; }
操作 Feed 示例
仅提供送货服务
文件名:actions1_1697754089.json
{ "data": [ { "actions": [{ "food_ordering_info": { "service_type": "DELIVERY" } }], "entity_id": "dining-1", "link_id": "delivery_link/dining-1", "url": "https://www.restaurant.com/delivery/dining-1" } ] }
仅提供外卖服务
文件名:actions1_1697754089.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" } ] }
外卖和外带
文件名:actions1_1697754089.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" } ] }
传送+导出网址不同
文件名:actions1_1697754089.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": [ { "food_ordering_info": { "service_type": "DELIVERY" } } ], "entity_id": "dining-1", "link_id": "delivery_link/dining-1", "url": "https://www.restaurant.com/delivery/dining-1" } ] }
描述符文件
文件名:actions1_1697754089.filesetdesc.json
{ "generation_timestamp": 1697754089, "name": "reservewithgoogle.action.v2", "data_file": ["actions1_1697754089.json"] }