Reading from Intercom entities
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_Version | Can be Filtered | Supports Limit | Supports Order By | Supports Select * | 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 | String | NA | |
| Admins | away_mode_enabled | Boolean | NA |
| Admins | away_mode_reassign | Boolean | NA |
| Admins | has_inbox_seat | Boolean | NA |
| Admins | teams_ids | List | NA |
| Admins | job_title | String | NA |
| Companies | type | String | NA |
| Companies | id | String | NA |
| Companies | app_id | String | NA |
| Companies | created_at | DateTime | NA |
| Companies | remote_created_at | DateTime | NA |
| Companies | updated_at | DateTime | NA |
| Companies | last_request_at | DateTime | NA |
| Companies | plan | Struct | NA |
| Companies | company_id | String | NA |
| Companies | name | String | NA |
| Companies | custom_attributes | Struct | NA |
| Companies | session_count | Integer | NA |
| Companies | monthly_spend | Integer | NA |
| Companies | user_count | 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_TO.NOT_EQUAL_TO |
| Contacts | type | String | NA |
| Contacts | workspace_id | String | NA |
| Contacts | external_id | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | role | String | EQUAL_TO.NOT_EQUAL_TO |
| Contacts | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO | |
| Contacts | phone | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | name | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | avatar | String | NA |
| Contacts | owner_id | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | social_profiles | Struct | NA |
| Contacts | has_hard_bounced | Boolean | EQUAL_TO |
| Contacts | marked_email_as_spam | Boolean | EQUAL_TO |
| Contacts | unsubscribed_from_emails | Boolean | EQUAL_TO |
| Contacts | created_at | DateTime | EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | updated_at | DateTime | EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | signed_up_at | DateTime | EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | last_seen_at | DateTime | EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | last_replied_at | DateTime | EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | last_contacted_at | DateTime | EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | last_email_opened_at | DateTime | EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | last_email_clicked_at | DateTime | EQUAL_TO, GREATER_THAN, LESS_THAN |
| Contacts | language_override | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | browser | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | browser_version | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | browser_language | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | os | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | location | Struct | NA |
| Contacts | location_country | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | location_region | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | location_city | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | android_app_name | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | android_app_version | String | NA |
| Contacts | android_device | String | NA |
| Contacts | android_os_version | String | NA |
| Contacts | android_sdk_version | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | android_last_seen_at | Date | NA |
| Contacts | ios_app_name | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | ios_app_version | String | NA |
| Contacts | ios_device | String | NA |
| Contacts | ios_os_version | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | ios_sdk_version | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Contacts | ios_last_seen_at | DateTime | NA |
| Contacts | custom_attributes | Struct | NA |
| Contacts | tags | Struct | NA |
| Contacts | notes | Struct | NA |
| Contacts | companies | Struct | NA |
| Contacts | unsubscribed_from_sms | Boolean | NA |
| Contacts | sms_consent | Boolean | NA |
| Contacts | opted_out_subscription_types | Struct | NA |
| Contacts | referrer | String | NA |
| Contacts | utm_campaign | String | NA |
| Contacts | utm_content | String | NA |
| Contacts | utm_medium | String | NA |
| Contacts | utm_source | String | NA |
| Contacts | utm_term | String | NA |
| Conversations | type | String | NA |
| Conversations | id | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | created_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | updated_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | source | Struct | NA |
| Conversations | source_id | String | EQUAL_TO, NOT_EQUAL_TO |
| Conversations | source_type | String | EQUAL_TO, NOT_EQUAL_TO, |
| Conversations | source_delivered_as | String | EQUAL_TO, NOT_EQUAL_TO, |
| Conversations | source_subject | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | source_body | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | source_author_id | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | source_author_type | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | source_author_name | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | source_author_email | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | source_url | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | contacts | Struct | NA |
| Conversations | teammates | Struct | NA |
| Conversations | title | String | NA |
| Conversations | admin_assignee_id | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | team_assignee_id | Integer | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | custom_attributes | Struct | NA |
| Conversations | open | Boolean | EQUAL_TO |
| Conversations | state | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | read | Boolean | EQUAL_TO |
| Conversations | waiting_since | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | snoozed_until | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | tags | Struct | NA |
| Conversations | first_contact_reply | Struct | NA |
| Conversations | priority | String | EQUAL_TO, NOT_EQUAL_TO |
| Conversations | topics | Struct | NA |
| Conversations | sla_applied | Struct | NA |
| Conversations | conversation_rating | Struct | NA |
| Conversations | conversation_rating_requested_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | conversation_rating_replied_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | conversation_rating_score | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | conversation_rating_remark | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | conversation_rating_contact_id | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | conversation_rating_admin_id | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | statistics | Struct | NA |
| Conversations | statistics_time_to_assignment | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_time_to_admin_reply | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_time_to_first_close | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_time_to_last_close | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_median_time_to_reply | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_first_contact_reply_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_first_assignment_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_first_admin_reply_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_first_close_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_last_assignment_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_last_assignment_admin_reply_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_last_contact_reply_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_last_admin_reply_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_last_close_at | DateTime | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_last_closed_by_id | String | CONTAINS, EQUAL_TO, NOT_EQUAL_TO |
| Conversations | statistics_count_reopens | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_count_assignments | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | statistics_count_conversation_parts | Integer | EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN |
| Conversations | conversation_parts | 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_name | String | NA |
| Data Attributes | label | String | NA |
| Data Attributes | description | String | NA |
| Data Attributes | data_type | String | NA |
| Data Attributes | options | List | NA |
| Data Attributes | api_writable | Boolean | NA |
| Data Attributes | ui_writable | Boolean | NA |
| Data Attributes | custom | Boolean | NA |
| Data Attributes | archived | Boolean | NA |
| Data Attributes | created_at | Boolean | NA |
| Data Attributes | updated_at | DateTime | NA |
| Data Attributes | admin_id | String | NA |
| Segments | type | String | NA |
| Segments | id | String | NA |
| Segments | name | String | NA |
| Segments | created_at | DateTime | NA |
| Segments | updated_at | DateTime | NA |
| Segments | person_type | 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_ids | 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_at, updated_at,last_seen_at | DateTime |
| Conversations | id | Integer |
| Conversations | created_at, updated_at | 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" } )