## Create and upload action feeds

When creating and uploading action feeds, follow these instructions:

- Follow the spec described in the [action feed](https://developers.google.com/actions-center/verticals/ordering/redirect/reference/feeds/action-feed#action-definition) for action data files. We recommend using unique action data file names for each upload. Include a timestamp in the filename, for example, `action_1633621547.json`.
- In the fileset descriptor, set the `name` field to `reservewithgoogle.action.v2`. For an example of the descriptor file, refer to the [JSON sample](https://developers.google.com/actions-center/verticals/ordering/redirect/reference/feeds/action-feed#descriptor-file). We recommend using unique descriptor file names for each upload. Include a timestamp in the filename, for example, `action_1633621547.filesetdesc.json`. The descriptor file must be uploaded to the generic SFTP server.
- Upload feeds to the generic SFTP server daily as full refreshes.
- You can find SFTP server details in the [Configuration \> Feeds](https://partnerdash.google.com/apps/reservewithgoogle/configuration/feeds) section of the Partner Portal.

![Selecting feed servers](https://developers.google.com/static/actions-center/images/menus-integration-generic-feeds.png)
Selecting feed servers in the Partner Portal
- View feed ingestion status in the [Ingestion \> History](https://partnerdash.google.com/apps/reservewithgoogle/dashboards/feeds) section of the Partner Portal.

## Definitions

> [!NOTE]
> **Note:** The action feed spec defines in protobuffer format as follows, however we recommend you to upload the feeds in JSON format. For more information, refer to [JSON sample feeds](https://developers.google.com/actions-center/verticals/ordering/redirect/reference/feeds/action-feed#samples).

### ActionFeed definition

```protobuf
message ActionFeed {
  option features.(pb.java).nest_in_file_class = YES;

  repeated ActionDetail data = 1;
}
```

### ActionDetail definition

```protobuf
message ActionDetail {
  option features.(pb.java).nest_in_file_class = YES;

  string entity_id = 2;
  string link_id = 3;

  // Deep link for action detail
  string url = 4;

  // The actions that can be performed using this deep link. At least one
  // Action must be specified.
  repeated Action actions = 1;
}
```

### Action definition

```protobuf
// Information about an Action which could be performed.
message Action {
  option features.(pb.java).nest_in_file_class = YES;

  // Deprecated fields not to be reused.
  reserved 1;

  oneof action_info {
    FoodOrderingInfo food_ordering_info = 3;

  }
}
```

### FoodOrderingInfo definition

```protobuf
message FoodOrderingInfo {
  option features.(pb.java).nest_in_file_class = YES;

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

      ;
}
```

## Action Feed samples

<br />

### Delivery only

#### Filename : actions_1697754089_0001.json

```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"
    }
  ]
}
```

### Takeout only

#### Filename : actions_1697754089_0001.json

```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"
    }
  ]
}
```

### Delivery and takeout

#### Filename : actions_1697754089_0001.json

```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"
    }
  ]
}
```

### Delivery+takeout different URL

#### Filename : actions_1697754089_0001.json

```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"
    }
  ]
}
```

### Descriptor file

#### Filename : actions_1697754089.filesetdesc.json

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