

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon Connect Customer Profiles API を使用する
<a name="use-customerprofiles-api"></a>

プログラムでドメインとプロファイルを管理する方法については、「[Amazon Connect Customer Profiles API Reference](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/Welcome.html)」を参照してください。

## ListObjectTypeAttributeValues API
<a name="listobjecttypeattributevalues-api"></a>

ListObjectTypeAttributeValues API は、指定された属性の最新の個別の値にアクセスできるため、オブジェクトタイプ内のリアルタイムのデータ検証と整合性チェックに役立ちます。この API はドメイン間で動作し、カスタムオブジェクトタイプと標準オブジェクトタイプの両方をサポートします。API は、オブジェクトタイプ名、属性名、ドメイン名を入力パラメータとして受け入れ、約 350KB のストレージ制限までの値を返します。

**メモ:**
+ フィールドごとに最大 350KB の属性値を保存し、最新の値を最初に優先します。この制限に達すると、新しいエントリのスペースを確保するために、古い値が自動的に削除されます。

## GetObjectTypeAttributeValues API
<a name="getobjecttypeattributevalues-api"></a>

GetObjectTypeAttributeValues API は、特定のオブジェクトタイプ内の属性に関する統計インサイトを提供しますが、データストアが有効になっているドメインでのみ使用できます。この API は、毎日の計算を実行して属性値に関する統計情報を提供し、データのパターンと傾向を理解するのに役立ちます。統計計算は 1 日に 1 回実行され、属性データ特性の一貫したスナップショットを提供します。

**メモ:**
+ 2 つのシナリオで null 値を受け取ります。
  + データボールトを有効にした後の最初の期間中 (計算サイクルが発生しない限り、1 日に 1 回）。
  + 数値を含まない属性の場合。

Customer Profiles を独自のエージェントアプリケーションに統合する場合は、CustomerProfileJS オープンソースライブラリを使用することをお勧めします。詳細については、[GitHub](https://github.com/amazon-connect/amazon-connect-customer-profiles) の CustomerProfilesJS リポジトリを参照してください。

既存のアプリケーションを Amazon Connect と統合する方法の詳細については、「[Amazon Connect Streams](https://github.com/aws/amazon-connect-streams)」を使用してください。問い合わせコントロールパネル (CCP) コンポーネントをアプリに埋め込むことができます。

# Amazon Connect Customer Profiles での IPv6 サポートについて
<a name="customerprofiles-ipv6-support"></a>

## パブリック接続
<a name="public-connectivity"></a>

すべての Amazon Connect Customer Profiles API は IPv4 呼び出しおよび IPv6 呼び出しを完全にサポートしています。

```
profile.Region.api.aws
```

**例：**

```
profile.us-east-1.api.aws
```

AWS CLI では、これらのエンドポイントを明示的に使用する必要があります。

```
aws customer-profiles list-domains \
    --endpoint https://profile.us-east-1.api.aws \
    --region us-east-1
```

古い API は、下位互換性として引き続き使用できます。これらは、IPv4 呼び出しのみをサポートします。

```
profile.Region.amazonaws.com
```

**例：**

```
profile.us-east-1.amazonaws.com
```

## プライベート接続
<a name="private-connectivity"></a>

Amazon VPC コンソールまたは AWS コマンドラインインターフェイス (AWS CLI) を使用して、Amazon Connect Customer Profiles サービスの VPC エンドポイントを作成できます。詳細については、「AWS PrivateLink ユーザーガイド」の「[インターフェイスエンドポイントの作成](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html)」を参照してください。

次のサービス名を使用して、Amazon Connect Customer Profiles の VPC エンドポイントを作成します。

```
com.amazonaws.Region.profile
```

**例：**

```
com.amazonaws.us-east-1.profile
```

エンドポイントのプライベート DNS を有効にすると、リージョンの IPv4 および IPv6 をサポートする DNS 名 (例、profile.us-east-1.api.aws) を使用して、Amazon Connect Customer Profiles への API リクエストを作成できます。

または、リージョンの古い DNS 名も IPv4 としてのみサポートされます。

**例：**

```
profile.us-east-1.amazonaws.com
```

# 例: Amazon Connect Customer Profiles と Amazon S3 をプログラムで統合する
<a name="customerprofiles-s3-integration"></a>

Customer Profiles の [PutIntegration](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutIntegration.html) API を使用して、S3、Salesforce、Marketo などの統合をプログラムで作成できます。

このトピックでは、現在サポートされている最小値である 15 分の同期間隔で S3 との統合を作成する方法を説明します。

## ステップ 1: JSON ファイルを作成する
<a name="step1-cpintegration"></a>

次の内容を含む JSON ファイルを作成します。

```
{
    "DomainName": "your-domain",
    "ObjectTypeName": "your-object-name", 
    "FlowDefinition": {
        "FlowName": "your-flow-name",
        "KmsArn": "the key ARN is the same as your domain's key",
        "Description": "Created by Customer Profiles",
        "TriggerConfig": {
            "TriggerType": "Scheduled",
            "TriggerProperties": {
                "Scheduled": {
                    "ScheduleExpression": "rate(15minutes)",
                    "DataPullMode": "Incremental",
                    "ScheduleStartTime": 1634244800.435,
                    "FirstExecutionFrom": 1594166400
                }
            }
        },
        "SourceFlowConfig": {
            "ConnectorType":"S3",
            "SourceConnectorProperties": {
                "S3": {
                    "BucketName": "your-bucket",
                    "BucketPrefix": "your-prefix"
                }
            }
        },
        "Tasks": [
            {"TaskType":"Filter","SourceFields":["colA","colB"],"ConnectorOperator":{"S3":"PROJECTION"}},
            {"ConnectorOperator":{"S3":"NO_OP"},"DestinationField":"colA","TaskProperties":{},"SourceFields":["colA"],"TaskType":"Map"},
            {"ConnectorOperator":{"S3":"NO_OP"},"DestinationField":"colB","TaskProperties":{},"SourceFields":["colB"],"TaskType":"Map"}
        ]
    }
}
```

JSON を独自の値でカスタマイズするには、以下のガイドラインに従います。
+ `FlowName`: STRING [a-zA-Z0-9][\$1w\$1@\$1.-]\$1 を使用できる。
+ `ScheduleStartTime`: 現在の `DateTime` \$1 5 分のエポックタイムを設定する
+ `FirstExecutionFrom`: S3 に移動し、ファイルの日付を見て、最も古い日付より前の日付を使用する。
+ `Tasks`: `TaskType` を定義する。`Sourcefields` フィールドには、その配列内の CSV にあるすべての列を指定する必要があります。次に、その配列内の各項目に対して、`ConnectorOperator` を指定する必要があります。次は、`colA` と `colB` の 2 つの列を持つ CSV ドキュメントの例です。

## ステップ 2: PutIntegration API を呼び出す
<a name="step2-cpintegration"></a>

値を使用して JSON ファイルを作成し、カスタマイズしたら、次の例に示すように [PutIntegration](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutIntegration.html) API を呼び出します。

```
aws customer-profiles put-integration --cli-input-json file:///put_integration_s3_cli.json --region us-west-2                    
```

`PutIntegration` からの応答はフロー URI を返します。例: 

```
{
    "DomainName": "testDomain",
    "Uri": "arn:aws:appflow:us-west-2:9999999999999:flow/Customer_Profiles_testDomain_S3_Salesforce-Account_1634244122247",
    "ObjectTypeName": "your objec type",
    "CreatedAt": "2021-10-14T13:51:57.748000-07:00",
    "LastUpdatedAt": "2021-10-14T13:51:57.748000-07:00",
    "Tags": {}
}
```

## ステップ 3: Amazon AppFlow StartFlow API を呼び出す
<a name="step3-cpintegration"></a>

フロー URI を使用して Amazon AppFlow [StartFlow](https://docs.aws.amazon.com/appflow/1.0/APIReference/API_StartFlow.html) API を呼び出します。例: 

```
aws appflow start-flow —flow-name uri --region us-west-2
```