Feed Tindakan

Membuat dan mengupload feed tindakan

Saat Anda membuat dan mengupload feed tindakan, pastikan Anda mengikuti petunjuk berikut:

  • Ikuti spesifikasi yang dijelaskan dalam feed tindakan untuk file data tindakan. Anda harus menggunakan nama file data tindakan unik di antara upload. Sebaiknya sertakan stempel waktu dalam nama file, misalnya, action1_1633621547.json.
  • Dalam deskripsi kumpulan file, tetapkan kolom name ke reservewithgoogle.action.v2. Untuk contoh file deskriptor, lihat Contoh JSON file deskriptor. Anda harus menggunakan nama file deskriptor yang unik di antara upload. Sebaiknya sertakan stempel waktu dalam nama file, misalnya, action1_1633621547.filesetdesc.json. File deskriptor harus diupload ke dropbox SFTP generik.
  • Feed harus diupload ke dropbox SFTP generik setiap hari saat dimuat ulang sepenuhnya.
  • Anda dapat menemukan info dropbox SFTP feed umum di bagian Konfigurasi > Feed pada portal partner.
  • Memilih dropbox feed

  • Anda dapat menemukan status penyerapan feed umum di bagian Feed > Histori pada portal partner.

Definisi

Definisi ActionFeed

message ActionFeed {
  repeated ActionDetail data = 1;
}

Definisi ActionDetail

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

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

Definisi tindakan

// 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;
  }
}

Definisi Info Pemesanan Makanan

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

  ServiceType service_type = 1 [features.field_presence = IMPLICIT];
}

Contoh Feed Tindakan

Hanya pesan antar

Nama file : 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"
    }
  ]
}

Hanya bisa bawa pulang

Nama file : 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"
    }
  ]
}

Pesan antar dan bawa pulang

Nama file : 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"
    }
  ]
}

URL berbeda untuk pesan antar+bawa pulang

Nama file : 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"
    }
  ]
}

File deskriptor

Nama file : actions1_1697754089.filesetdesc.json

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