写入 Salesforce Marketing Cloud 实体
先决条件
要写入数据的 Salesforce Marketing 对象。您需要指定对象的名称,例如
List
或Campaigns
,或下表中列出的任何其他实体。Salesforce Marketing Cloud 连接器支持三种写入操作:
INSERT
UPSERT
UPDATE
使用
UPDATE
和UPSERT
写入操作时,必须提供ID_FIELD_NAMES
选项来指定记录的外部 ID 字段。
目的地支持的实体:
实体 | 优先级 | 接口(REST、SOAP 等) | 是否可以插入 | 是否可以更新 | 是否可以更新插入 |
---|---|---|---|---|---|
市场活动 | P0 | REST | 是,单条 | 是,单条 | 否 |
内容素材 | P0 | REST | 是,单条、批量 | 是,单条 | 否 |
联系人 | P1 | REST | 是,单条 | 是,单条 | 否 |
域验证 | P1 | REST | 是,单条 | 是,单条、批量 | 否 |
事件通知回调 | P1 | REST | 是,单条 | 是,单条 | 否 |
事件通知订阅 | P1 | REST | 是,单条 | 是,单条 | N |
消息收发 | P1 | REST | 是,单条 | 否 | 否 |
对象嵌套标签 | P2 | REST | 是,单条 | 是,单条 | 否 |
种子列表 | P1 | REST | 是,单条 | 是,单条 | 否 |
设置 | P1 | REST | 是,单条 | 是,单条 | 否 |
数据扩展 | P0 | SOAP | 是,单条 | 是,单条 | 是,单条 |
电子邮件 | P0 | SOAP | 是,单条 | 是,单条 | N |
列表 | P0 | SOAP | 是,单条 | 是,单条 | 否 |
发送 | P0 | SOAP | 是,单条 | 否 | 否 |
订阅者 | P0 | SOAP | 是,单条 | 是,单条 | 否 |
REST 的 INSERT 操作示例:
salesforcemarketingcloud _write = glueContext.write_dynamic_frame.from_options( connection_type="salesforcemarketingcloud", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "Campaigns", "API_VERSION": "v1", "writeOperation" : "INSERT", "INSTANCE_URL": "https://**********************.rest.marketingcloudapis.com" }
SOAP 的 INSERT 操作示例:
salesforcemarketingcloud _write = glueContext.write_dynamic_frame.from_options( connection_type="salesforcemarketingcloud", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "List", "API_VERSION": "v1", "writeOperation" : "INSERT", "INSTANCE_URL": "https://**********************.rest.marketingcloudapis.com" }
REST 的 UPDATE 操作示例:
salesforcemarketingcloud _write = glueContext.write_dynamic_frame.from_options( connection_type="salesforcemarketingcloud", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "Campaigns", "API_VERSION": "v1", "writeOperation" : "UPDATE", "ID_FIELD_NAMES": "id", "INSTANCE_URL": "https://**********************.rest.marketingcloudapis.com" }
SOAP 的 UPDATE 操作示例:
salesforcemarketingcloud _write = glueContext.write_dynamic_frame.from_options( connection_type="salesforcemarketingcloud", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "List", "API_VERSION": "v1", "writeOperation" : "UPDATE", "ID_FIELD_NAMES": "id", "INSTANCE_URL": "https://**********************.rest.marketingcloudapis.com" }
SOAP 的 UPSERT 操作示例:
salesforcemarketingcloud _write = glueContext.write_dynamic_frame.from_options( connection_type="salesforcemarketingcloud", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "DataExtension/Insert-***E/6*******3", "API_VERSION": "v1", "writeOperation" : "UPSERT", "INSTANCE_URL": "https://**********************.rest.marketingcloudapis.com" }