写入 Salesforce Marketing Cloud 实体
先决条件
要写入数据的 Salesforce Marketing 对象。您需要指定对象的名称,例如
List或Campaigns,或下表中列出的任何其他实体。Salesforce Marketing Cloud 连接器支持三种写入操作:
INSERT
UPSERT
UPDATE
使用
UPDATE和UPSERT写入操作时,必须提供ID_FIELD_NAMES选项来指定记录的外部 ID 字段。
目的地支持的实体:
| 实体 | 优先级 | 接口(REST、SOAP 等) | 是否可以插入 | 是否可以更新 | 是否可以更新插入 |
|---|---|---|---|---|---|
| 市场活动 | P0 | REST | 是,单条 | 是,单条 | N |
| 内容素材 | P0 | REST | 是,单条、批量 | 是,单条 | N |
| 联系人 | P1 | REST | 是,单条 | 是,单条 | N |
| 域验证 | P1 | REST | 是,单条 | 是,单条、批量 | N |
| 事件通知回调 | P1 | REST | 是,单条 | 是,单条 | N |
| 事件通知订阅 | P1 | REST | 是,单条 | 是,单条 | N |
| 消息收发 | P1 | REST | 是,单条 | N | N |
| 对象嵌套标签 | P2 | REST | 是,单条 | 是,单条 | N |
| 种子列表 | P1 | REST | 是,单条 | 是,单条 | N |
| 设置 | P1 | REST | 是,单条 | 是,单条 | N |
| 数据扩展 | P0 | SOAP | 是,单条 | 是,单条 | 是,单条 |
| 电子邮件 | P0 | SOAP | 是,单条 | 是,单条 | N |
| 列表 | P0 | SOAP | 是,单条 | 是,单条 | N |
| 发送 | P0 | SOAP | 是,单条 | N | N |
| 订阅者 | P0 | SOAP | 是,单条 | 是,单条 | N |
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" } )