

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 创建客户数据并将其摄取到 Customer Profile 中
<a name="customer-profiles-object-type-mappings"></a>

您可以使用 Amazon S3 定义来自任何源的数据，无需自定义或预先构建的集成，即可无缝丰富客户资料。例如，假设您想向座席提供相关的购买历史信息。您可以将购买交易数据从内部应用程序导入到 S3 上的电子表格文件中，然后将其链接到客户资料。

要进行此设置，您需要定义一个[对象类型映射](customer-profiles-object-type-mapping.md)，用于描述自定义资料对象的外观。此映射定义如何使用数据中的字段来填充标准资料中的字段，或者如何能够使用它将数据分配给特定资料。

创建对象类型映射后，您可以使用 [PutProfileObject](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutProfileObject.html)API 将自定义配置文件数据从 CRM 上传到自定义配置文件对象。

**注意**  
Customer Profiles 不支持从包含点表示法的 CSV 标题中摄取数据。

有关 Customer Profiles 访问 Amazon S3 存储桶中的数据以进行数据映射所需的 IAM 权限列表，请参阅 [Amazon Connect Customer Profiles 定义的操作](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonconnectcustomerprofiles.html#amazonconnectcustomerprofiles-actions-as-permissions)中的表 `PutProfileObject`。

## 客户配置文件摄取
<a name="customer-profiles-ingesting-account-based-profiles"></a>

**摄取基于账户的配置文件**

1. 将数据文件上传到 S3。对账户配置文件中引用的配置文件和账户配置文件本身的摄取应分开进行。

1. 用于账户配置文件摄取的新文件应包含新的属性：配置文件类型以及电子邮件和电话的互动偏好。

1. 使用 AWS 管理控制台将文件从 S3 摄取到客户配置文件

   **示例配置文件（在以下基于账户的配置文件中引用）CSV**    
[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_cn/connect/latest/adminguide/customer-profiles-object-type-mappings.html)

   **基于账户的配置文件 CSV 示例**    
[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_cn/connect/latest/adminguide/customer-profiles-object-type-mappings.html)

   **电子邮件互动偏好示例**：

   ```
   [ 
    {"KeyName": "CustomerId", "KeyValue": "456", "ContactType": "PersonalEmailAddress"}, 
    {"KeyName": "CustomerId", "KeyValue": "789", "ContactType": "PersonalEmailAddress"} 
   ]
   ```

   **电话互动偏好示例**：

   ```
   [ 
    {"KeyName": "CustomerId", "KeyValue": "456", "ContactType": "PhoneNumber"}, 
    {"KeyName": "CustomerId", "KeyValue": "789", "ContactType": "PhoneNumber"} 
   ]
   ```
**注意**  
对于 **ProfileType**`PROFILE`，您可以使用相同的方法获取和添加参与偏好。

1. 创建两个数据映射：一个用于子配置文件，一个用于基于账户的配置文件。  
![创建两个数据来源集成，每个集成将基于所描述的关系创建一个映射。例如，账户/配置文件。](http://docs.aws.amazon.com/zh_cn/connect/latest/adminguide/images/customer-profiles-ingesting-account-based-profiles-1.png)

1. 接下来，映射客户配置文件属性。记下名为 `ProfileType` 的目标。  
![接下来，映射客户配置文件属性。记下呼叫的目的地 ProfileType。](http://docs.aws.amazon.com/zh_cn/connect/latest/adminguide/images/customer-profiles-ingesting-account-based-profiles-2.png)

   **摄取在基于账户的配置文件中引用的配置文件的对象类型映射示例**

   ```
   {
       "AllowProfileCreation": true,
       "Description": "Standard Profile Object Type",
       "Fields": {
           "FirstName": {
               "ContentType": "STRING",
               "Source": "_source.FirstName",
               "Target": "_profile.FirstName"
           },
           "LastName": {
               "ContentType": "STRING",
               "Source": "_source.LastName",
               "Target": "_profile.LastName"
           },
           "PhoneNumber": {
               "ContentType": "PHONE_NUMBER",
               "Source": "_source.PhoneNumber",
               "Target": "_profile.PhoneNumber"
           },
           "PersonalEmailAddress": {
               "ContentType": "EMAIL_ADDRESS",
               "Source": "_source.PersonalEmailAddress",
               "Target": "_profile.PersonalEmailAddress"
           },
           "State": {
               "ContentType": "STRING",
               "Source": "_source.State",
               "Target": "_profile.Address.State"
           },
           "CustomerId": {
               "ContentType": "STRING",
               "Source": "_source.CustomerId",
               "Target": "_profile.Attributes.CustomerId"
           },
           "ProfileType": {
               "ContentType": "STRING",
               "Source": "_source.ProfileType",
               "Target": "_profile.ProfileType"
           }
       },
       "Keys": {
           "CustomerId": [
               {
                   "FieldNames": [
                       "CustomerId"
                   ],
                   "StandardIdentifiers": [
                       "PROFILE",
                       "UNIQUE"
                   ]
               }
           ]
       }
   }
   ```

1. 重复该过程以摄取基于账户的配置文件。注意 EngagementPreferences。电子邮件和 EngagementPreference .Phone。  
![重复该过程以摄取基于账户的配置文件。注意 EngagementPreferences。电子邮件和 EngagementPreference .Phone。](http://docs.aws.amazon.com/zh_cn/connect/latest/adminguide/images/customer-profiles-ingesting-account-based-profiles-3.png)

   **用于摄取基于账户的配置文件的对象类型映射示例**

   ```
   {
       "AllowProfileCreation": true,
       "Description": "Account-based profiles Object Type",
       "Fields": {
           "AccountNumber": {
               "ContentType": "STRING",
               "Source": "_source.AccountId",
               "Target": "_profile.AccountNumber"
           },
           "PrimaryOwner": {
               "ContentType": "STRING",
               "Source": "_source.PrimaryOwner",
               "Target": "_profile.Attributes.PrimaryOwner"
           },
           "SecondaryOwner": {
               "ContentType": "STRING",
               "Source": "_source.SecondaryOwner",
               "Target": "_profile.Attributes.SecondaryOwner"
           },
           "ProfileType": {
               "ContentType": "STRING",
               "Source": "_source.ProfileType",
               "Target": "_profile.ProfileType"
           },
           "EmailEngagementPreferences": {
               "ContentType": "STRING",
               "Source": "_source.EmailEngagementPreferences",
               "Target": "_profile.EngagementPreferences.Email"
           },
           "PhoneEngagementPreferences": {
               "ContentType": "STRING",
               "Source": "_source.PhoneEngagementPreferences",
               "Target": "_profile.EngagementPreferences.Phone"
           }
       },
       "Keys": {
           "Account": [
               {
                   "FieldNames": [
                       "AccountNumber"
                   ],
                   "StandardIdentifiers": [
                       "PROFILE",
                       "UNIQUE"
                   ]
               }
           ]
       }
   }
   ```

1. 创建两个数据来源集成，每个集成将基于所描述的关系创建一个映射。例如，账户/配置文件。

**注意**  
只有在使用 Amazon Connect 客户档案控制台中的 [SearchProfiles](https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-customer-profiles_SearchProfiles.html)API 或个人资料指标验证成功获取了基于账户的资料中引用的配置文件后，才应提取基于账户的个人资料。
自动生成映射不适用于摄取基于账户的配置文件及其子配置文件。
联系人首选项的电子邮件和电话列表可以具有 `KeyName` 和 `KeyValue` 或 `ProfileId` 以引用子配置文件。`KeyName` 应该是唯一的标识符。
更新子配置文件不会更新基于账户的配置文件中的互动偏好。更新必须通过摄取路径来进行。