

# Reading from Intercom entities
<a name="intercom-reading-from-entities"></a>

 **Prerequisites** 
+  An Intercom object you would like to read from. Refer to the supported entities table below to check the available entities. 

 **Supported entities** 


| Entity | API\$1Version | Can be Filtered | Supports Limit | Supports Order By | Supports Select \$1 | Supports Partitioning | 
| --- | --- | --- | --- | --- | --- | --- | 
| Admins | v2.5 | No | No | No | Yes | No | 
| Companies | v2.5 | No | Yes | No | Yes | No | 
| Conversations | v2.5 | Yes | Yes | Yes | Yes | Yes | 
| Data Attributes | v2.5 | No | No | No | Yes | No | 
| Contacts | v2.5 | Yes | Yes | Yes | Yes | Yes | 
| Segments | v2.5 | No | No | No | Yes | No | 
| Tags | v2.5 | No | No | No | Yes | No | 
| Teams | v2.5 | No | No | No | Yes | No | 

 **Example** 

```
Intercom_read = glueContext.create_dynamic_frame.from_options(
    connection_type="Intercom",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "company",
        "API_VERSION": "V2.5"
    }
)
```

 **Intercom entity and field details** 


| Entity | Field | Data Type | Supported Operators | 
| --- | --- | --- | --- | 
| Admins | type | String | NA | 
| Admins | id | String | NA | 
| Admins | avatar | Struct | NA | 
| Admins | name | String | NA | 
| Admins | email | String | NA | 
| Admins | away\$1mode\$1enabled | Boolean | NA | 
| Admins | away\$1mode\$1reassign | Boolean | NA | 
| Admins | has\$1inbox\$1seat | Boolean | NA | 
| Admins | teams\$1ids | List | NA | 
| Admins | job\$1title | String | NA | 
| Companies | type | String | NA | 
| Companies | id | String | NA | 
| Companies | app\$1id | String | NA | 
| Companies | created\$1at | DateTime | NA | 
| Companies | remote\$1created\$1at | DateTime | NA | 
| Companies | updated\$1at | DateTime | NA | 
| Companies | last\$1request\$1at | DateTime | NA | 
| Companies | plan | Struct | NA | 
| Companies | company\$1id | String | NA | 
| Companies | name | String | NA | 
| Companies | custom\$1attributes | Struct | NA | 
| Companies | session\$1count | Integer | NA | 
| Companies | monthly\$1spend | Integer | NA | 
| Companies | user\$1count | Integer | NA | 
| Companies | industry | String | NA | 
| Companies | size | Integer | NA | 
| Companies | website | String | NA | 
| Companies | tags | Struct | NA | 
| Companies | segments | Struct | NA | 
| Contacts | id | String | EQUAL\$1TO.NOT\$1EQUAL\$1TO | 
| Contacts | type | String | NA | 
| Contacts | workspace\$1id | String | NA | 
| Contacts | external\$1id | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | role | String | EQUAL\$1TO.NOT\$1EQUAL\$1TO | 
| Contacts | email | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | phone | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | name | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | avatar | String | NA | 
| Contacts | owner\$1id | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | social\$1profiles | Struct | NA | 
| Contacts | has\$1hard\$1bounced | Boolean | EQUAL\$1TO | 
| Contacts | marked\$1email\$1as\$1spam | Boolean | EQUAL\$1TO | 
| Contacts | unsubscribed\$1from\$1emails | Boolean | EQUAL\$1TO | 
| Contacts | created\$1at | DateTime | EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | updated\$1at | DateTime | EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | signed\$1up\$1at | DateTime | EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | last\$1seen\$1at | DateTime | EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | last\$1replied\$1at | DateTime | EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | last\$1contacted\$1at | DateTime | EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | last\$1email\$1opened\$1at | DateTime | EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | last\$1email\$1clicked\$1at | DateTime | EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Contacts | language\$1override | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | browser | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | browser\$1version | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | browser\$1language | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | os | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | location | Struct | NA | 
| Contacts | location\$1country | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | location\$1region | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | location\$1city | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | android\$1app\$1name | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | android\$1app\$1version | String | NA | 
| Contacts | android\$1device | String | NA | 
| Contacts | android\$1os\$1version | String | NA | 
| Contacts | android\$1sdk\$1version | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | android\$1last\$1seen\$1at | Date | NA | 
| Contacts | ios\$1app\$1name | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | ios\$1app\$1version | String | NA | 
| Contacts | ios\$1device | String | NA | 
| Contacts | ios\$1os\$1version | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | ios\$1sdk\$1version | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Contacts | ios\$1last\$1seen\$1at | DateTime | NA | 
| Contacts | custom\$1attributes | Struct | NA | 
| Contacts | tags | Struct | NA | 
| Contacts | notes | Struct | NA | 
| Contacts | companies | Struct | NA | 
| Contacts | unsubscribed\$1from\$1sms | Boolean | NA | 
| Contacts | sms\$1consent | Boolean | NA | 
| Contacts | opted\$1out\$1subscription\$1types | Struct | NA | 
| Contacts | referrer | String | NA | 
| Contacts | utm\$1campaign | String | NA | 
| Contacts | utm\$1content | String | NA | 
| Contacts | utm\$1medium | String | NA | 
| Contacts | utm\$1source | String | NA | 
| Contacts | utm\$1term | String | NA | 
| Conversations | type | String | NA | 
| Conversations | id | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | created\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | updated\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | source | Struct | NA | 
| Conversations | source\$1id | String | EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | source\$1type | String | EQUAL\$1TO, NOT\$1EQUAL\$1TO, | 
| Conversations | source\$1delivered\$1as | String | EQUAL\$1TO, NOT\$1EQUAL\$1TO, | 
| Conversations | source\$1subject | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | source\$1body | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | source\$1author\$1id | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | source\$1author\$1type | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | source\$1author\$1name | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | source\$1author\$1email | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | source\$1url | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | contacts | Struct | NA | 
| Conversations | teammates | Struct | NA | 
| Conversations | title | String | NA | 
| Conversations | admin\$1assignee\$1id | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | team\$1assignee\$1id | Integer | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | custom\$1attributes | Struct | NA | 
| Conversations | open | Boolean | EQUAL\$1TO | 
| Conversations | state | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | read | Boolean | EQUAL\$1TO | 
| Conversations | waiting\$1since | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | snoozed\$1until | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | tags | Struct | NA | 
| Conversations | first\$1contact\$1reply | Struct | NA | 
| Conversations | priority | String | EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | topics | Struct | NA | 
| Conversations | sla\$1applied | Struct | NA | 
| Conversations | conversation\$1rating | Struct | NA | 
| Conversations | conversation\$1rating\$1requested\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | conversation\$1rating\$1replied\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | conversation\$1rating\$1score | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | conversation\$1rating\$1remark | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | conversation\$1rating\$1contact\$1id | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | conversation\$1rating\$1admin\$1id | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | statistics | Struct | NA | 
| Conversations | statistics\$1time\$1to\$1assignment | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1time\$1to\$1admin\$1reply | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1time\$1to\$1first\$1close | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1time\$1to\$1last\$1close | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1median\$1time\$1to\$1reply | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1first\$1contact\$1reply\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1first\$1assignment\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1first\$1admin\$1reply\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1first\$1close\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1last\$1assignment\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1last\$1assignment\$1admin\$1reply\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1last\$1contact\$1reply\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1last\$1admin\$1reply\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1last\$1close\$1at | DateTime | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1last\$1closed\$1by\$1id | String | CONTAINS, EQUAL\$1TO, NOT\$1EQUAL\$1TO | 
| Conversations | statistics\$1count\$1reopens | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1count\$1assignments | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | statistics\$1count\$1conversation\$1parts | Integer | EQUAL\$1TO, NOT\$1EQUAL\$1TO, GREATER\$1THAN, LESS\$1THAN | 
| Conversations | conversation\$1parts | List | NA | 
| Data Attributes | id | Integer | NA | 
| Data Attributes | type | String | NA | 
| Data Attributes | model | String | NA | 
| Data Attributes | name | String | NA | 
| Data Attributes | full\$1name | String | NA | 
| Data Attributes | label | String | NA | 
| Data Attributes | description | String | NA | 
| Data Attributes | data\$1type | String | NA | 
| Data Attributes | options | List | NA | 
| Data Attributes | api\$1writable | Boolean | NA | 
| Data Attributes | ui\$1writable | Boolean | NA | 
| Data Attributes | custom | Boolean | NA | 
| Data Attributes | archived | Boolean | NA | 
| Data Attributes | created\$1at | Boolean | NA | 
| Data Attributes | updated\$1at | DateTime | NA | 
| Data Attributes | admin\$1id | String | NA | 
| Segments | type | String | NA | 
| Segments | id | String | NA | 
| Segments | name | String | NA | 
| Segments | created\$1at | DateTime | NA | 
| Segments | updated\$1at | DateTime | NA | 
| Segments | person\$1type | String | NA | 
| Segments | count | Integer | NA | 
| Tags | type | String | NA | 
| Tags | id | String | NA | 
| Tags | name | String | NA | 
| Teams | type | String | NA | 
| Teams | id | String | NA | 
| Teams | name | String | NA | 
| Teams | admin\$1ids | List | NA | 

 **Partitioning queries** 

 Additional spark options `PARTITION_FIELD`, `LOWER_BOUND`, `UPPER_BOUND`, `NUM_PARTITIONS` can be provided 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 query. 
+  `LOWER_BOUND`: an inclusive lower bound value of the chosen partition field. 

   For date, we accept the Spark date format used in Spark SQL queries. Example of valid values: `"2024-02-06"`. 
+  `UPPER_BOUND`: an exclusive upper bound value of the chosen partition field. 
+  `NUM_PARTITIONS`: number of partitions. 

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


| Entity Name | Partitioning Field | Data Type | 
| --- | --- | --- | 
| Contacts | created\$1at, updated\$1at,last\$1seen\$1at | DateTime | 
| Conversations | id | Integer | 
| Conversations | created\$1at, updated\$1at | DateTime | 

 **Example** 

```
Intercom_read = glueContext.create_dynamic_frame.from_options(
    connection_type="Intercom",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "conversation",
        "API_VERSION": "V2.5",
        "PARTITION_FIELD": "created_at"
        "LOWER_BOUND": "2022-07-13T07:55:27.065Z"
        "UPPER_BOUND": "2022-08-12T07:55:27.065Z"
        "NUM_PARTITIONS": "2"
    }
)
```