# Append feedback

### Overview

Airship can store full feedback history for contact records. This is useful to show the sentiment of a particular guest, and can be used in campaigns whereby a broadcast could be suppressed if someone has left feedback recently (for example if you don't want to ask someone for feedback about a recent visit if they've already done so).

### Storing feedback

To store feedback, simply include a feedback object as you write a contact to us. We'll store a historic feedback record against the contact.

| Field       | Notes                                                                                                                                                                                                                                                                                                                                                                                     |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type_id`   | <p>1 = positive</p><p>2 = negative</p><p>3 = neutral</p><p>4 = unknown</p><p></p><p>You can also retrieve feedback types from the <code>/feedback/types</code> endpoint.</p>                                                                                                                                                                                                              |
| `source_id` | <p>1 = website</p><p>2 = facebook</p><p>3 = tablet</p><p>4 = email</p><p>5 = twitter</p>                                                                                                                                                                                                                                                                                                  |
| `unit_id`   | The unit\_id representing the physical location for which this feedback relates.                                                                                                                                                                                                                                                                                                          |
| `comments`  | Pass in a `type` to tag comment types together (e.g. "Toilets", "Service" etc) along with a text string for this comment.                                                                                                                                                                                                                                                                 |
| `ratings`   | <p>Pass in a ratings <code>category\_id</code> along with a value for this rating in the <code>rating\_text</code> field, and an optional <code>contact\_note</code>..</p><p></p><p>You can retrieve a list of categories from the <code>/feedback/categories</code> endpoint. However, commonly used ones are:</p><p></p><p>1 - Food</p><p>2 - Drink</p><p>3 - Service</p><p>4 - NPS</p> |

```javascript
"account_id": 3,
"email: "johnsmith@gmail.com",
//...etc...

"feedback": [
    {
      "type_id": 1, // positive
      "source_id": 1, // website
      "unit_id": 8775,
      "comments": [
        {
          "type": "Toilets",
          "note": "Recently cleared and sparkling!"
        },
        {
          "type": "Other Comments",
          "note": "Had a great time, will definitely return!"
        }
      ],
      "ratings": [
        {
          "category_id": 1, // Food
          "rating_text": "Excellent",
          "contact_note": "Food was super tasty."
        },
        {
          "category_id": 2, // Drink
          "rating_text": "Good",
          "contact_note": "Drinks were great, if a little expensive."
        },
        {
          "category_id": 3, // Service
          "rating_text": "Poor",
          "contact_note": "We had to wait 15 minutes to pay at the end."
        },
        {
          "category_id": 4, // NPS
          "rating_text": "8",
          "contact_note": "Would definitely recommend to a friend"
        }
      ]
    }
  ]
```
