

# Reading from Kustomer entities
<a name="kustomer-reading-from-entities"></a>

**Prerequisite**

A Kustomer object you would like to read from. You will need the object name such as Brands or Cards. The following table shows the supported entities.

**Supported entities for source**:


| Entity | Can be filtered | Supports limit | Supports Order by | Supports Select \$1 | Supports partitioning | 
| --- | --- | --- | --- | --- | --- | 
| Brands | No | Yes | No | Yes | No | 
| Cards | No | Yes | No | Yes | No | 
| Chat Settings | No | No | No | Yes | No | 
| Companies | Yes | Yes | Yes | Yes | Yes | 
| Conversations | Yes | Yes | Yes | Yes | Yes | 
| Customers | Yes | Yes | Yes | Yes | Yes | 
| Customer Searches Pinned | No | Yes | No | Yes | No | 
| Customer Searches Position | No | No | No | Yes | No | 
| Email Hooks | No | Yes | No | Yes | No | 
| Web Hooks | No | Yes | No | Yes | No | 
| KB Articles | No | Yes | No | Yes | No | 
| KB Categories | No | Yes | No | Yes | No | 
| KB Forms | No | Yes | No | Yes | No | 
| KB Routes | No | Yes | No | Yes | No | 
| KB Tags | No | Yes | No | Yes | No | 
| KB Templates | No | Yes | No | Yes | No | 
| KB Themes | No | Yes | No | Yes | No | 
| Klasses | No | Yes | No | Yes | No | 
| KViews | No | Yes | No | Yes | No | 
| Messages | Yes | Yes | Yes | Yes | Yes | 
| Notes | Yes | Yes | Yes | Yes | Yes | 
| Notifications | No | Yes | No | Yes | No | 

**Example**:

```
Kustomer_read = glueContext.create_dynamic_frame.from_options(
    connection_type="kustomer",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "brands",
        "API_VERSION": "v1"
    }
```

## Kustomer entity and field details
<a name="kustomer-reading-from-entities-field-details"></a>

For more information about the entities and field details see:
+ [Brands](https://api.kustomerapp.com/v1/brands)
+ [Cards](https://api.kustomerapp.com/v1/cards)
+ [Chat Settings](https://api.kustomerapp.com/v1/chat/settings)
+ [Companies](https://api.kustomerapp.com/v1/companies)
+ [Conversations](https://api.kustomerapp.com/v1/conversations)
+ [Customers](https://api.kustomerapp.com/v1/customers)
+ [Customers Searches Pinned](https://api.kustomerapp.com/v1/customers/searches/pinned)
+ [Customer Searches Positions](https://api.kustomerapp.com/v1/customers/searches/positions)
+ [Hooks Email](https://api.kustomerapp.com/v1/hooks/email)
+ [Hooks Web](https://api.kustomerapp.com/v1/hooks/web)
+ [KB Articles](https://api.kustomerapp.com/v1/kb/articles)
+ [KB Categories](https://api.kustomerapp.com/v1/kb/categories)
+ [KB Forms]( https://api.kustomerapp.com/v1/kb/forms)
+ [KB Routes](https://api.kustomerapp.com/v1/kb/routes)
+ [KB Tags](https://api.kustomerapp.com/v1/kb/tags)
+ [KB Templates](https://api.kustomerapp.com/v1/kb/templates)
+ [KB Themes](https://api.kustomerapp.com/v1/kb/themes)
+ [Klasses](https://api.kustomerapp.com/v1/klasses)
+ [Kviews](https://api.kustomerapp.com/v1/kviews)
+ [Messages](https://api.kustomerapp.com/v1/messages)
+ [Notes](https://api.kustomerapp.com/v1/notes)
+ [Notifications](https://api.kustomerapp.com/v1/notifications)

Kustomer API v1

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/glue/latest/dg/kustomer-reading-from-entities.html)

## Partitioning queries
<a name="kustomer-reading-from-partitioning"></a>

**Field-based partitioning**

You can provide the additional Spark options `PARTITION_FIELD`, `LOWER_BOUND`, `UPPER_BOUND`, and `NUM_PARTITIONS` if you want to utilize concurrency in Spark. With these parameters, the original query would be split into `NUM_PARTITIONS` number of sub-queries that can be executed by Spark tasks concurrently.
+ `PARTITION_FIELD`: the name of the field to be used to partition the query.
+ `LOWER_BOUND`: an **inclusive** lower bound value of the chosen partition field.

  For the DateTime field, we accept the value in ISO format.

  Example of valid value:

  ```
  "2023-01-15T11:18:39.205Z"
  ```
+ `UPPER_BOUND`: an **exclusive** upper bound value of the chosen partition field.
+ `NUM_PARTITIONS`: the number of partitions.

Entity-wise partitioning field support details are captured in the following table:

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/glue/latest/dg/kustomer-reading-from-entities.html)

Example:

```
Kustomer_read = glueContext.create_dynamic_frame.from_options(
    connection_type="kustomer",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "conversation",
        "API_VERSION": "v1",
        "PARTITION_FIELD": "createdAt"
        "LOWER_BOUND": "2023-01-15T11:18:39.205Z"
        "UPPER_BOUND": "2023-02-15T11:18:39.205Z"
        "NUM_PARTITIONS": "2"
    }
```