

# Use the Amazon Connect Customer Profiles API


For information about how to programmatically manage domains and profiles, see the [Amazon Connect Customer Profiles API Reference](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/Welcome.html).

## ListObjectTypeAttributeValues API


The ListObjectTypeAttributeValues API provides access to the most recent distinct values for any specified attribute, making it valuable for real-time data validation and consistency checks within your object types. This API works across domain, supporting both custom and standard object types. The API accepts the object type name, attribute name, and domain name as input parameters and returns values up to the storage limit of approximately 350KB.

**Note:**
+ We store up to 350KB of attribute values per field, prioritizing the most recent values first. Once this limit is reached, older values will be automatically removed to make space for new entries.

## GetObjectTypeAttributeValues API


The GetObjectTypeAttributeValues API delivers statistical insights about attributes within a specific object type, but is exclusively available for domains with Data store enabled. This API performs daily calculations to provide statistical information about your attribute values, helping you understand patterns and trends in your data. The statistical calculations are performed once per day, providing a consistent snapshot of your attribute data characteristics.

**Note:**
+ You'll receive null values in two scenarios:
  + During the first period after enabling data vault (unless a calculation cycle occurs, which happens once daily).
  + For attributes that don't contain numeric values.

We recommend using the CustomerProfileJS open source library when integrating Customer Profiles into your own agent application. For more information, see the CustomerProfilesJS repo on [Github](https://github.com/amazon-connect/amazon-connect-customer-profiles).

For more information about how to integrate your existing apps with Amazon Connect use [Amazon Connect Streams](https://github.com/aws/amazon-connect-streams). You can embed the Contact Control Panel (CCP) components into your app.

# Understanding IPv6 support in Amazon Connect Customer Profiles
Understanding IPv6 support

## Public Connectivity


All Amazon Connect Customer Profiles APIs fully support IPv4 and IPv6 calls.

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

**For example:**

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

For AWS CLI, you'll need to use these endpoints explicitly:

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

The old APIs are still available as backward compatibility. They only support IPv4 calls.

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

**For example:**

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

## Private Connectivity


You can create a VPC endpoint for the Amazon Connect Customer Profiles service using either the Amazon VPC console or the AWS Command Line Interface (AWS CLI). For more information, see [Creating an interface endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html) in the AWS PrivateLink Guide.

Create a VPC endpoint for Amazon Connect Customer Profiles using the following service name:

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

**For example:**

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

If you enable private DNS for the endpoint, you can make API requests to Amazon Connect Customer Profiles using its IPv4 and IPv6 supported DNS name for the Region, for example, profile.us-east-1.api.aws.

Alternatively, old DNS name for the region is also supported as IPv4 only.

**For example:**

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

# Example: Programmatically integrate Amazon S3 with Amazon Connect Customer Profiles
Example: Integrate with S3

Using the Customer Profiles [PutIntegration](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutIntegration.html) API, you can programmatically create integrations for S3, Salesforce, Marketo, and more. 

In this topic we show how to create an S3 integration with a sync interval of 15 minutes, the minimum value currently supported. 

## Step 1: Create a JSON file
Step 1: Create a JSON file

Create a JSON file with the following contents:

```
{
    "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"}
        ]
    }
}
```

To customize the JSON with your own values, follow these guidelines:
+ `FlowName`: Can be STRING [a-zA-Z0-9][\$1w\$1@\$1.-]\$1
+ `ScheduleStartTime`: Set to the current `DateTime` \$1 5 minutes in epoch time.
+ `FirstExecutionFrom`: Go to S3, look at the file date, and use a date that is before the oldest date.
+ `Tasks`: Define `TaskType`. In the `Sourcefields` field you have to supply ALL the columns you have in your CSV in that array. Then, for each of the items in that array, you need to specify the `ConnectorOperator`. This example is for a CSV document with two columns: `colA` and `colB`.

## Step 2: Call the PutIntegration API
Step 2: Call PutIntegration

After you have created and customized the JSON file with your values, call the [PutIntegration](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutIntegration.html) API, as shown in the following example:

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

The response from `PutIntegration` returns a flow URI. For example:

```
{
    "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": {}
}
```

## Step 3: Call the Amazon AppFlow StartFlow API
Step 3: Call Amazon AppFlow StartFlow

Use the flow URI to call the Amazon AppFlow [StartFlow](https://docs.aws.amazon.com/appflow/1.0/APIReference/API_StartFlow.html) API. For example:

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