從 HubSpot 實體讀取 - AWS Glue

從 HubSpot 實體讀取

必要條件

您要從中讀取的 HubSpot 物件。您將需要物件名稱,例如聯絡人或任務。下表顯示 Sync 來源支援的實體。

同步來源支援的實體

實體 API 版本 可以篩選 支援限制 支援排序依據 支援選取 * 支援分區
行銷活動 v1
公司 v3
聯絡人 v3
聯絡人清單 v1
交易 v3
CRM 管道 (交易管道) v1
電子郵件事件 v1
呼叫 v3
備註 v3
電子郵件 v3
會議 v3
任務 v3
郵政郵件 v3
自訂物件 v3
表單 v2
擁有者 v3
產品 v3
票證 v3
工作流程 v3
Associations v4
關聯標籤 v4

範例:

hubspot_read = glueContext.create_dynamic_frame.from_options( connection_type="hubspot", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "contact", "API_VERSION": "v3" }

非同步來源支援的實體

實體 API 版本 可以篩選 支援限制 支援排序依據 支援選取 * 支援分區
公司 v3
聯絡人 v3
交易 v3
呼叫 v3
備註 v3
電子郵件 v3
會議 v3
任務 v3
郵政郵件 v3
自訂物件 v3
產品 v3
票證 v3

範例:

hubspot_read = glueContext.create_dynamic_frame.from_options( connection_type="hubspot", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "contact", "API_VERSION": "v3", "TRANSFER_MODE": "ASYNC" }

HubSpot 實體和欄位詳細資訊

HubSpot API v4

實體 API 版本 欄位 資料類型 支援的運算子
關聯標籤 v4 category String N/A
typeId Integer N/A
label String N/A
Associations from Struct N/A
id String "="
清單 N/A
注意

針對 Associations 物件,若要擷取兩個物件之間的關聯,您需要在建立 AWS Glue 任務時,透過強制性篩選條件提供 'from Id' (第一個物件的 ID)。在這種情況下,如果您想要擷取多個 ID 的關聯,則必須在 where 子句中提供多個 ID。例如:若要擷取聯絡人 ID '1' 和 '151' 的Associations,您需要提供一個篩選條件,如 where id=1 AND id=151

HubSpot API v3

實體 欄位 資料類型 支援的運算子
Owner firstName String N/A
lastName String N/A
createdAt DateTime N/A
archived Boolean N/A
團隊 清單 N/A
id String N/A
userId Integer N/A
email String N/A
updatedAt DateTime N/A
工作流程 name String N/A
id Integer N/A
type String N/A
啟用 Boolean N/A
insertedAt Long N/A
updatedAt Long N/A
contactListIds Struct N/A
personaTagIds 清單 N/A

對於下列實體,HubSpot 會提供端點來動態擷取中繼資料,以便在每個實體的資料類型層級擷取運算子支援。

注意

DML_STATUS 是在執行時期新增至每個記錄的虛擬欄位,以判斷其在同步模式中的狀態 (CREATED/UPDATED)。非同步模式不支援 CONTAINS/LIKE 運算子。

實體 資料類型 支援的運算子
聯絡 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
公司 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
交易 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
票證 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
產品 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
自訂物件 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
Call Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
電子郵件 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
會議 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
注意 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
任務 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A
郵政郵件 Integer "=, !=, <, >, >=, <="
Long "=, !=, <, >, >=, <="
String "=, !=, LIKE"
日期 N/A
DateTime "between"
Boolean "="
清單 N/A
Struct N/A

HubSpot API v2

實體 欄位 資料類型 支援的運算子
表格 portalId Integer N/A
guid String N/A
name String N/A
方法 String N/A
cssClass String N/A
redirect String N/A
submitText String N/A
notifyRecipients String N/A
createdAt Long N/A
updatedAt Long N/A
ignoreCurrentValues Boolean N/A
deletable Boolean N/A
inlineMessage Boolean N/A
captchaEnabled Boolean N/A
cloneable Boolean N/A
formFieldGroups 清單 N/A
editable Boolean N/A
deletedAt Integer N/A
themeName String N/A
parentId Integer N/A
style String N/A
isPublished Boolean N/A
publishAt Integer N/A
unpublishAt Integer N/A
publishedAt Integer N/A
kickbackEmailWorkflowId String N/A
kickbackEmailsJson Integer N/A
customUid String N/A
createMarketableContact Boolean N/A
editVersion Integer N/A
thankYouMessageJson String N/A
themeColor String N/A
alwaysCreateNewCompany Boolean N/A
internalUpdatedAt Long N/A
businessUnitId Integer N/A
portableKey String N/A
paymentSessionTemplateIds 清單 N/A
selectedExternalOptions 清單 N/A

HubSpot API v1

實體 欄位 資料類型 支援的運算子
Campaign id Integer N/A
appId Integer N/A
appName String N/A
lastUpdatedTime Long N/A
Contact_List 動態 Boolean N/A
name String N/A
portalId Integer N/A
createdAt Long N/A
listId Integer N/A
updatedAt Long N/A
ListTypes String N/A
篩選條件 清單 N/A
authorId Integer N/A
metaData Struct N/A
archived Boolean N/A
ilsFilterBranch String N/A
filterIds 清單 N/A
limitExempt Boolean N/A
internal Boolean N/A
readOnly Boolean N/A
parentId Integer N/A
Email_Event id String N/A
type String N/A
recipient String N/A
portalId Integer N/A
appId Integer N/A
appName String N/A
emailCampaignId Long N/A
attempt Integer N/A
已建立 Long N/A
sentBy Struct N/A
smtpId String N/A
response String N/A
subject String N/A
cc 清單 N/A
bcc 清單 N/A
replyTo 清單 N/A
from String N/A
dropReason String N/A
dropMessage String N/A
browser Struct N/A
userAgent String N/A
持續時間 Long N/A
location Struct N/A
filteredEvent Boolean N/A
deviceType String N/A
suppressedReason String N/A
suppressedMessage String N/A
CRM_Pipeline pipelineId String N/A
createdAt Long N/A
updatedAt Long N/A
objectType String N/A
label String N/A
displayOrder Integer N/A
active Boolean N/A
階段 清單 N/A
objectTypeId String N/A
預設 Boolean N/A

分區查詢

如果想要在 Spark 中使用並行,可以提供其他 Spark 選項 PARTITION_FIELDLOWER_BOUNDUPPER_BOUNDNUM_PARTITIONS。使用這些參數,原始查詢會分區為可由 Spark 任務並行執行的子查詢的 NUM_PARTITIONS 數目。

  • PARTITION_FIELD:用來分區查詢的欄位名稱。

  • LOWER_BOUND:所選分區欄位的包含下限值。

    對於 DateTime 欄位,接受 ISO 格式的值。

    有效值的範例:

    “2024-01-01T10:00:00.115Z"
  • UPPER_BOUND:所選分區欄位的唯一上限值。

  • NUM_PARTITIONS:分區數目。

下表說明實體分區欄位支援詳細資訊:

實體名稱 分區欄位 資料類型
contact hs_object_id Long
createate、lastmodifieddate DateTime
company hs_object_id Long
createate、hs_lastmodifieddate DateTime
交易 hs_object_id Long
createate、hs_createdate、hs_lastmodifieddate DateTime
ticket hs_object_id Long
createate、hs_lastmodifieddate DateTime
產品 hs_object_id Long
createate、hs_lastmodifieddate DateTime
custom_object hs_object_id Long
createate、hs_lastmodifieddate DateTime
call hs_object_id Long
createate、hs_lastmodifieddate DateTime
email hs_object_id Long
createate、hs_lastmodifieddate DateTime
會議 hs_object_id Long
createate、hs_lastmodifieddate DateTime
note hs_object_id Long
createate、hs_lastmodifieddate DateTime
任務 hs_object_id Long
createate、hs_lastmodifieddate DateTime
postal_mail hs_object_id Long
createate、hs_lastmodifieddate DateTime

範例:

hubspot_read = glueContext.create_dynamic_frame.from_options( connection_type="hubspot", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "company", "API_VERSION": "v3", "PARTITION_FIELD": "hs_object_id" "LOWER_BOUND": "50" "UPPER_BOUND": "16726619290" "NUM_PARTITIONS": "10" }