# Integration Specifications

## Integration Overview

Thankful is an A.I.-powered customer service software for retail and e-commerce businesses, using Natural Language Processing (NLP) to understand what customers want and deliver the service they need.

This document provides context on what kind of data is being gathered through this extractor, which endpoints that data is coming from, and how the extracted tables relate to each other.&#x20;

## **Integration Availability**

This integration is available for:

* Enterprise

## API Endpoints

The Daasity Thankful extractor is built based on this [Thankful API Documentation](https://docs.thankful.ai/api). The following endpoints are used by Daasity to replicate data from Thankful:

* [Actions](https://docs.thankful.ai/api)
* [Handoffs](https://docs.thankful.ai/api)
* [Savings](https://docs.thankful.ai/api)
* [Tickets](https://docs.thankful.ai/api)

## Entity Relationship Diagram (ERD)

[Click here to view the ERD for the Daasity Thankful integration](https://lucid.app/documents/embedded/6bb94dd2-0a7c-4aa4-9a12-bd3d6bd4114e) illustrating the different tables and keys to join across tables.

## Thankful Schema

The Daasity Thankful extractor creates these tables using the endpoints and replication methods listed. The data is mapped from source API endpoint to the table based on the mapping logic outlined in each table.

* [Action Names](#action-names)
* [Top Actions](#top-actions)
* [Handoff Metrics](#handoff-metrics)
* [Recommendations](#recommendations)
* [Savings](#savings)
* [Ticket Metrics](#ticket-metrics)

### **Action Names**

* Endpoint: [Actions](https://docs.thankful.ai/api)
* Update Method: UPSERT
* Table Name: \[`thankful.action_names`]

| JSON Element                           | Database Column |
| -------------------------------------- | --------------- |
| id                                     | action\_id      |
| name                                   | action\_name    |
| Daasity: current timestamp             | created\_at     |
| Daasity: account\_id                   | \_account\_id   |
| Daasity: MD5(id)                       | \_\_sync\_key   |
| Daasity: timestamp when loaded into DB | loaded\_at      |

### **Top Actions**

* Endpoint: [Tickets](https://docs.thankful.ai/api)
* Update Method: UPSERT
* Table Name: \[`thankful.top_actions`]

| JSON Element                                  | Database Column |
| --------------------------------------------- | --------------- |
| MD5(TopActions::ID + 1.days.ago.utc)          | top\_action\_id |
| TopActions::ID                                | action\_id      |
| TopActions::Capture                           | capture\_count  |
| TopActions::Resolve                           | resolve\_count  |
| TopActions::Pending                           | pending\_count  |
| TopActions::Transfer                          | transfer\_count |
| TopActions::Handoff                           | handoff\_count  |
| TopActions::Skip                              | skip\_count     |
| TopActions::Enabled                           | is\_active      |
| Daasity: 1.days.ago.utc                       | created\_at     |
| Daasity: account\_id                          | \_account\_id   |
| Daasity: MD5(TopActions::ID + 1.days.ago.utc) | \_\_sync\_key   |
| Daasity: timestamp when loaded into DB        | loaded\_at      |

### **Handoff Metrics**

* Endpoint: [Handoffs](https://docs.thankful.ai/api)
* Update Method: UPSERT
* Table Name: \[`thankful.handoff_metrics`]

| JSON Element                                       | Database Column               |
| -------------------------------------------------- | ----------------------------- |
| MD5(ActionID + type::ID + 1.days.ago.utc)          | transfer\_handoff\_metric\_id |
| ActionID                                           | action\_id                    |
| type::ID                                           | type\_id                      |
| type::Cause                                        | handoff\_cause                |
| type::ActionHandoffCount                           | handoff\_count                |
| Daasity: 1.days.ago.utc                            | created\_at                   |
| Daasity: account\_id                               | \_account\_id                 |
| Daasity: MD5(ActionID + type::ID + 1.days.ago.utc) | \_\_sync\_key                 |
| Daasity: timestamp when loaded into DB             | \_\_synced\_at                |

### **Recommendations**

* Endpoint: [Tickets](https://docs.thankful.ai/api)
* Update Method: UPSERT
* Table Name: \[`thankful.recommendations`]

| JSON Element                                             | Database Column    |
| -------------------------------------------------------- | ------------------ |
| MD5(Recommendations::ActionID + 1.days.ago.utc)          | recommendation\_id |
| Recommendations::ActionID                                | action\_id         |
| Recommendations::Impact                                  | recommendation     |
| Daasity: 1.days.ago.utc                                  | created\_at        |
| Daasity: account\_id                                     | \_account\_id      |
| Daasity: MD5(Recommendations::ActionID + 1.days.ago.utc) | \_\_sync\_key      |
| Daasity: timestamp when loaded into DB                   | \_\_synced\_at     |

### **Savings**

* Endpoint: [Savings](https://docs.thankful.ai/api)
* Update Method: UPSERT
* Table Name: \[`thankful.savings`]

| JSON Element                           | Database Column |
| -------------------------------------- | --------------- |
| savings::Hours                         | hours\_saved    |
| Daasity: 1.days.ago.utc                | created\_at     |
| Daasity: account\_id                   | \_account\_id   |
| Daasity: MD5(1.days.ago.utc)           | \_\_sync\_key   |
| Daasity: timestamp when loaded into DB | \_\_synced\_at  |

### **Ticket Metrics**

* Endpoint: [Tickets](https://docs.thankful.ai/api)
* Update Method: UPSERT
* Table Name: \[`thankful.ticket_metrics`]

| JSON Element                           | Database Column    |
| -------------------------------------- | ------------------ |
| TicketsOverTime::ReceivedTotal         | received\_count    |
| TicketsOverTime::CapturedTotal         | captured\_count    |
| TicketsOverTime::TransferredTotal      | transferred\_count |
| TicketsOverTime::ResolvedTotal         | resolved\_count    |
| Daasity: 1.days.ago.utc                | created\_at        |
| Daasity: account\_id                   | \_account\_id      |
| Daasity: MD5(1.days.ago.utc)           | \_\_sync\_key      |
| Daasity: timestamp when loaded into DB | \_\_synced\_at     |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.daasity.com/core-concepts/data-integrations/setup-guides/digital-integrations/thankful/integration-specifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
