MergeProfiles - Amazon Connect

MergeProfiles

Runs an AWS Lambda job that does the following:

  1. All the profileKeys in the ProfileToBeMerged will be moved to the main profile.

  2. All the objects in the ProfileToBeMerged will be moved to the main profile.

  3. All the ProfileToBeMerged will be deleted at the end.

  4. All the profileKeys in the ProfileIdsToBeMerged will be moved to the main profile.

  5. Standard fields are merged as follows:

    1. Fields are always "union"-ed if there are no conflicts in standard fields or attributeKeys.

    2. When there are conflicting fields:

      1. If no SourceProfileIds entry is specified, the main Profile value is always taken.

      2. If a SourceProfileIds entry is specified, the specified profileId is always taken, even if it is a NULL value.

You can use MergeProfiles together with GetMatches, which returns potentially matching profiles, or use it with the results of another matching system. After profiles have been merged, they cannot be separated (unmerged).

Request Syntax

POST /domains/DomainName/profiles/objects/merge HTTP/1.1 Content-type: application/json { "FieldSourceProfileIds": { "AccountNumber": "string", "AdditionalInformation": "string", "Address": "string", "Attributes": { "string" : "string" }, "BillingAddress": "string", "BirthDate": "string", "BusinessEmailAddress": "string", "BusinessName": "string", "BusinessPhoneNumber": "string", "EmailAddress": "string", "FirstName": "string", "Gender": "string", "HomePhoneNumber": "string", "LastName": "string", "MailingAddress": "string", "MiddleName": "string", "MobilePhoneNumber": "string", "PartyType": "string", "PersonalEmailAddress": "string", "PhoneNumber": "string", "ShippingAddress": "string" }, "MainProfileId": "string", "ProfileIdsToBeMerged": [ "string" ] }

URI Request Parameters

The request uses the following URI parameters.

DomainName

The unique name of the domain.

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^[a-zA-Z0-9_-]+$

Required: Yes

Request Body

The request accepts the following data in JSON format.

FieldSourceProfileIds

The identifiers of the fields in the profile that has the information you want to apply to the merge. For example, say you want to merge EmailAddress from Profile1 into MainProfile. This would be the identifier of the EmailAddress field in Profile1.

Type: FieldSourceProfileIds object

Required: No

MainProfileId

The identifier of the profile to be taken.

Type: String

Pattern: [a-f0-9]{32}

Required: Yes

ProfileIdsToBeMerged

The identifier of the profile to be merged into MainProfileId.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 20 items.

Pattern: [a-f0-9]{32}

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "Message": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Message

A message that indicates the merge request is complete.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

BadRequestException

The input you provided is invalid.

HTTP Status Code: 400

InternalServerException

An internal service error occurred.

HTTP Status Code: 500

ResourceNotFoundException

The requested resource does not exist, or access was denied.

HTTP Status Code: 404

ThrottlingException

You exceeded the maximum number of requests.

HTTP Status Code: 429

Examples

Example 1

Fields are always "union"-ed if there are no conflicts in standard fields or attributeKeys.

MainProfile: { "FirstName": "Jane" } ProfileToBeMerged1: { "LastName": "Doe" } ProfileToBeMerged2: { "MiddleName": "None" } mergeOf(MainProfile, [ProfileToBeMerged1, ProfileToBeMerged2] // Yields a MainProfile that looks like the following: MainProfile: { "FirstName": "Jane", "LastName": "Doe", "MiddleName": "None" }

Example 2

When there are conflicting fields, if no SourceProfileIds entry is specified, the main Profile value is always taken.

MainProfile: { "FirstName": "Jane" } ProfileToBeMerged1: { "LastName": "Doe" } ProfileToBeMerged2: { "FirstName": "Jorge" // Note that this has conflict with MainProfile } mergeOf(MainProfile, [ProfileToBeMerged1, ProfileToBeMerged2] // Yields a MainProfile that looks like the following: MainProfile: { "FirstName": "Jane", // "Jane" stays as that is what MainProfile is "LastName": "Doe" }

Example 3

When there are conflicting fields, if a SourceProfileIds entry is specified, the specified profileId is always taken, even if it is a NULL value.

MainProfile: { "FirstName": "Jane" } ProfileToBeMerged1: { "LastName": "Doe" } ProfileToBeMerged2: { "FirstName": "Jorge" // Note that this has conflict with MainProfile } SourceProfileIds: { "FirstName": "secondaryProfile2" } mergeOf(MainProfile, [ProfileToBeMerged1, ProfileToBeMerged2] // Yields a MainProfile that looks like the following: MainProfile: { "FirstName": "Jorge", // "Jorge" gets picked because SourceProfileIds is specified "LastName": "Doe" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: